From cf2197e0438968ab1fc084b5b4a3031f7fd6d362 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Fri, 8 Jan 2021 09:40:28 -0800 Subject: [PATCH] try v0.0.1 --- Makefile | 163 +- api/auth0/auth0_client/auth/auth_client.go | 78 + .../auth/post_credentials_parameters.go | 142 + .../auth/post_credentials_responses.go | 268 ++ api/auth0/auth0_client/auth0_client.go | 126 + .../auth0_client/role/get_roles_parameters.go | 136 + .../auth0_client/role/get_roles_responses.go | 266 ++ .../role/post_role_users_parameters.go | 181 + .../role/post_role_users_responses.go | 217 + api/auth0/auth0_client/role/role_client.go | 116 + ...e_api_v2_users_user_id_roles_parameters.go | 181 + ...te_api_v2_users_user_id_roles_responses.go | 217 + .../user/get_user_by_email_parameters.go | 158 + .../user/get_user_by_email_responses.go | 227 + .../user/get_user_roles_parameters.go | 157 + .../user/get_user_roles_responses.go | 229 + .../auth0_client/user/get_users_parameters.go | 136 + .../auth0_client/user/get_users_responses.go | 227 + .../user/post_users_parameters.go | 160 + .../auth0_client/user/post_users_responses.go | 244 + api/auth0/auth0_client/user/user_client.go | 228 + api/auth0/auth0_models/credentials_request.go | 56 + .../auth0_models/credentials_response.go | 56 + api/auth0/auth0_models/error.go | 53 + api/auth0/auth0_models/new_user.go | 89 + api/auth0/auth0_models/role.go | 53 + api/auth0/auth0_models/role_response.go | 84 + api/auth0/auth0_models/role_users_request.go | 47 + api/auth0/auth0_models/user.go | 305 ++ api/auth0/auth0_models/user_request.go | 84 + api/auth0/auth0_models/user_roles_request.go | 47 + api/blaze/blaze_client/blaze_client.go | 141 + .../members/get_member_parameters.go | 139 + .../members/get_member_responses.go | 229 + .../blaze_client/members/members_client.go | 77 + .../products/get_product_parameters.go | 139 + .../products/get_product_responses.go | 229 + .../products/get_products_parameters.go | 116 + .../products/get_products_responses.go | 229 + .../blaze_client/products/products_client.go | 114 + .../get_purchase_order_list_parameters.go | 233 + .../get_purchase_order_list_responses.go | 229 + .../purchase_orders/purchase_orders_client.go | 77 + .../blaze_client/shop/get_shop_parameters.go | 116 + .../blaze_client/shop/get_shop_responses.go | 229 + api/blaze/blaze_client/shop/shop_client.go | 77 + .../get_transaction_by_id_parameters.go | 139 + .../get_transaction_by_id_responses.go | 229 + .../get_transactions_parameters.go | 233 + .../get_transactions_responses.go | 229 + .../transactions/transactions_client.go | 114 + .../vendors/get_vendor_parameters.go | 139 + .../vendors/get_vendor_responses.go | 229 + .../blaze_client/vendors/vendors_client.go | 77 + api/blaze/blaze_models/error.go | 80 + api/blaze/blaze_models/invalid_error.go | 104 + api/blaze/blaze_models/member_response.go | 855 ++++ api/blaze/blaze_models/message.go | 50 + api/blaze/blaze_models/product_response.go | 1835 ++++++++ api/blaze/blaze_models/products_response.go | 908 ++++ .../purchase_order_list_response.go | 2322 ++++++++++ api/blaze/blaze_models/shop_response.go | 2533 ++++++++++ .../transaction_by_id_response.go | 2525 ++++++++++ .../blaze_models/transactions_response.go | 4091 +++++++++++++++++ api/blaze/blaze_models/vendor_response.go | 356 ++ .../crm_client/accounts/accounts_client.go | 235 + .../accounts/delete_account_parameters.go | 150 + .../accounts/delete_account_responses.go | 298 ++ .../get_accounts_observable_parameters.go | 247 + .../get_accounts_observable_responses.go | 301 ++ .../accounts/get_accounts_parameters.go | 311 ++ .../accounts/get_accounts_responses.go | 303 ++ .../accounts/post_accounts_parameters.go | 142 + .../accounts/post_accounts_responses.go | 303 ++ .../accounts/put_account_parameters.go | 142 + .../accounts/put_account_responses.go | 303 ++ .../crm_client/companies/companies_client.go | 157 + .../get_companies_observable_parameters.go | 150 + .../get_companies_observable_responses.go | 301 ++ .../companies/get_companies_parameters.go | 150 + .../companies/get_companies_responses.go | 303 ++ .../companies/post_companies_parameters.go | 142 + .../companies/post_companies_responses.go | 303 ++ .../crm_client/contacts/contacts_client.go | 235 + .../contacts/delete_contact_parameters.go | 150 + .../contacts/delete_contact_responses.go | 298 ++ .../get_contacts_observable_parameters.go | 247 + .../get_contacts_observable_responses.go | 301 ++ .../contacts/get_contacts_parameters.go | 311 ++ .../contacts/get_contacts_responses.go | 303 ++ .../contacts/post_contacts_parameters.go | 142 + .../contacts/post_contacts_responses.go | 303 ++ .../contacts/put_contacts_parameters.go | 142 + .../contacts/put_contacts_responses.go | 303 ++ .../account_options_observable_parameters.go | 116 + .../account_options_observable_responses.go | 92 + .../cors/account_options_parameters.go | 116 + .../cors/account_options_responses.go | 92 + .../company_observable_options_parameters.go | 116 + .../company_observable_options_responses.go | 92 + .../cors/company_options_parameters.go | 116 + .../cors/company_options_responses.go | 92 + .../contact_options_observable_parameters.go | 116 + .../contact_options_observable_responses.go | 92 + .../cors/contact_options_parameters.go | 116 + .../cors/contact_options_responses.go | 92 + api/crm/crm_client/cors/cors_client.go | 328 ++ .../lead_options_observable_parameters.go | 116 + .../cors/lead_options_observable_responses.go | 92 + .../cors/lead_options_parameters.go | 116 + .../crm_client/cors/lead_options_responses.go | 92 + api/crm/crm_client/crm_client.go | 136 + .../leads/delete_lead_parameters.go | 150 + .../crm_client/leads/delete_lead_responses.go | 298 ++ .../leads/get_leads_observable_parameters.go | 214 + .../leads/get_leads_observable_responses.go | 301 ++ .../crm_client/leads/get_leads_parameters.go | 279 ++ .../crm_client/leads/get_leads_responses.go | 303 ++ api/crm/crm_client/leads/leads_client.go | 235 + .../crm_client/leads/post_leads_parameters.go | 142 + .../crm_client/leads/post_leads_responses.go | 303 ++ .../crm_client/leads/put_leads_parameters.go | 142 + .../crm_client/leads/put_leads_responses.go | 303 ++ api/crm/crm_models/account.go | 402 ++ api/crm/crm_models/account_basic.go | 188 + api/crm/crm_models/account_basic_response.go | 109 + api/crm/crm_models/account_request.go | 84 + api/crm/crm_models/account_response.go | 109 + api/crm/crm_models/address.go | 65 + api/crm/crm_models/company.go | 202 + api/crm/crm_models/company_request.go | 84 + api/crm/crm_models/company_response.go | 109 + api/crm/crm_models/contact.go | 229 + api/crm/crm_models/contact_request.go | 84 + api/crm/crm_models/contact_response.go | 109 + api/crm/crm_models/delete_response.go | 109 + api/crm/crm_models/error.go | 53 + api/crm/crm_models/invalid_error.go | 104 + api/crm/crm_models/lead.go | 156 + api/crm/crm_models/lead_request.go | 84 + api/crm/crm_models/lead_response.go | 109 + api/crm/crm_models/message.go | 53 + api/crm/crm_models/pagination.go | 56 + api/crm/crm_models/request_meta.go | 68 + api/crm/crm_models/response_meta.go | 108 + .../devops_client/cluster/cluster_client.go | 235 + .../cluster/get_cluster_parameters.go | 139 + .../cluster/get_cluster_responses.go | 313 ++ .../get_clusters_observable_parameters.go | 116 + .../get_clusters_observable_responses.go | 311 ++ .../cluster/get_clusters_parameters.go | 247 + .../cluster/get_clusters_responses.go | 313 ++ .../cluster/post_clusters_parameters.go | 142 + .../cluster/post_clusters_responses.go | 313 ++ .../cluster/put_clusters_parameters.go | 142 + .../cluster/put_clusters_responses.go | 313 ++ .../cors/cluster_options_parameters.go | 116 + .../cors/cluster_options_responses.go | 92 + .../cors/clusters_options_parameters.go | 116 + .../cors/clusters_options_responses.go | 92 + api/devops/devops_client/cors/cors_client.go | 616 +++ .../cors/database_options_parameters.go | 116 + .../cors/database_options_responses.go | 92 + .../cors/databases_options_parameters.go | 116 + .../cors/databases_options_responses.go | 92 + .../cors/ingest_options_parameters.go | 116 + .../cors/ingest_options_responses.go | 92 + .../cors/ingests_options_parameters.go | 116 + .../cors/ingests_options_responses.go | 92 + .../cors/job_options_parameters.go | 116 + .../cors/job_options_responses.go | 92 + .../cors/jobs_options_parameters.go | 116 + .../cors/jobs_options_responses.go | 92 + .../cors/service_options_parameters.go | 116 + .../cors/service_options_responses.go | 92 + .../cors/services_options_parameters.go | 116 + .../cors/services_options_responses.go | 92 + .../cors/template_options_parameters.go | 116 + .../cors/template_options_responses.go | 92 + .../cors/templates_options_parameters.go | 116 + .../cors/templates_options_responses.go | 92 + .../cors/tenant_options_parameters.go | 116 + .../cors/tenant_options_responses.go | 92 + .../cors/tenants_options_parameters.go | 116 + .../cors/tenants_options_responses.go | 92 + .../cors/user_options_parameters.go | 116 + .../cors/user_options_responses.go | 92 + .../cors/users_options_parameters.go | 116 + .../cors/users_options_responses.go | 92 + .../devops_client/database/database_client.go | 235 + .../database/get_database_parameters.go | 139 + .../database/get_database_responses.go | 313 ++ .../get_databases_observable_parameters.go | 116 + .../get_databases_observable_responses.go | 311 ++ .../database/get_databases_parameters.go | 247 + .../database/get_databases_responses.go | 308 ++ .../database/post_databases_parameters.go | 142 + .../database/post_databases_responses.go | 308 ++ .../database/put_databases_parameters.go | 142 + .../database/put_databases_responses.go | 308 ++ api/devops/devops_client/devops_client.go | 156 + .../ingest/get_ingest_parameters.go | 139 + .../ingest/get_ingest_responses.go | 313 ++ .../get_ingests_observable_parameters.go | 116 + .../get_ingests_observable_responses.go | 311 ++ .../ingest/get_ingests_parameters.go | 279 ++ .../ingest/get_ingests_responses.go | 313 ++ .../devops_client/ingest/ingest_client.go | 235 + .../ingest/post_ingests_parameters.go | 142 + .../ingest/post_ingests_responses.go | 313 ++ .../ingest/put_ingests_parameters.go | 142 + .../ingest/put_ingests_responses.go | 313 ++ .../devops_client/job/get_job_parameters.go | 139 + .../devops_client/job/get_job_responses.go | 313 ++ .../job/get_jobs_observable_parameters.go | 116 + .../job/get_jobs_observable_responses.go | 311 ++ .../devops_client/job/get_jobs_parameters.go | 311 ++ .../devops_client/job/get_jobs_responses.go | 313 ++ api/devops/devops_client/job/job_client.go | 235 + .../devops_client/job/post_jobs_parameters.go | 142 + .../devops_client/job/post_jobs_responses.go | 313 ++ .../devops_client/job/put_jobs_parameters.go | 142 + .../devops_client/job/put_jobs_responses.go | 313 ++ .../service/get_service_parameters.go | 139 + .../service/get_service_responses.go | 313 ++ .../get_services_observable_parameters.go | 116 + .../get_services_observable_responses.go | 311 ++ .../service/get_services_parameters.go | 215 + .../service/get_services_responses.go | 313 ++ .../service/post_services_parameters.go | 142 + .../service/post_services_responses.go | 313 ++ .../service/put_services_parameters.go | 142 + .../service/put_services_responses.go | 313 ++ .../devops_client/service/service_client.go | 235 + .../template/get_template_parameters.go | 139 + .../template/get_template_responses.go | 313 ++ .../get_templates_observable_parameters.go | 116 + .../get_templates_observable_responses.go | 311 ++ .../template/get_templates_parameters.go | 311 ++ .../template/get_templates_responses.go | 313 ++ .../template/post_templates_parameters.go | 142 + .../template/post_templates_responses.go | 313 ++ .../devops_client/template/template_client.go | 196 + .../tenant/get_tenant_parameters.go | 139 + .../tenant/get_tenant_responses.go | 313 ++ .../get_tenants_observable_parameters.go | 116 + .../get_tenants_observable_responses.go | 311 ++ .../tenant/get_tenants_parameters.go | 279 ++ .../tenant/get_tenants_responses.go | 308 ++ .../tenant/post_tenants_parameters.go | 142 + .../tenant/post_tenants_responses.go | 308 ++ .../tenant/put_tenants_parameters.go | 142 + .../tenant/put_tenants_responses.go | 308 ++ .../devops_client/tenant/tenant_client.go | 235 + .../devops_client/user/get_user_parameters.go | 139 + .../devops_client/user/get_user_responses.go | 313 ++ .../user/get_users_observable_parameters.go | 116 + .../user/get_users_observable_responses.go | 311 ++ .../user/get_users_parameters.go | 375 ++ .../devops_client/user/get_users_responses.go | 313 ++ .../user/post_users_parameters.go | 142 + .../user/post_users_responses.go | 313 ++ .../user/put_users_parameters.go | 142 + .../devops_client/user/put_users_responses.go | 313 ++ api/devops/devops_client/user/user_client.go | 235 + api/devops/devops_models/address.go | 65 + api/devops/devops_models/cluster.go | 95 + api/devops/devops_models/cluster_request.go | 84 + api/devops/devops_models/cluster_response.go | 109 + api/devops/devops_models/database.go | 83 + api/devops/devops_models/database_request.go | 84 + api/devops/devops_models/database_response.go | 109 + api/devops/devops_models/delete_response.go | 109 + api/devops/devops_models/error.go | 53 + api/devops/devops_models/ingest.go | 443 ++ api/devops/devops_models/ingest_request.go | 84 + api/devops/devops_models/ingest_response.go | 109 + api/devops/devops_models/job.go | 484 ++ api/devops/devops_models/job_request.go | 84 + api/devops/devops_models/job_response.go | 109 + api/devops/devops_models/message.go | 53 + api/devops/devops_models/pagination.go | 56 + api/devops/devops_models/request_meta.go | 68 + api/devops/devops_models/response_meta.go | 108 + api/devops/devops_models/role.go | 71 + api/devops/devops_models/role_request.go | 84 + api/devops/devops_models/role_response.go | 109 + api/devops/devops_models/service.go | 113 + api/devops/devops_models/service_request.go | 84 + api/devops/devops_models/service_response.go | 109 + api/devops/devops_models/template.go | 93 + api/devops/devops_models/template_request.go | 84 + api/devops/devops_models/template_response.go | 109 + api/devops/devops_models/tenant.go | 181 + api/devops/devops_models/tenant_request.go | 84 + api/devops/devops_models/tenant_response.go | 109 + api/devops/devops_models/tenant_user.go | 92 + api/devops/devops_models/user.go | 306 ++ api/devops/devops_models/user_request.go | 84 + api/devops/devops_models/user_response.go | 109 + api/devops/devops_models/user_role.go | 83 + .../coordinate/coordinate_client.go | 235 + .../delete_coordinate_parameters.go | 150 + .../coordinate/delete_coordinate_responses.go | 303 ++ .../get_coordinate_basic_parameters.go | 278 ++ .../get_coordinate_basic_responses.go | 303 ++ .../get_coordinate_observable_parameters.go | 278 ++ .../get_coordinate_observable_responses.go | 301 ++ .../coordinate/get_coordinates_parameters.go | 278 ++ .../coordinate/get_coordinates_responses.go | 303 ++ .../coordinate/post_coordinates_parameters.go | 142 + .../coordinate/post_coordinates_responses.go | 303 ++ api/geo/geo_client/cors/cors_client.go | 688 +++ ...ordinates_observable_options_parameters.go | 116 + ...oordinates_observable_options_responses.go | 92 + .../get_coordinates_options_parameters.go | 116 + .../cors/get_coordinates_options_responses.go | 92 + ..._counties_observable_options_parameters.go | 116 + ...t_counties_observable_options_responses.go | 92 + .../cors/get_counties_options_parameters.go | 116 + .../cors/get_counties_options_responses.go | 92 + ...countries_observable_options_parameters.go | 116 + ..._countries_observable_options_responses.go | 92 + .../cors/get_countries_options_parameters.go | 116 + .../cors/get_countries_options_responses.go | 92 + ...t_domains_observable_options_parameters.go | 116 + ...et_domains_observable_options_responses.go | 92 + .../cors/get_domains_options_parameters.go | 116 + .../cors/get_domains_options_responses.go | 92 + ...et_places_observable_options_parameters.go | 116 + ...get_places_observable_options_responses.go | 92 + .../cors/get_places_options_parameters.go | 116 + .../cors/get_places_options_responses.go | 92 + ...et_states_observable_options_parameters.go | 116 + ...get_states_observable_options_responses.go | 92 + .../cors/get_states_options_parameters.go | 116 + .../cors/get_states_options_responses.go | 92 + ..._tax_rate_observable_options_parameters.go | 116 + ...t_tax_rate_observable_options_responses.go | 92 + .../cors/get_tax_rates_options_parameters.go | 116 + .../cors/get_tax_rates_options_responses.go | 92 + ..._tax_type_observable_options_parameters.go | 116 + ...t_tax_type_observable_options_responses.go | 92 + .../cors/get_tax_types_options_parameters.go | 116 + .../cors/get_tax_types_options_responses.go | 92 + ...xus_codes_observable_options_parameters.go | 116 + ...exus_codes_observable_options_responses.go | 92 + .../get_taxnexus_codes_options_parameters.go | 116 + .../get_taxnexus_codes_options_responses.go | 92 + api/geo/geo_client/country/country_client.go | 157 + .../get_countries_observable_parameters.go | 182 + .../get_countries_observable_responses.go | 301 ++ .../country/get_countries_parameters.go | 247 + .../country/get_countries_responses.go | 303 ++ .../country/post_countries_parameters.go | 139 + .../country/post_countries_responses.go | 259 ++ api/geo/geo_client/county/county_client.go | 157 + .../get_counties_observable_parameters.go | 246 + .../get_counties_observable_responses.go | 301 ++ .../county/get_counties_parameters.go | 311 ++ .../county/get_counties_responses.go | 303 ++ .../county/post_counties_parameters.go | 139 + .../county/post_counties_responses.go | 259 ++ api/geo/geo_client/domain/domain_client.go | 157 + .../get_domain_observable_parameters.go | 116 + .../domain/get_domain_observable_responses.go | 301 ++ .../domain/get_domains_parameters.go | 116 + .../domain/get_domains_responses.go | 303 ++ .../domain/post_domains_parameters.go | 139 + .../domain/post_domains_responses.go | 303 ++ api/geo/geo_client/geo_client.go | 161 + .../place/get_place_observable_parameters.go | 214 + .../place/get_place_observable_responses.go | 301 ++ .../geo_client/place/get_places_parameters.go | 279 ++ .../geo_client/place/get_places_responses.go | 303 ++ api/geo/geo_client/place/place_client.go | 157 + .../place/post_places_parameters.go | 142 + .../geo_client/place/post_places_responses.go | 303 ++ .../state/get_state_observable_parameters.go | 214 + .../state/get_state_observable_responses.go | 301 ++ .../geo_client/state/get_states_parameters.go | 279 ++ .../geo_client/state/get_states_responses.go | 303 ++ .../state/post_states_parameters.go | 142 + .../geo_client/state/post_states_responses.go | 303 ++ api/geo/geo_client/state/state_client.go | 157 + .../get_tax_rate_observable_parameters.go | 207 + .../get_tax_rate_observable_responses.go | 301 ++ .../tax_rate/get_tax_rates_parameters.go | 207 + .../tax_rate/get_tax_rates_responses.go | 303 ++ .../geo_client/tax_rate/tax_rate_client.go | 118 + .../get_tax_types_observable_parameters.go | 116 + .../get_tax_types_observable_responses.go | 301 ++ .../tax_type/get_tax_types_parameters.go | 471 ++ .../tax_type/get_tax_types_responses.go | 303 ++ .../tax_type/post_tax_types_parameters.go | 142 + .../tax_type/post_tax_types_responses.go | 303 ++ .../geo_client/tax_type/tax_type_client.go | 157 + ...get_taxnexus_code_observable_parameters.go | 214 + .../get_taxnexus_code_observable_responses.go | 301 ++ .../get_taxnexus_codes_parameters.go | 215 + .../get_taxnexus_codes_responses.go | 303 ++ .../post_taxnexus_codes_parameters.go | 142 + .../post_taxnexus_codes_responses.go | 303 ++ .../taxnexus_code/taxnexus_code_client.go | 157 + api/geo/geo_models/address.go | 65 + api/geo/geo_models/coordinate.go | 183 + api/geo/geo_models/coordinate_basic.go | 114 + .../geo_models/coordinate_basic_response.go | 109 + api/geo/geo_models/coordinate_request.go | 84 + api/geo/geo_models/coordinate_request_item.go | 50 + api/geo/geo_models/coordinate_response.go | 109 + api/geo/geo_models/country.go | 159 + api/geo/geo_models/country_request.go | 84 + api/geo/geo_models/country_response.go | 109 + api/geo/geo_models/county.go | 220 + api/geo/geo_models/county_request.go | 84 + api/geo/geo_models/county_response.go | 109 + api/geo/geo_models/delete_response.go | 109 + api/geo/geo_models/domain.go | 56 + api/geo/geo_models/domain_request.go | 84 + api/geo/geo_models/domain_response.go | 109 + api/geo/geo_models/error.go | 53 + api/geo/geo_models/invalid_error.go | 104 + api/geo/geo_models/message.go | 53 + api/geo/geo_models/pagination.go | 56 + api/geo/geo_models/place.go | 226 + api/geo/geo_models/place_request.go | 84 + api/geo/geo_models/place_response.go | 109 + api/geo/geo_models/request_meta.go | 68 + api/geo/geo_models/response_meta.go | 108 + api/geo/geo_models/state.go | 189 + api/geo/geo_models/state_request.go | 84 + api/geo/geo_models/state_response.go | 109 + api/geo/geo_models/tax_instance.go | 74 + api/geo/geo_models/tax_rate.go | 86 + api/geo/geo_models/tax_rate_response.go | 109 + api/geo/geo_models/tax_type.go | 173 + api/geo/geo_models/tax_type_id.go | 47 + api/geo/geo_models/tax_type_request.go | 84 + api/geo/geo_models/tax_type_response.go | 109 + api/geo/geo_models/taxnexus_code.go | 110 + api/geo/geo_models/taxnexus_code_request.go | 84 + api/geo/geo_models/taxnexus_code_response.go | 109 + api/gov-gw/gov_gw_client/gov_gw_client.go | 116 + .../tax_rates/get_coordinates_parameters.go | 311 ++ .../tax_rates/get_coordinates_responses.go | 268 ++ .../tax_rates/tax_rates_client.go | 79 + api/gov-gw/gov_gw_models/coordinate.go | 153 + .../gov_gw_models/coordinate_request.go | 112 + .../gov_gw_models/coordinate_request_item.go | 50 + .../gov_gw_models/coordinate_response.go | 109 + api/gov-gw/gov_gw_models/error.go | 50 + api/gov-gw/gov_gw_models/invalid_error.go | 104 + api/gov-gw/gov_gw_models/pagination.go | 56 + api/gov-gw/gov_gw_models/request_meta.go | 68 + api/gov-gw/gov_gw_models/response_meta.go | 108 + api/gov-gw/gov_gw_models/tax_type_id.go | 47 + .../accounting_rule/accounting_rule_client.go | 118 + .../get_accounting_rules_parameters.go | 240 + .../get_accounting_rules_responses.go | 268 ++ .../post_accounting_rules_parameters.go | 142 + .../post_accounting_rules_responses.go | 268 ++ .../accounting_ruleset_client.go | 118 + .../get_accounting_rulesets_parameters.go | 208 + .../get_accounting_rulesets_responses.go | 268 ++ .../post_accounting_rulesets_parameters.go | 142 + .../post_accounting_rulesets_responses.go | 268 ++ api/ledger/ledger_client/coa/coa_client.go | 114 + .../ledger_client/coa/get_coas_parameters.go | 246 + .../ledger_client/coa/get_coas_responses.go | 268 ++ .../ledger_client/coa/post_coas_parameters.go | 142 + .../ledger_client/coa/post_coas_responses.go | 268 ++ .../gl_account/get_gl_accounts_parameters.go | 247 + .../gl_account/get_gl_accounts_responses.go | 268 ++ .../gl_account/gl_account_client.go | 118 + .../gl_account/post_gl_accounts_parameters.go | 142 + .../gl_account/post_gl_accounts_responses.go | 268 ++ .../gl_balance/get_gl_balances_parameters.go | 246 + .../gl_balance/get_gl_balances_responses.go | 268 ++ .../gl_balance/gl_balance_client.go | 118 + .../gl_balance/post_gl_balances_parameters.go | 142 + .../gl_balance/post_gl_balances_responses.go | 268 ++ .../get_journal_entries_parameters.go | 311 ++ .../get_journal_entries_responses.go | 268 ++ .../journal_entry/journal_entry_client.go | 118 + .../post_journal_entries_parameters.go | 142 + .../post_journal_entries_responses.go | 268 ++ .../get_journal_items_parameters.go | 240 + .../get_journal_items_responses.go | 268 ++ .../journal_item/journal_item_client.go | 79 + api/ledger/ledger_client/ledger_client.go | 151 + .../period/get_periods_parameters.go | 279 ++ .../period/get_periods_responses.go | 268 ++ .../ledger_client/period/period_client.go | 118 + .../period/post_periods_parameters.go | 142 + .../period/post_periods_responses.go | 268 ++ api/ledger/ledger_models/accounting_rule.go | 104 + .../ledger_models/accounting_rule_request.go | 84 + .../ledger_models/accounting_rule_response.go | 109 + .../ledger_models/accounting_ruleset.go | 111 + .../ledger_models/accounting_ruleset_item.go | 53 + .../accounting_ruleset_request.go | 84 + .../accounting_ruleset_response.go | 109 + api/ledger/ledger_models/coa.go | 120 + api/ledger/ledger_models/coa_item.go | 83 + api/ledger/ledger_models/coa_request.go | 84 + api/ledger/ledger_models/coa_response.go | 109 + api/ledger/ledger_models/delete_response.go | 109 + api/ledger/ledger_models/error.go | 53 + api/ledger/ledger_models/gl_account.go | 147 + .../ledger_models/gl_account_request.go | 84 + .../ledger_models/gl_account_response.go | 109 + api/ledger/ledger_models/gl_balance.go | 101 + .../ledger_models/gl_balance_request.go | 84 + .../ledger_models/gl_balance_response.go | 109 + api/ledger/ledger_models/invalid_error.go | 104 + api/ledger/ledger_models/journal_entry.go | 141 + .../ledger_models/journal_entry_request.go | 84 + .../ledger_models/journal_entry_response.go | 109 + api/ledger/ledger_models/journal_item.go | 107 + .../ledger_models/journal_item_response.go | 109 + .../ledger_models/journal_item_summary.go | 68 + .../journal_item_summary_response.go | 109 + api/ledger/ledger_models/message.go | 53 + api/ledger/ledger_models/pagination.go | 56 + api/ledger/ledger_models/period.go | 98 + api/ledger/ledger_models/period_request.go | 84 + api/ledger/ledger_models/period_response.go | 109 + api/ledger/ledger_models/put_response.go | 109 + api/ledger/ledger_models/request_meta.go | 68 + api/ledger/ledger_models/response_meta.go | 108 + .../facilities/facilities_client.go | 80 + .../facilities/get_facilities_parameters.go | 226 + .../facilities/get_facilities_responses.go | 229 + .../get_harvest_waste_types_parameters.go | 193 + .../get_harvest_waste_types_responses.go | 229 + .../harvests/get_harvests_parameters.go | 347 ++ .../harvests/get_harvests_responses.go | 229 + .../harvests/harvests_client.go | 196 + .../post_harvest_packages_parameters.go | 142 + .../post_harvest_packages_responses.go | 229 + .../harvests/put_harvests_parameters.go | 142 + .../harvests/put_harvests_responses.go | 229 + .../items/delete_item_parameters.go | 244 + .../items/delete_item_responses.go | 229 + .../items/get_brands_parameters.go | 193 + .../items/get_brands_responses.go | 190 + .../get_item_product_categories_parameters.go | 193 + .../get_item_product_categories_responses.go | 229 + .../items/get_items_parameters.go | 411 ++ .../items/get_items_responses.go | 229 + .../metrc_gw_client/items/items_client.go | 271 ++ .../items/post_items_parameters.go | 142 + .../items/post_items_responses.go | 229 + .../items/put_items_parameters.go | 142 + .../items/put_items_responses.go | 229 + .../get_labtest_states_parameters.go | 226 + .../lab_tests/get_labtest_states_responses.go | 229 + .../lab_tests/get_labtest_types_parameters.go | 226 + .../lab_tests/get_labtest_types_responses.go | 229 + .../lab_tests/lab_tests_client.go | 120 + .../metrc_gw_client/metrc_gw_client.go | 176 + ...t_package_adjustment_reasons_parameters.go | 193 + ...et_package_adjustment_reasons_responses.go | 229 + .../packages/get_package_types_parameters.go | 193 + .../packages/get_package_types_responses.go | 229 + .../packages/get_packages_parameters.go | 379 ++ .../packages/get_packages_responses.go | 229 + .../packages/packages_client.go | 238 + .../packages/post_packages_parameters.go | 142 + .../packages/post_packages_responses.go | 229 + .../packages/put_packages_parameters.go | 142 + .../packages/put_packages_responses.go | 229 + .../delete_plant_batch_parameters.go | 244 + .../delete_plant_batch_responses.go | 229 + .../get_plant_batches_parameters.go | 315 ++ .../get_plant_batches_responses.go | 229 + .../plant_batches/plant_batches_client.go | 198 + .../post_plant_batches_parameters.go | 142 + .../post_plant_batches_responses.go | 229 + .../put_plant_batches_parameters.go | 142 + .../put_plant_batches_responses.go | 229 + .../plants/delete_plant_parameters.go | 244 + .../plants/delete_plant_responses.go | 229 + .../get_plant_growth_phases_parameters.go | 251 + .../get_plant_growth_phases_responses.go | 229 + .../get_plant_waste_methods_parameters.go | 218 + .../get_plant_waste_methods_responses.go | 229 + .../get_plant_waste_reasons_parameters.go | 218 + .../get_plant_waste_reasons_responses.go | 229 + .../plants/get_plants_parameters.go | 315 ++ .../plants/get_plants_responses.go | 229 + .../metrc_gw_client/plants/plants_client.go | 315 ++ .../plants/post_plants_parameters.go | 142 + .../plants/post_plants_responses.go | 229 + .../plants/put_plants_parameters.go | 142 + .../plants/put_plants_responses.go | 229 + .../rooms/delete_room_parameters.go | 243 + .../rooms/delete_room_responses.go | 229 + .../rooms/get_rooms_parameters.go | 315 ++ .../rooms/get_rooms_responses.go | 229 + .../rooms/post_rooms_parameters.go | 142 + .../rooms/post_rooms_responses.go | 229 + .../rooms/put_rooms_parameters.go | 142 + .../rooms/put_rooms_responses.go | 229 + .../metrc_gw_client/rooms/rooms_client.go | 198 + .../sales/delete_sales_delivery_parameters.go | 243 + .../sales/delete_sales_delivery_responses.go | 229 + .../sales/delete_sales_receipts_parameters.go | 243 + .../sales/delete_sales_receipts_responses.go | 229 + .../sales/get_customer_types_parameters.go | 251 + .../sales/get_customer_types_responses.go | 229 + .../sales/get_sales_deliveries_parameters.go | 347 ++ .../sales/get_sales_deliveries_responses.go | 229 + ...ales_delivery_return_reasons_parameters.go | 251 + ...sales_delivery_return_reasons_responses.go | 229 + .../sales/get_sales_receipts_parameters.go | 347 ++ .../sales/get_sales_receipts_responses.go | 229 + .../get_sales_transaction_dates_parameters.go | 251 + .../get_sales_transaction_dates_responses.go | 229 + .../get_sales_transactions_parameters.go | 314 ++ .../sales/get_sales_transactions_responses.go | 229 + .../sales/post_sales_deliveries_parameters.go | 142 + .../sales/post_sales_deliveries_responses.go | 229 + .../sales/post_sales_receipts_parameters.go | 142 + .../sales/post_sales_receipts_responses.go | 229 + .../post_sales_transactions_parameters.go | 142 + .../post_sales_transactions_responses.go | 229 + .../sales/put_sales_deliveries_parameters.go | 142 + .../sales/put_sales_deliveries_responses.go | 229 + .../sales/put_sales_receipts_parameters.go | 142 + .../sales/put_sales_receipts_responses.go | 229 + .../put_sales_transactions_parameters.go | 142 + .../sales/put_sales_transactions_responses.go | 229 + .../metrc_gw_client/sales/sales_client.go | 594 +++ .../strains/delete_strain_parameters.go | 244 + .../strains/delete_strain_responses.go | 229 + .../strains/get_strains_parameters.go | 379 ++ .../strains/get_strains_responses.go | 229 + .../strains/post_strains_parameters.go | 142 + .../strains/post_strains_responses.go | 229 + .../strains/put_strains_parameters.go | 142 + .../strains/put_strains_responses.go | 229 + .../metrc_gw_client/strains/strains_client.go | 198 + .../sys/get_metrics_parameters.go | 116 + .../sys/get_metrics_responses.go | 58 + .../metrc_gw_client/sys/sys_client.go | 79 + .../transfers/get_transfers_parameters.go | 507 ++ .../transfers/get_transfers_responses.go | 229 + .../transfers/transfers_client.go | 80 + .../get_units_of_measure_parameters.go | 226 + .../get_units_of_measure_responses.go | 229 + .../units_of_measure_client.go | 80 + api/metrc-gw/metrc_gw_models/customer_type.go | 47 + .../metrc_gw_models/customer_type_response.go | 109 + api/metrc-gw/metrc_gw_models/error.go | 80 + api/metrc-gw/metrc_gw_models/facility.go | 270 ++ .../metrc_gw_models/facility_response.go | 109 + api/metrc-gw/metrc_gw_models/harvest.go | 95 + .../metrc_gw_models/harvest_package.go | 123 + .../harvest_package_ingredient.go | 56 + .../harvest_package_request.go | 109 + .../metrc_gw_models/harvest_response.go | 109 + .../metrc_gw_models/harvest_update.go | 62 + .../metrc_gw_models/harvest_update_request.go | 109 + .../harvest_update_response.go | 109 + .../metrc_gw_models/harvest_waste_type.go | 47 + .../harvest_waste_type_response.go | 109 + api/metrc-gw/metrc_gw_models/invalid_error.go | 104 + api/metrc-gw/metrc_gw_models/item.go | 83 + api/metrc-gw/metrc_gw_models/item_request.go | 109 + api/metrc-gw/metrc_gw_models/item_response.go | 109 + .../metrc_gw_models/lab_test_state.go | 47 + .../lab_test_state_response.go | 109 + api/metrc-gw/metrc_gw_models/lab_test_type.go | 59 + .../metrc_gw_models/lab_test_type_response.go | 109 + api/metrc-gw/metrc_gw_models/license.go | 119 + api/metrc-gw/metrc_gw_models/package.go | 140 + .../package_adjustment_reason.go | 50 + .../package_adjustment_reason_response.go | 109 + .../metrc_gw_models/package_request.go | 109 + .../metrc_gw_models/package_response.go | 109 + api/metrc-gw/metrc_gw_models/package_type.go | 47 + .../metrc_gw_models/package_type_response.go | 109 + api/metrc-gw/metrc_gw_models/pagination.go | 59 + api/metrc-gw/metrc_gw_models/plant.go | 92 + api/metrc-gw/metrc_gw_models/plant_batch.go | 107 + .../metrc_gw_models/plant_batch_request.go | 109 + .../metrc_gw_models/plant_batch_response.go | 109 + .../metrc_gw_models/plant_growth_phase.go | 47 + .../plant_growth_phase_response.go | 109 + api/metrc-gw/metrc_gw_models/plant_request.go | 109 + .../metrc_gw_models/plant_response.go | 109 + .../metrc_gw_models/plant_waste_method.go | 47 + .../plant_waste_method_response.go | 109 + .../plant_waste_reason_response.go | 109 + .../metrc_gw_models/product_category.go | 98 + .../product_category_response.go | 109 + api/metrc-gw/metrc_gw_models/request_meta.go | 148 + api/metrc-gw/metrc_gw_models/response_meta.go | 77 + api/metrc-gw/metrc_gw_models/room.go | 50 + api/metrc-gw/metrc_gw_models/room_request.go | 109 + api/metrc-gw/metrc_gw_models/room_response.go | 109 + .../metrc_gw_models/sales_delivery.go | 138 + .../metrc_gw_models/sales_delivery_request.go | 109 + .../sales_delivery_response.go | 109 + .../sales_delivery_return_reason.go | 50 + .../sales_delivery_return_reason_response.go | 109 + api/metrc-gw/metrc_gw_models/sales_receipt.go | 120 + .../metrc_gw_models/sales_receipt_request.go | 109 + .../metrc_gw_models/sales_receipt_response.go | 109 + .../sales_transaction_date_response.go | 109 + api/metrc-gw/metrc_gw_models/strain.go | 62 + .../metrc_gw_models/strain_request.go | 109 + .../metrc_gw_models/strain_response.go | 109 + api/metrc-gw/metrc_gw_models/transaction.go | 74 + .../metrc_gw_models/transaction_request.go | 109 + .../metrc_gw_models/transaction_response.go | 109 + api/metrc-gw/metrc_gw_models/transfer.go | 158 + .../metrc_gw_models/transfer_response.go | 109 + .../metrc_gw_models/units_of_measure.go | 53 + .../units_of_measure_response.go | 109 + .../cash_receipt/cash_receipt_client.go | 196 + .../delete_cash_receipt_parameters.go | 150 + .../delete_cash_receipt_responses.go | 298 ++ .../get_cash_receipts_parameters.go | 215 + .../get_cash_receipts_responses.go | 303 ++ .../post_cash_receipts_parameters.go | 142 + .../post_cash_receipts_responses.go | 303 ++ .../put_cash_receipts_parameters.go | 142 + .../put_cash_receipts_responses.go | 303 ++ api/ops/ops_client/charge/charge_client.go | 196 + .../charge/delete_charge_parameters.go | 150 + .../charge/delete_charge_responses.go | 298 ++ .../charge/get_charges_parameters.go | 215 + .../charge/get_charges_responses.go | 303 ++ .../charge/post_charges_parameters.go | 142 + .../charge/post_charges_responses.go | 303 ++ .../charge/put_charges_parameters.go | 142 + .../charge/put_charges_responses.go | 298 ++ .../cors/cash_receipt_options_parameters.go | 116 + .../cors/cash_receipt_options_responses.go | 92 + .../cors/charge_options_parameters.go | 116 + .../cors/charge_options_responses.go | 92 + api/ops/ops_client/cors/cors_client.go | 544 +++ .../ops_client/cors/eft_options_parameters.go | 116 + .../ops_client/cors/eft_options_responses.go | 92 + .../cors/invoice_options_parameters.go | 116 + .../cors/invoice_options_responses.go | 92 + .../cors/orders_options_parameters.go | 116 + .../cors/orders_options_responses.go | 92 + .../cors/payment_method_options_parameters.go | 116 + .../cors/payment_method_options_responses.go | 92 + .../ops_client/cors/po_options_parameters.go | 116 + .../ops_client/cors/po_options_responses.go | 92 + .../product_options_observable_parameters.go | 116 + .../product_options_observable_responses.go | 92 + .../cors/product_options_parameters.go | 116 + .../cors/product_options_responses.go | 92 + .../cors/quote_options_parameters.go | 116 + .../cors/quote_options_responses.go | 92 + .../cors/tax_invoice_options_parameters.go | 116 + .../cors/tax_invoice_options_responses.go | 92 + .../cors/tax_order_options_parameters.go | 116 + .../cors/tax_order_options_responses.go | 92 + .../cors/tax_po_options_parameters.go | 116 + .../cors/tax_po_options_responses.go | 92 + .../cors/tax_quote_options_parameters.go | 116 + .../cors/tax_quote_options_responses.go | 92 + api/ops/ops_client/eft/eft_client.go | 157 + api/ops/ops_client/eft/get_efts_parameters.go | 215 + api/ops/ops_client/eft/get_efts_responses.go | 303 ++ .../ops_client/eft/post_efts_parameters.go | 142 + api/ops/ops_client/eft/post_efts_responses.go | 303 ++ api/ops/ops_client/eft/put_efts_parameters.go | 142 + api/ops/ops_client/eft/put_efts_responses.go | 298 ++ .../invoice/delete_invoice_parameters.go | 150 + .../invoice/delete_invoice_responses.go | 298 ++ .../invoice/get_invoices_parameters.go | 215 + .../invoice/get_invoices_responses.go | 303 ++ api/ops/ops_client/invoice/invoice_client.go | 196 + .../invoice/post_invoices_parameters.go | 142 + .../invoice/post_invoices_responses.go | 303 ++ .../invoice/put_invoices_parameters.go | 142 + .../invoice/put_invoices_responses.go | 298 ++ api/ops/ops_client/ops_client.go | 166 + .../order/delete_order_parameters.go | 150 + .../order/delete_order_responses.go | 298 ++ .../ops_client/order/get_orders_parameters.go | 215 + .../ops_client/order/get_orders_responses.go | 303 ++ api/ops/ops_client/order/order_client.go | 196 + .../order/post_orders_parameters.go | 142 + .../ops_client/order/post_orders_responses.go | 303 ++ .../ops_client/order/put_orders_parameters.go | 142 + .../ops_client/order/put_orders_responses.go | 298 ++ .../delete_payment_method_parameters.go | 150 + .../delete_payment_method_responses.go | 298 ++ .../get_payment_methods_parameters.go | 215 + .../get_payment_methods_responses.go | 303 ++ .../payment_method/payment_method_client.go | 196 + .../post_payment_methods_parameters.go | 142 + .../post_payment_methods_responses.go | 303 ++ .../put_payment_methods_parameters.go | 142 + .../put_payment_methods_responses.go | 298 ++ .../product/delete_product_parameters.go | 150 + .../product/delete_product_responses.go | 303 ++ .../get_products_observable_parameters.go | 247 + .../get_products_observable_responses.go | 301 ++ .../product/get_products_parameters.go | 311 ++ .../product/get_products_responses.go | 303 ++ .../product/post_products_parameters.go | 142 + .../product/post_products_responses.go | 303 ++ api/ops/ops_client/product/product_client.go | 235 + .../product/put_products_parameters.go | 142 + .../product/put_products_responses.go | 298 ++ .../delete_purchase_order_parameters.go | 150 + .../delete_purchase_order_responses.go | 298 ++ .../get_purchase_orders_parameters.go | 215 + .../get_purchase_orders_responses.go | 303 ++ .../post_purchase_orders_parameters.go | 142 + .../post_purchase_orders_responses.go | 303 ++ .../purchase_order/purchase_order_client.go | 196 + .../put_purchase_orders_parameters.go | 142 + .../put_purchase_orders_responses.go | 298 ++ .../quote/delete_quote_parameters.go | 150 + .../quote/delete_quote_responses.go | 298 ++ .../ops_client/quote/get_quotes_parameters.go | 215 + .../ops_client/quote/get_quotes_responses.go | 303 ++ .../quote/post_quotes_parameters.go | 142 + .../ops_client/quote/post_quotes_responses.go | 303 ++ .../ops_client/quote/put_quotes_parameters.go | 142 + .../ops_client/quote/put_quotes_responses.go | 303 ++ api/ops/ops_client/quote/quote_client.go | 196 + .../tax/post_taxes_invoices_parameters.go | 142 + .../tax/post_taxes_invoices_responses.go | 303 ++ .../tax/post_taxes_orders_parameters.go | 142 + .../tax/post_taxes_orders_responses.go | 303 ++ .../tax/post_taxes_pos_parameters.go | 142 + .../tax/post_taxes_pos_responses.go | 303 ++ .../tax/post_taxes_quotes_parameters.go | 142 + .../tax/post_taxes_quotes_responses.go | 303 ++ api/ops/ops_client/tax/tax_client.go | 196 + api/ops/ops_models/address.go | 65 + api/ops/ops_models/cash_receipt.go | 161 + api/ops/ops_models/cash_receipt_request.go | 84 + api/ops/ops_models/cash_receipt_response.go | 109 + api/ops/ops_models/charge.go | 107 + api/ops/ops_models/charge_request.go | 84 + api/ops/ops_models/charge_response.go | 109 + api/ops/ops_models/contract.go | 98 + api/ops/ops_models/credit_card.go | 86 + api/ops/ops_models/delete_response.go | 109 + api/ops/ops_models/eft.go | 156 + api/ops/ops_models/eft_item.go | 71 + api/ops/ops_models/eft_request.go | 84 + api/ops/ops_models/eft_response.go | 109 + api/ops/ops_models/error.go | 53 + api/ops/ops_models/invalid_error.go | 104 + api/ops/ops_models/invoice.go | 474 ++ api/ops/ops_models/invoice_basic.go | 244 + api/ops/ops_models/invoice_item.go | 131 + api/ops/ops_models/invoice_request.go | 84 + api/ops/ops_models/invoice_response.go | 109 + api/ops/ops_models/item_basic.go | 83 + api/ops/ops_models/message.go | 50 + api/ops/ops_models/order.go | 432 ++ api/ops/ops_models/order_item.go | 170 + api/ops/ops_models/order_request.go | 84 + api/ops/ops_models/order_response.go | 109 + api/ops/ops_models/pagination.go | 56 + api/ops/ops_models/payment_method.go | 125 + api/ops/ops_models/payment_method_request.go | 84 + api/ops/ops_models/payment_method_response.go | 109 + api/ops/ops_models/pricebook.go | 74 + api/ops/ops_models/pricebook_entry.go | 83 + api/ops/ops_models/product.go | 161 + api/ops/ops_models/product_request.go | 84 + api/ops/ops_models/product_response.go | 109 + api/ops/ops_models/purchase_order.go | 390 ++ api/ops/ops_models/purchase_order_item.go | 134 + api/ops/ops_models/purchase_order_request.go | 84 + api/ops/ops_models/purchase_order_response.go | 109 + api/ops/ops_models/put_response.go | 109 + api/ops/ops_models/quote.go | 458 ++ api/ops/ops_models/quote_basic.go | 390 ++ api/ops/ops_models/quote_item.go | 125 + api/ops/ops_models/quote_request.go | 84 + api/ops/ops_models/quote_response.go | 109 + api/ops/ops_models/response_meta.go | 108 + api/ops/ops_models/subscription.go | 149 + api/ops/ops_models/subscription_request.go | 84 + api/ops/ops_models/subscription_response.go | 109 + api/ops/ops_models/tax_transaction.go | 182 + .../ops_models/tax_transaction_response.go | 109 + api/ops/ops_models/total.go | 144 + api/ops/ops_models/total_item.go | 99 + api/ops/ops_models/total_tax_item.go | 56 + .../pdf_client/pdf/get_p_d_f_parameters.go | 139 + api/pdf/pdf_client/pdf/get_p_d_f_responses.go | 294 ++ api/pdf/pdf_client/pdf/pdf_client.go | 79 + api/pdf/pdf_client/pdf_client.go | 116 + api/pdf/pdf_models/error.go | 53 + .../invoice/get_invoices_parameters.go | 279 ++ .../invoice/get_invoices_responses.go | 268 ++ .../invoice/get_medicinal_parameters.go | 279 ++ .../invoice/get_medicinal_responses.go | 268 ++ .../plex_client/invoice/invoice_client.go | 118 + .../get_invoiceitems_parameters.go | 279 ++ .../get_invoiceitems_responses.go | 268 ++ .../invoice_item/invoice_item_client.go | 79 + api/plex/plex_client/plex_client.go | 126 + .../tax/get_district_taxes_parameters.go | 279 ++ .../tax/get_district_taxes_responses.go | 268 ++ ...get_sales_and_use_tax_return_parameters.go | 279 ++ .../get_sales_and_use_tax_return_responses.go | 268 ++ .../plex_client/tax/get_use_tax_parameters.go | 279 ++ .../plex_client/tax/get_use_tax_responses.go | 268 ++ api/plex/plex_client/tax/tax_client.go | 157 + api/plex/plex_models/additional_deductions.go | 53 + api/plex/plex_models/district_taxes.go | 65 + api/plex/plex_models/error.go | 53 + api/plex/plex_models/invoice_item_summary.go | 62 + .../invoice_item_summary_response.go | 109 + api/plex/plex_models/invoice_summary.go | 89 + .../plex_models/invoice_summary_response.go | 109 + api/plex/plex_models/pagination.go | 56 + api/plex/plex_models/request_meta.go | 68 + api/plex/plex_models/response_meta.go | 108 + api/plex/plex_models/tax_return.go | 311 ++ api/plex/plex_models/tax_return_panel.go | 128 + api/plex/plex_models/tax_return_response.go | 109 + api/plex/plex_models/tax_summary.go | 92 + api/plex/plex_models/tax_summary_response.go | 109 + api/plex/plex_models/use_tax.go | 65 + api/plex/plex_models/use_tax_response.go | 109 + .../regs_client/authority/authority_client.go | 157 + .../authority/get_authorities_parameters.go | 215 + .../authority/get_authorities_responses.go | 303 ++ .../authority/post_authorities_parameters.go | 142 + .../authority/post_authorities_responses.go | 303 ++ .../authority/put_authorities_parameters.go | 142 + .../authority/put_authorities_responses.go | 303 ++ .../regs_client/backend/backend_client.go | 196 + .../backend/delete_backend_parameters.go | 150 + .../backend/delete_backend_responses.go | 298 ++ .../backend/get_backends_parameters.go | 343 ++ .../backend/get_backends_responses.go | 303 ++ .../backend/post_backends_parameters.go | 142 + .../backend/post_backends_responses.go | 303 ++ .../backend/put_backends_parameters.go | 142 + .../backend/put_backends_responses.go | 303 ++ .../cors/authority_options_parameters.go | 116 + .../cors/authority_options_responses.go | 92 + .../cors/backend_options_parameters.go | 116 + .../cors/backend_options_responses.go | 92 + api/regs/regs_client/cors/cors_client.go | 436 ++ .../cors/filing_options_parameters.go | 116 + .../cors/filing_options_responses.go | 92 + .../cors/filing_type_options_parameters.go | 116 + .../cors/filing_type_options_responses.go | 92 + .../cors/license_options_parameters.go | 116 + .../cors/license_options_responses.go | 92 + .../cors/license_type_options_parameters.go | 116 + .../cors/license_type_options_responses.go | 92 + .../cors/notebook_options_parameters.go | 116 + .../cors/notebook_options_responses.go | 92 + .../cors/rating_engine_options_parameters.go | 116 + .../cors/rating_engine_options_responses.go | 92 + .../cors/submission_options_parameters.go | 116 + .../cors/submission_options_responses.go | 92 + .../tax_type_account_options_parameters.go | 116 + .../tax_type_account_options_responses.go | 92 + .../cors/transaction_options_parameters.go | 116 + .../cors/transaction_options_responses.go | 92 + api/regs/regs_client/filing/filing_client.go | 157 + .../filing/get_filings_parameters.go | 279 ++ .../filing/get_filings_responses.go | 303 ++ .../filing/post_filings_parameters.go | 142 + .../filing/post_filings_responses.go | 303 ++ .../filing/put_filings_parameters.go | 142 + .../filing/put_filings_responses.go | 303 ++ .../filing_type/filing_type_client.go | 157 + .../get_filing_types_parameters.go | 215 + .../filing_type/get_filing_types_responses.go | 303 ++ .../post_filing_types_parameters.go | 142 + .../post_filing_types_responses.go | 303 ++ .../put_filing_types_parameters.go | 142 + .../filing_type/put_filing_types_responses.go | 259 ++ .../license/get_licenses_parameters.go | 311 ++ .../license/get_licenses_responses.go | 303 ++ .../regs_client/license/license_client.go | 157 + .../license/post_licenses_parameters.go | 142 + .../license/post_licenses_responses.go | 303 ++ .../license/put_licenses_parameters.go | 142 + .../license/put_licenses_responses.go | 303 ++ .../get_license_types_parameters.go | 279 ++ .../get_license_types_responses.go | 303 ++ .../license_type/license_type_client.go | 118 + .../post_license_types_parameters.go | 142 + .../post_license_types_responses.go | 303 ++ .../notebook/get_notebooks_parameters.go | 215 + .../notebook/get_notebooks_responses.go | 303 ++ .../regs_client/notebook/notebook_client.go | 157 + .../notebook/post_notebooks_parameters.go | 142 + .../notebook/post_notebooks_responses.go | 303 ++ .../notebook/put_notebooks_parameters.go | 142 + .../notebook/put_notebooks_responses.go | 303 ++ .../delete_rating_engine_parameters.go | 150 + .../delete_rating_engine_responses.go | 298 ++ .../get_rating_engines_parameters.go | 375 ++ .../get_rating_engines_responses.go | 303 ++ .../post_rating_engines_parameters.go | 142 + .../post_rating_engines_responses.go | 303 ++ .../put_rating_engines_parameters.go | 142 + .../put_rating_engines_responses.go | 303 ++ .../rating_engine/rating_engine_client.go | 196 + api/regs/regs_client/regs_client.go | 171 + .../submission/get_submissions_parameters.go | 279 ++ .../submission/get_submissions_responses.go | 303 ++ .../submission/post_submissions_parameters.go | 142 + .../submission/post_submissions_responses.go | 303 ++ .../submission/put_submissions_parameters.go | 142 + .../submission/put_submissions_responses.go | 303 ++ .../submission/submission_client.go | 157 + .../delete_type_accounts_parameters.go | 150 + .../delete_type_accounts_responses.go | 298 ++ .../get_tax_type_accounts_parameters.go | 279 ++ .../get_tax_type_accounts_responses.go | 303 ++ .../post_tax_type_accounts_parameters.go | 142 + .../post_tax_type_accounts_responses.go | 303 ++ .../put_tax_type_accounts_parameters.go | 142 + .../put_tax_type_accounts_responses.go | 303 ++ .../tax_type_account_client.go | 196 + .../get_transactions_parameters.go | 215 + .../transaction/get_transactions_responses.go | 303 ++ .../post_transactions_parameters.go | 142 + .../post_transactions_responses.go | 303 ++ .../put_transactions_parameters.go | 142 + .../transaction/put_transactions_responses.go | 303 ++ .../transaction/transaction_client.go | 157 + api/regs/regs_models/authority.go | 134 + api/regs/regs_models/authority_request.go | 84 + api/regs/regs_models/authority_response.go | 109 + api/regs/regs_models/backend.go | 155 + api/regs/regs_models/backend_request.go | 84 + api/regs/regs_models/backend_response.go | 109 + api/regs/regs_models/delete_response.go | 109 + api/regs/regs_models/error.go | 53 + api/regs/regs_models/filing.go | 170 + api/regs/regs_models/filing_request.go | 84 + api/regs/regs_models/filing_response.go | 109 + api/regs/regs_models/filing_schedule_item.go | 50 + api/regs/regs_models/filing_type.go | 185 + api/regs/regs_models/filing_type_instance.go | 62 + api/regs/regs_models/filing_type_request.go | 84 + api/regs/regs_models/filing_type_response.go | 109 + .../regs_models/geo_license_type_instance.go | 59 + api/regs/regs_models/invalid_error.go | 104 + api/regs/regs_models/license.go | 104 + api/regs/regs_models/license_request.go | 84 + api/regs/regs_models/license_response.go | 109 + api/regs/regs_models/license_type.go | 141 + api/regs/regs_models/license_type_request.go | 84 + api/regs/regs_models/license_type_response.go | 109 + api/regs/regs_models/message.go | 53 + api/regs/regs_models/notebook.go | 132 + api/regs/regs_models/notebook_item.go | 59 + api/regs/regs_models/notebook_request.go | 84 + api/regs/regs_models/notebook_response.go | 109 + api/regs/regs_models/pagination.go | 56 + api/regs/regs_models/rating_engine.go | 108 + api/regs/regs_models/rating_engine_item.go | 74 + api/regs/regs_models/rating_engine_request.go | 84 + .../regs_models/rating_engine_response.go | 109 + api/regs/regs_models/request_meta.go | 68 + api/regs/regs_models/response_meta.go | 108 + api/regs/regs_models/submission.go | 122 + api/regs/regs_models/submission_request.go | 84 + api/regs/regs_models/submission_response.go | 109 + api/regs/regs_models/tax_type_account.go | 143 + .../regs_models/tax_type_account_request.go | 84 + .../regs_models/tax_type_account_response.go | 109 + api/regs/regs_models/transaction.go | 74 + api/regs/regs_models/transaction_request.go | 84 + api/regs/regs_models/transaction_response.go | 109 + .../render_client/account/account_client.go | 79 + .../account/get_render_account_parameters.go | 143 + .../account/get_render_account_responses.go | 298 ++ .../cors/account_options_parameters.go | 116 + .../cors/account_options_responses.go | 92 + api/render/render_client/cors/cors_client.go | 256 ++ .../cors/county_options_parameters.go | 116 + .../cors/county_options_responses.go | 92 + .../cors/ingest_options_parameters.go | 116 + .../cors/ingest_options_responses.go | 92 + .../cors/invoice_options_parameters.go | 116 + .../cors/invoice_options_responses.go | 92 + .../cors/report_options_parameters.go | 116 + .../cors/report_options_responses.go | 92 + .../cors/tax_options_parameters.go | 116 + .../cors/tax_options_responses.go | 92 + .../render_client/county/county_client.go | 79 + .../county/get_render_county_parameters.go | 143 + .../county/get_render_county_responses.go | 298 ++ .../ingest/get_render_ingests_parameters.go | 143 + .../ingest/get_render_ingests_responses.go | 298 ++ .../render_client/ingest/ingest_client.go | 79 + .../invoice/get_render_invoice_parameters.go | 143 + .../invoice/get_render_invoice_responses.go | 298 ++ .../render_client/invoice/invoice_client.go | 79 + api/render/render_client/render_client.go | 146 + .../report/get_render_reports_parameters.go | 240 + .../report/get_render_reports_responses.go | 298 ++ .../render_client/report/report_client.go | 79 + .../tax/get_render_taxes_parameters.go | 240 + .../tax/get_render_taxes_responses.go | 298 ++ api/render/render_client/tax/tax_client.go | 79 + api/render/render_models/document.go | 62 + api/render/render_models/document_response.go | 109 + api/render/render_models/error.go | 53 + api/render/render_models/invalid_error.go | 104 + api/render/render_models/pagination.go | 56 + api/render/render_models/response_meta.go | 108 + .../accounting_rules_client.go | 79 + .../get_accounting_rules_parameters.go | 215 + .../get_accounting_rules_responses.go | 268 ++ .../accounting_rulesets_client.go | 79 + .../get_accounting_rulesets_parameters.go | 215 + .../get_accounting_rulesets_responses.go | 268 ++ .../accounts/accounts_client.go | 157 + .../accounts/get_accounts_parameters.go | 247 + .../accounts/get_accounts_responses.go | 268 ++ .../accounts/post_accounts_parameters.go | 142 + .../accounts/post_accounts_responses.go | 229 + .../accounts/put_account_parameters.go | 142 + .../accounts/put_account_responses.go | 229 + .../authorities/authorities_client.go | 79 + .../authorities/get_authorities_parameters.go | 311 ++ .../authorities/get_authorities_responses.go | 268 ++ .../backends/backends_client.go | 79 + .../backends/get_backends_parameters.go | 215 + .../backends/get_backends_responses.go | 268 ++ .../cash_receipts/cash_receipts_client.go | 157 + .../get_cash_receipts_parameters.go | 311 ++ .../get_cash_receipts_responses.go | 268 ++ .../post_cash_receipts_parameters.go | 139 + .../post_cash_receipts_responses.go | 229 + .../put_cash_recipts_parameters.go | 139 + .../put_cash_recipts_responses.go | 229 + .../clusters/clusters_client.go | 157 + .../clusters/get_clusters_parameters.go | 247 + .../clusters/get_clusters_responses.go | 268 ++ .../clusters/post_clusters_parameters.go | 142 + .../clusters/post_clusters_responses.go | 268 ++ .../clusters/put_clusters_parameters.go | 142 + .../clusters/put_clusters_responses.go | 268 ++ .../companies/companies_client.go | 79 + .../companies/get_companies_parameters.go | 215 + .../companies/get_companies_responses.go | 268 ++ .../contacts/contacts_client.go | 196 + .../contacts/delete_contact_parameters.go | 150 + .../contacts/delete_contact_responses.go | 323 ++ .../contacts/get_contacts_parameters.go | 311 ++ .../contacts/get_contacts_responses.go | 268 ++ .../contacts/post_contacts_parameters.go | 142 + .../contacts/post_contacts_responses.go | 229 + .../contacts/put_contacts_parameters.go | 142 + .../contacts/put_contacts_responses.go | 229 + .../counties/counties_client.go | 79 + .../counties/get_counties_parameters.go | 247 + .../counties/get_counties_responses.go | 268 ++ .../countries/countries_client.go | 79 + .../countries/get_countries_parameters.go | 215 + .../countries/get_countries_responses.go | 268 ++ .../databases/databases_client.go | 157 + .../databases/get_databases_parameters.go | 247 + .../databases/get_databases_responses.go | 268 ++ .../databases/post_databases_parameters.go | 142 + .../databases/post_databases_responses.go | 268 ++ .../databases/put_databases_parameters.go | 142 + .../databases/put_databases_responses.go | 268 ++ .../sf_gate_client/domains/domains_client.go | 79 + .../domains/get_domains_parameters.go | 279 ++ .../domains/get_domains_responses.go | 268 ++ .../filing_types/filing_types_client.go | 157 + .../get_filing_types_parameters.go | 215 + .../get_filing_types_responses.go | 268 ++ .../post_filing_types_parameters.go | 142 + .../post_filing_types_responses.go | 268 ++ .../put_filing_types_parameters.go | 142 + .../put_filing_types_responses.go | 229 + .../sf_gate_client/filings/filings_client.go | 157 + .../filings/get_filings_parameters.go | 343 ++ .../filings/get_filings_responses.go | 268 ++ .../filings/post_filings_parameters.go | 142 + .../filings/post_filings_responses.go | 229 + .../filings/put_filings_parameters.go | 142 + .../filings/put_filings_responses.go | 229 + .../gl_accounts/get_gl_accounts_parameters.go | 215 + .../gl_accounts/get_gl_accounts_responses.go | 268 ++ .../gl_accounts/gl_accounts_client.go | 79 + .../gl_balances/get_gl_balances_parameters.go | 215 + .../gl_balances/get_gl_balances_responses.go | 268 ++ .../gl_balances/gl_balances_client.go | 79 + .../ingests/get_ingests_parameters.go | 343 ++ .../ingests/get_ingests_responses.go | 268 ++ .../sf_gate_client/ingests/ingests_client.go | 157 + .../ingests/post_ingests_parameters.go | 142 + .../ingests/post_ingests_responses.go | 268 ++ .../ingests/put_ingests_parameters.go | 142 + .../ingests/put_ingests_responses.go | 268 ++ .../invoices/get_invoices_parameters.go | 311 ++ .../invoices/get_invoices_responses.go | 268 ++ .../invoices/invoices_client.go | 157 + .../invoices/post_invoices_parameters.go | 139 + .../invoices/post_invoices_responses.go | 229 + .../invoices/put_invoices_parameters.go | 139 + .../invoices/put_invoices_responses.go | 229 + .../jobs/get_jobs_parameters.go | 311 ++ .../sf_gate_client/jobs/get_jobs_responses.go | 268 ++ .../sf_gate_client/jobs/jobs_client.go | 157 + .../jobs/post_jobs_parameters.go | 142 + .../jobs/post_jobs_responses.go | 268 ++ .../jobs/put_jobs_parameters.go | 142 + .../sf_gate_client/jobs/put_jobs_responses.go | 268 ++ .../get_license_types_parameters.go | 279 ++ .../get_license_types_responses.go | 268 ++ .../license_types/license_types_client.go | 79 + .../licenses/get_licenses_parameters.go | 311 ++ .../licenses/get_licenses_responses.go | 268 ++ .../licenses/licenses_client.go | 157 + .../licenses/post_licenses_parameters.go | 142 + .../licenses/post_licenses_responses.go | 229 + .../licenses/put_licenses_parameters.go | 142 + .../licenses/put_licenses_responses.go | 229 + .../notebooks/get_notebooks_parameters.go | 215 + .../notebooks/get_notebooks_responses.go | 268 ++ .../notebooks/notebooks_client.go | 157 + .../notebooks/post_notebooks_parameters.go | 142 + .../notebooks/post_notebooks_responses.go | 268 ++ .../notebooks/put_notebooks_parameters.go | 142 + .../notebooks/put_notebooks_responses.go | 268 ++ .../orders/get_orders_parameters.go | 343 ++ .../orders/get_orders_responses.go | 268 ++ .../sf_gate_client/orders/orders_client.go | 157 + .../orders/post_orders_parameters.go | 139 + .../orders/post_orders_responses.go | 229 + .../orders/put_orders_parameters.go | 139 + .../orders/put_orders_responses.go | 229 + .../periods/get_periods_parameters.go | 247 + .../periods/get_periods_responses.go | 268 ++ .../sf_gate_client/periods/periods_client.go | 79 + .../places/get_places_parameters.go | 247 + .../places/get_places_responses.go | 268 ++ .../sf_gate_client/places/places_client.go | 79 + .../products/get_products_parameters.go | 247 + .../products/get_products_responses.go | 268 ++ .../products/products_client.go | 79 + .../purchase_orders/get_pos_parameters.go | 311 ++ .../purchase_orders/get_pos_responses.go | 268 ++ .../purchase_orders/post_pos_parameters.go | 139 + .../purchase_orders/post_pos_responses.go | 229 + .../purchase_orders/purchase_orders_client.go | 157 + .../purchase_orders/put_pos_parameters.go | 139 + .../purchase_orders/put_pos_responses.go | 229 + .../quotes/get_quotes_parameters.go | 343 ++ .../quotes/get_quotes_responses.go | 268 ++ .../quotes/post_quotes_parameters.go | 139 + .../quotes/post_quotes_responses.go | 229 + .../quotes/put_quotes_parameters.go | 139 + .../quotes/put_quotes_responses.go | 229 + .../sf_gate_client/quotes/quotes_client.go | 157 + .../roles/get_roles_parameters.go | 215 + .../roles/get_roles_responses.go | 268 ++ .../sf_gate_client/roles/roles_client.go | 79 + .../services/get_services_parameters.go | 215 + .../services/get_services_responses.go | 268 ++ .../services/post_services_parameters.go | 142 + .../services/post_services_responses.go | 268 ++ .../services/put_services_parameters.go | 142 + .../services/put_services_responses.go | 268 ++ .../services/services_client.go | 157 + api/sf-gate/sf_gate_client/sf_gate_client.go | 316 ++ .../statements/get_statements_parameters.go | 311 ++ .../statements/get_statements_responses.go | 268 ++ .../statements/post_statements_parameters.go | 142 + .../statements/post_statements_responses.go | 229 + .../statements/statements_client.go | 118 + .../states/get_states_parameters.go | 247 + .../states/get_states_responses.go | 268 ++ .../sf_gate_client/states/states_client.go | 79 + .../submissions/get_submissions_parameters.go | 311 ++ .../submissions/get_submissions_responses.go | 268 ++ .../post_submissions_parameters.go | 142 + .../submissions/post_submissions_responses.go | 229 + .../submissions/put_submissions_parameters.go | 142 + .../submissions/put_submissions_responses.go | 229 + .../submissions/submissions_client.go | 157 + .../get_subscriptions_parameters.go | 311 ++ .../get_subscriptions_responses.go | 268 ++ .../post_subscriptions_parameters.go | 142 + .../post_subscriptions_responses.go | 229 + .../put_subscriptions_parameters.go | 142 + .../put_subscriptions_responses.go | 229 + .../subscriptions/subscriptions_client.go | 157 + .../get_tax_type_accounts_parameters.go | 407 ++ .../get_tax_type_accounts_responses.go | 268 ++ .../post_tax_type_accounts_parameters.go | 142 + .../post_tax_type_accounts_responses.go | 229 + .../put_tax_type_accounts_parameters.go | 139 + .../put_tax_type_accounts_responses.go | 229 + .../tax_type_accounts_client.go | 157 + .../tax_types/get_tax_types_parameters.go | 407 ++ .../tax_types/get_tax_types_responses.go | 268 ++ .../tax_types/tax_types_client.go | 79 + .../get_taxnexus_codes_parameters.go | 247 + .../get_taxnexus_codes_responses.go | 268 ++ .../taxnexus_codes/taxnexus_codes_client.go | 79 + .../templates/get_templates_parameters.go | 215 + .../templates/get_templates_responses.go | 268 ++ .../templates/templates_client.go | 79 + .../tenants/get_tenants_parameters.go | 247 + .../tenants/get_tenants_responses.go | 268 ++ .../tenants/put_tenants_parameters.go | 142 + .../tenants/put_tenants_responses.go | 268 ++ .../sf_gate_client/tenants/tenants_client.go | 157 + .../tenants/tenants_parameters.go | 142 + .../tenants/tenants_responses.go | 268 ++ .../users/get_users_parameters.go | 279 ++ .../users/get_users_responses.go | 268 ++ .../sf_gate_client/users/users_client.go | 79 + api/sf-gate/sf_gate_models/account.go | 402 ++ api/sf-gate/sf_gate_models/account_request.go | 109 + .../sf_gate_models/account_response.go | 109 + api/sf-gate/sf_gate_models/accounting_rule.go | 104 + .../sf_gate_models/accounting_rule_request.go | 109 + .../accounting_rule_response.go | 109 + .../sf_gate_models/accounting_ruleset.go | 114 + .../sf_gate_models/accounting_ruleset_item.go | 53 + .../accounting_ruleset_request.go | 109 + .../accounting_ruleset_response.go | 109 + api/sf-gate/sf_gate_models/address.go | 100 + api/sf-gate/sf_gate_models/authority.go | 131 + .../sf_gate_models/authority_request.go | 109 + .../sf_gate_models/authority_response.go | 109 + api/sf-gate/sf_gate_models/backend.go | 158 + api/sf-gate/sf_gate_models/backend_request.go | 109 + .../sf_gate_models/backend_response.go | 109 + api/sf-gate/sf_gate_models/cash_receipt.go | 182 + .../sf_gate_models/cash_receipt_request.go | 109 + .../sf_gate_models/cash_receipt_response.go | 109 + api/sf-gate/sf_gate_models/cluster.go | 95 + api/sf-gate/sf_gate_models/cluster_request.go | 112 + .../sf_gate_models/cluster_response.go | 109 + api/sf-gate/sf_gate_models/company.go | 214 + .../sf_gate_models/company_response.go | 109 + api/sf-gate/sf_gate_models/contact.go | 229 + api/sf-gate/sf_gate_models/contact_request.go | 112 + .../sf_gate_models/contact_response.go | 109 + api/sf-gate/sf_gate_models/contract_basic.go | 86 + api/sf-gate/sf_gate_models/country.go | 159 + .../sf_gate_models/country_response.go | 109 + api/sf-gate/sf_gate_models/county.go | 195 + api/sf-gate/sf_gate_models/county_response.go | 109 + api/sf-gate/sf_gate_models/credit_card.go | 89 + api/sf-gate/sf_gate_models/database.go | 83 + .../sf_gate_models/database_request.go | 109 + .../sf_gate_models/database_response.go | 109 + api/sf-gate/sf_gate_models/domain.go | 56 + api/sf-gate/sf_gate_models/domain_response.go | 109 + api/sf-gate/sf_gate_models/error.go | 53 + api/sf-gate/sf_gate_models/filing.go | 176 + api/sf-gate/sf_gate_models/filing_due_date.go | 50 + api/sf-gate/sf_gate_models/filing_request.go | 109 + api/sf-gate/sf_gate_models/filing_response.go | 109 + api/sf-gate/sf_gate_models/filing_type.go | 185 + .../sf_gate_models/filing_type_instance.go | 62 + .../sf_gate_models/filing_type_request.go | 112 + .../sf_gate_models/filing_type_response.go | 109 + .../geo_license_type_instance.go | 59 + api/sf-gate/sf_gate_models/gl_account.go | 95 + .../sf_gate_models/gl_account_request.go | 109 + .../sf_gate_models/gl_account_response.go | 109 + api/sf-gate/sf_gate_models/gl_balance.go | 101 + .../sf_gate_models/gl_balance_response.go | 109 + api/sf-gate/sf_gate_models/ids.go | 24 + api/sf-gate/sf_gate_models/ids_request.go | 104 + api/sf-gate/sf_gate_models/ingest.go | 449 ++ api/sf-gate/sf_gate_models/ingest_request.go | 112 + api/sf-gate/sf_gate_models/ingest_response.go | 109 + api/sf-gate/sf_gate_models/invalid_error.go | 104 + api/sf-gate/sf_gate_models/invoice.go | 411 ++ api/sf-gate/sf_gate_models/invoice_basic.go | 231 + api/sf-gate/sf_gate_models/invoice_item.go | 140 + api/sf-gate/sf_gate_models/invoice_request.go | 109 + .../sf_gate_models/invoice_response.go | 109 + api/sf-gate/sf_gate_models/item_basic.go | 226 + api/sf-gate/sf_gate_models/job.go | 617 +++ api/sf-gate/sf_gate_models/job_request.go | 112 + api/sf-gate/sf_gate_models/job_response.go | 109 + api/sf-gate/sf_gate_models/license.go | 95 + api/sf-gate/sf_gate_models/license_request.go | 109 + .../sf_gate_models/license_response.go | 109 + api/sf-gate/sf_gate_models/license_type.go | 138 + .../sf_gate_models/license_type_response.go | 109 + api/sf-gate/sf_gate_models/message.go | 53 + api/sf-gate/sf_gate_models/notebook.go | 132 + api/sf-gate/sf_gate_models/notebook_item.go | 59 + .../sf_gate_models/notebook_request.go | 109 + .../sf_gate_models/notebook_response.go | 109 + api/sf-gate/sf_gate_models/order.go | 387 ++ api/sf-gate/sf_gate_models/order_basic.go | 136 + .../sf_gate_models/order_basic_request.go | 109 + api/sf-gate/sf_gate_models/order_item.go | 167 + api/sf-gate/sf_gate_models/order_response.go | 109 + api/sf-gate/sf_gate_models/pagination.go | 59 + api/sf-gate/sf_gate_models/period.go | 86 + api/sf-gate/sf_gate_models/period_request.go | 109 + api/sf-gate/sf_gate_models/period_response.go | 109 + api/sf-gate/sf_gate_models/place.go | 204 + api/sf-gate/sf_gate_models/place_response.go | 109 + api/sf-gate/sf_gate_models/pricebook.go | 62 + api/sf-gate/sf_gate_models/pricebook_entry.go | 121 + api/sf-gate/sf_gate_models/product.go | 161 + api/sf-gate/sf_gate_models/product_request.go | 109 + .../sf_gate_models/product_response.go | 109 + api/sf-gate/sf_gate_models/purchase_order.go | 236 + .../sf_gate_models/purchase_order_basic.go | 139 + .../sf_gate_models/purchase_order_item.go | 131 + .../sf_gate_models/purchase_order_request.go | 109 + .../sf_gate_models/purchase_order_response.go | 109 + api/sf-gate/sf_gate_models/quote.go | 272 ++ api/sf-gate/sf_gate_models/quote_basic.go | 145 + api/sf-gate/sf_gate_models/quote_item.go | 110 + .../sf_gate_models/quote_item_basic.go | 80 + api/sf-gate/sf_gate_models/quote_response.go | 109 + api/sf-gate/sf_gate_models/request_meta.go | 68 + api/sf-gate/sf_gate_models/response_meta.go | 114 + api/sf-gate/sf_gate_models/role.go | 71 + api/sf-gate/sf_gate_models/role_request.go | 109 + api/sf-gate/sf_gate_models/role_response.go | 109 + api/sf-gate/sf_gate_models/service.go | 113 + api/sf-gate/sf_gate_models/service_request.go | 112 + .../sf_gate_models/service_response.go | 109 + api/sf-gate/sf_gate_models/state.go | 189 + api/sf-gate/sf_gate_models/state_response.go | 109 + api/sf-gate/sf_gate_models/statement.go | 104 + .../sf_gate_models/statement_request.go | 109 + .../sf_gate_models/statement_response.go | 109 + api/sf-gate/sf_gate_models/submission.go | 122 + .../sf_gate_models/submission_request.go | 109 + .../sf_gate_models/submission_response.go | 109 + api/sf-gate/sf_gate_models/subscription.go | 192 + .../sf_gate_models/subscription_request.go | 109 + .../sf_gate_models/subscription_response.go | 109 + api/sf-gate/sf_gate_models/tax_instance.go | 74 + .../sf_gate_models/tax_invoices_request.go | 109 + .../sf_gate_models/tax_orders_request.go | 109 + .../tax_purchase_orders_request.go | 109 + .../sf_gate_models/tax_quotes_request.go | 109 + api/sf-gate/sf_gate_models/tax_transaction.go | 128 + .../tax_transaction_response.go | 109 + api/sf-gate/sf_gate_models/tax_type.go | 185 + .../sf_gate_models/tax_type_account.go | 143 + .../tax_type_account_request.go | 109 + .../tax_type_account_response.go | 109 + .../sf_gate_models/tax_type_response.go | 109 + api/sf-gate/sf_gate_models/taxnexus_code.go | 107 + .../sf_gate_models/taxnexus_code_response.go | 109 + api/sf-gate/sf_gate_models/template.go | 93 + .../sf_gate_models/template_response.go | 109 + api/sf-gate/sf_gate_models/tenant.go | 181 + api/sf-gate/sf_gate_models/tenant_request.go | 109 + api/sf-gate/sf_gate_models/tenant_response.go | 109 + api/sf-gate/sf_gate_models/tenant_user.go | 53 + api/sf-gate/sf_gate_models/user.go | 306 ++ api/sf-gate/sf_gate_models/user_response.go | 109 + api/sf-gate/sf_gate_models/user_role.go | 59 + api/stash/stash_client/stash_client.go | 116 + .../stash_pdf/post_pdfs_parameters.go | 142 + .../stash_pdf/post_pdfs_responses.go | 268 ++ .../stash_pdf/stash_pdf_client.go | 79 + api/stash/stash_models/document.go | 62 + api/stash/stash_models/document_response.go | 109 + api/stash/stash_models/error.go | 53 + api/stash/stash_models/new_p_d_f.go | 71 + api/stash/stash_models/p_d_f_request.go | 109 + api/stash/stash_models/request_meta.go | 68 + api/stash/stash_models/response_meta.go | 77 + .../accounts/accounts_client.go | 79 + .../accounts/get_accounts_parameters.go | 264 ++ .../accounts/get_accounts_responses.go | 268 ++ .../invoices/get_invoices_parameters.go | 425 ++ .../invoices/get_invoices_responses.go | 268 ++ .../invoices/invoices_client.go | 79 + .../purchase_orders/get_pos_parameters.go | 425 ++ .../purchase_orders/get_pos_responses.go | 268 ++ .../purchase_orders/purchase_orders_client.go | 79 + .../vendor_gw_client/vendor_gw_client.go | 126 + .../vendor_gw_models/account_basic.go | 202 + .../vendor_gw_models/account_response.go | 109 + api/vendor-gw/vendor_gw_models/address.go | 65 + .../vendor_gw_models/contact_basic.go | 99 + api/vendor-gw/vendor_gw_models/error.go | 80 + .../vendor_gw_models/invalid_error.go | 104 + .../vendor_gw_models/invoice_basic.go | 181 + .../vendor_gw_models/invoice_response.go | 109 + api/vendor-gw/vendor_gw_models/item_basic.go | 95 + .../vendor_gw_models/license_basic.go | 77 + api/vendor-gw/vendor_gw_models/pagination.go | 59 + .../vendor_gw_models/purchase_order_basic.go | 148 + .../purchase_order_response.go | 109 + .../vendor_gw_models/response_meta.go | 108 + .../workflow_client/app_log/app_log_client.go | 79 + .../app_log/post_app_logs_parameters.go | 142 + .../app_log/post_app_logs_responses.go | 298 ++ .../cors/app_log_options_parameters.go | 116 + .../cors/app_log_options_responses.go | 92 + .../workflow_client/cors/cors_client.go | 148 + .../cors/email_message_options_parameters.go | 116 + .../cors/email_message_options_responses.go | 92 + ...tgoing_email_message_options_parameters.go | 116 + ...utgoing_email_message_options_responses.go | 92 + .../email_message/email_message_client.go | 79 + .../get_email_messages_parameters.go | 150 + .../get_email_messages_responses.go | 298 ++ .../outgoing_email_message_client.go | 79 + ...post_outgoing_email_messages_parameters.go | 142 + .../post_outgoing_email_messages_responses.go | 298 ++ .../workflow_client/workflow_client.go | 131 + api/workflow/workflow_models/app_log.go | 77 + .../workflow_models/app_log_request.go | 109 + .../workflow_models/app_log_response.go | 109 + api/workflow/workflow_models/document.go | 226 + api/workflow/workflow_models/email_message.go | 170 + .../workflow_models/email_message_request.go | 109 + .../email_messages_response.go | 109 + api/workflow/workflow_models/error.go | 53 + api/workflow/workflow_models/headers.go | 50 + .../workflow_models/outgoing_email_message.go | 120 + .../outgoing_email_message_request.go | 109 + api/workflow/workflow_models/request_meta.go | 68 + api/workflow/workflow_models/response_meta.go | 77 + build/COPYRIGHT | 3 + build/Dockerfile | 36 + go.mod | 8 + go.sum | 278 ++ 1547 files changed, 279576 insertions(+), 16 deletions(-) create mode 100644 api/auth0/auth0_client/auth/auth_client.go create mode 100644 api/auth0/auth0_client/auth/post_credentials_parameters.go create mode 100644 api/auth0/auth0_client/auth/post_credentials_responses.go create mode 100644 api/auth0/auth0_client/auth0_client.go create mode 100644 api/auth0/auth0_client/role/get_roles_parameters.go create mode 100644 api/auth0/auth0_client/role/get_roles_responses.go create mode 100644 api/auth0/auth0_client/role/post_role_users_parameters.go create mode 100644 api/auth0/auth0_client/role/post_role_users_responses.go create mode 100644 api/auth0/auth0_client/role/role_client.go create mode 100644 api/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_parameters.go create mode 100644 api/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_responses.go create mode 100644 api/auth0/auth0_client/user/get_user_by_email_parameters.go create mode 100644 api/auth0/auth0_client/user/get_user_by_email_responses.go create mode 100644 api/auth0/auth0_client/user/get_user_roles_parameters.go create mode 100644 api/auth0/auth0_client/user/get_user_roles_responses.go create mode 100644 api/auth0/auth0_client/user/get_users_parameters.go create mode 100644 api/auth0/auth0_client/user/get_users_responses.go create mode 100644 api/auth0/auth0_client/user/post_users_parameters.go create mode 100644 api/auth0/auth0_client/user/post_users_responses.go create mode 100644 api/auth0/auth0_client/user/user_client.go create mode 100644 api/auth0/auth0_models/credentials_request.go create mode 100644 api/auth0/auth0_models/credentials_response.go create mode 100644 api/auth0/auth0_models/error.go create mode 100644 api/auth0/auth0_models/new_user.go create mode 100644 api/auth0/auth0_models/role.go create mode 100644 api/auth0/auth0_models/role_response.go create mode 100644 api/auth0/auth0_models/role_users_request.go create mode 100644 api/auth0/auth0_models/user.go create mode 100644 api/auth0/auth0_models/user_request.go create mode 100644 api/auth0/auth0_models/user_roles_request.go create mode 100644 api/blaze/blaze_client/blaze_client.go create mode 100644 api/blaze/blaze_client/members/get_member_parameters.go create mode 100644 api/blaze/blaze_client/members/get_member_responses.go create mode 100644 api/blaze/blaze_client/members/members_client.go create mode 100644 api/blaze/blaze_client/products/get_product_parameters.go create mode 100644 api/blaze/blaze_client/products/get_product_responses.go create mode 100644 api/blaze/blaze_client/products/get_products_parameters.go create mode 100644 api/blaze/blaze_client/products/get_products_responses.go create mode 100644 api/blaze/blaze_client/products/products_client.go create mode 100644 api/blaze/blaze_client/purchase_orders/get_purchase_order_list_parameters.go create mode 100644 api/blaze/blaze_client/purchase_orders/get_purchase_order_list_responses.go create mode 100644 api/blaze/blaze_client/purchase_orders/purchase_orders_client.go create mode 100644 api/blaze/blaze_client/shop/get_shop_parameters.go create mode 100644 api/blaze/blaze_client/shop/get_shop_responses.go create mode 100644 api/blaze/blaze_client/shop/shop_client.go create mode 100644 api/blaze/blaze_client/transactions/get_transaction_by_id_parameters.go create mode 100644 api/blaze/blaze_client/transactions/get_transaction_by_id_responses.go create mode 100644 api/blaze/blaze_client/transactions/get_transactions_parameters.go create mode 100644 api/blaze/blaze_client/transactions/get_transactions_responses.go create mode 100644 api/blaze/blaze_client/transactions/transactions_client.go create mode 100644 api/blaze/blaze_client/vendors/get_vendor_parameters.go create mode 100644 api/blaze/blaze_client/vendors/get_vendor_responses.go create mode 100644 api/blaze/blaze_client/vendors/vendors_client.go create mode 100644 api/blaze/blaze_models/error.go create mode 100644 api/blaze/blaze_models/invalid_error.go create mode 100644 api/blaze/blaze_models/member_response.go create mode 100644 api/blaze/blaze_models/message.go create mode 100644 api/blaze/blaze_models/product_response.go create mode 100644 api/blaze/blaze_models/products_response.go create mode 100644 api/blaze/blaze_models/purchase_order_list_response.go create mode 100644 api/blaze/blaze_models/shop_response.go create mode 100644 api/blaze/blaze_models/transaction_by_id_response.go create mode 100644 api/blaze/blaze_models/transactions_response.go create mode 100644 api/blaze/blaze_models/vendor_response.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/geo/geo_client/coordinate/coordinate_client.go create mode 100644 api/geo/geo_client/coordinate/delete_coordinate_parameters.go create mode 100644 api/geo/geo_client/coordinate/delete_coordinate_responses.go create mode 100644 api/geo/geo_client/coordinate/get_coordinate_basic_parameters.go create mode 100644 api/geo/geo_client/coordinate/get_coordinate_basic_responses.go create mode 100644 api/geo/geo_client/coordinate/get_coordinate_observable_parameters.go create mode 100644 api/geo/geo_client/coordinate/get_coordinate_observable_responses.go create mode 100644 api/geo/geo_client/coordinate/get_coordinates_parameters.go create mode 100644 api/geo/geo_client/coordinate/get_coordinates_responses.go create mode 100644 api/geo/geo_client/coordinate/post_coordinates_parameters.go create mode 100644 api/geo/geo_client/coordinate/post_coordinates_responses.go create mode 100644 api/geo/geo_client/cors/cors_client.go create mode 100644 api/geo/geo_client/cors/get_coordinates_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_coordinates_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_coordinates_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_coordinates_options_responses.go create mode 100644 api/geo/geo_client/cors/get_counties_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_counties_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_counties_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_counties_options_responses.go create mode 100644 api/geo/geo_client/cors/get_countries_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_countries_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_countries_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_countries_options_responses.go create mode 100644 api/geo/geo_client/cors/get_domains_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_domains_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_domains_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_domains_options_responses.go create mode 100644 api/geo/geo_client/cors/get_places_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_places_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_places_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_places_options_responses.go create mode 100644 api/geo/geo_client/cors/get_states_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_states_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_states_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_states_options_responses.go create mode 100644 api/geo/geo_client/cors/get_tax_rate_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_tax_rate_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_tax_rates_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_tax_rates_options_responses.go create mode 100644 api/geo/geo_client/cors/get_tax_type_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_tax_type_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_tax_types_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_tax_types_options_responses.go create mode 100644 api/geo/geo_client/cors/get_taxnexus_codes_observable_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_taxnexus_codes_observable_options_responses.go create mode 100644 api/geo/geo_client/cors/get_taxnexus_codes_options_parameters.go create mode 100644 api/geo/geo_client/cors/get_taxnexus_codes_options_responses.go create mode 100644 api/geo/geo_client/country/country_client.go create mode 100644 api/geo/geo_client/country/get_countries_observable_parameters.go create mode 100644 api/geo/geo_client/country/get_countries_observable_responses.go create mode 100644 api/geo/geo_client/country/get_countries_parameters.go create mode 100644 api/geo/geo_client/country/get_countries_responses.go create mode 100644 api/geo/geo_client/country/post_countries_parameters.go create mode 100644 api/geo/geo_client/country/post_countries_responses.go create mode 100644 api/geo/geo_client/county/county_client.go create mode 100644 api/geo/geo_client/county/get_counties_observable_parameters.go create mode 100644 api/geo/geo_client/county/get_counties_observable_responses.go create mode 100644 api/geo/geo_client/county/get_counties_parameters.go create mode 100644 api/geo/geo_client/county/get_counties_responses.go create mode 100644 api/geo/geo_client/county/post_counties_parameters.go create mode 100644 api/geo/geo_client/county/post_counties_responses.go create mode 100644 api/geo/geo_client/domain/domain_client.go create mode 100644 api/geo/geo_client/domain/get_domain_observable_parameters.go create mode 100644 api/geo/geo_client/domain/get_domain_observable_responses.go create mode 100644 api/geo/geo_client/domain/get_domains_parameters.go create mode 100644 api/geo/geo_client/domain/get_domains_responses.go create mode 100644 api/geo/geo_client/domain/post_domains_parameters.go create mode 100644 api/geo/geo_client/domain/post_domains_responses.go create mode 100644 api/geo/geo_client/geo_client.go create mode 100644 api/geo/geo_client/place/get_place_observable_parameters.go create mode 100644 api/geo/geo_client/place/get_place_observable_responses.go create mode 100644 api/geo/geo_client/place/get_places_parameters.go create mode 100644 api/geo/geo_client/place/get_places_responses.go create mode 100644 api/geo/geo_client/place/place_client.go create mode 100644 api/geo/geo_client/place/post_places_parameters.go create mode 100644 api/geo/geo_client/place/post_places_responses.go create mode 100644 api/geo/geo_client/state/get_state_observable_parameters.go create mode 100644 api/geo/geo_client/state/get_state_observable_responses.go create mode 100644 api/geo/geo_client/state/get_states_parameters.go create mode 100644 api/geo/geo_client/state/get_states_responses.go create mode 100644 api/geo/geo_client/state/post_states_parameters.go create mode 100644 api/geo/geo_client/state/post_states_responses.go create mode 100644 api/geo/geo_client/state/state_client.go create mode 100644 api/geo/geo_client/tax_rate/get_tax_rate_observable_parameters.go create mode 100644 api/geo/geo_client/tax_rate/get_tax_rate_observable_responses.go create mode 100644 api/geo/geo_client/tax_rate/get_tax_rates_parameters.go create mode 100644 api/geo/geo_client/tax_rate/get_tax_rates_responses.go create mode 100644 api/geo/geo_client/tax_rate/tax_rate_client.go create mode 100644 api/geo/geo_client/tax_type/get_tax_types_observable_parameters.go create mode 100644 api/geo/geo_client/tax_type/get_tax_types_observable_responses.go create mode 100644 api/geo/geo_client/tax_type/get_tax_types_parameters.go create mode 100644 api/geo/geo_client/tax_type/get_tax_types_responses.go create mode 100644 api/geo/geo_client/tax_type/post_tax_types_parameters.go create mode 100644 api/geo/geo_client/tax_type/post_tax_types_responses.go create mode 100644 api/geo/geo_client/tax_type/tax_type_client.go create mode 100644 api/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_parameters.go create mode 100644 api/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_responses.go create mode 100644 api/geo/geo_client/taxnexus_code/get_taxnexus_codes_parameters.go create mode 100644 api/geo/geo_client/taxnexus_code/get_taxnexus_codes_responses.go create mode 100644 api/geo/geo_client/taxnexus_code/post_taxnexus_codes_parameters.go create mode 100644 api/geo/geo_client/taxnexus_code/post_taxnexus_codes_responses.go create mode 100644 api/geo/geo_client/taxnexus_code/taxnexus_code_client.go create mode 100644 api/geo/geo_models/address.go create mode 100644 api/geo/geo_models/coordinate.go create mode 100644 api/geo/geo_models/coordinate_basic.go create mode 100644 api/geo/geo_models/coordinate_basic_response.go create mode 100644 api/geo/geo_models/coordinate_request.go create mode 100644 api/geo/geo_models/coordinate_request_item.go create mode 100644 api/geo/geo_models/coordinate_response.go create mode 100644 api/geo/geo_models/country.go create mode 100644 api/geo/geo_models/country_request.go create mode 100644 api/geo/geo_models/country_response.go create mode 100644 api/geo/geo_models/county.go create mode 100644 api/geo/geo_models/county_request.go create mode 100644 api/geo/geo_models/county_response.go create mode 100644 api/geo/geo_models/delete_response.go create mode 100644 api/geo/geo_models/domain.go create mode 100644 api/geo/geo_models/domain_request.go create mode 100644 api/geo/geo_models/domain_response.go create mode 100644 api/geo/geo_models/error.go create mode 100644 api/geo/geo_models/invalid_error.go create mode 100644 api/geo/geo_models/message.go create mode 100644 api/geo/geo_models/pagination.go create mode 100644 api/geo/geo_models/place.go create mode 100644 api/geo/geo_models/place_request.go create mode 100644 api/geo/geo_models/place_response.go create mode 100644 api/geo/geo_models/request_meta.go create mode 100644 api/geo/geo_models/response_meta.go create mode 100644 api/geo/geo_models/state.go create mode 100644 api/geo/geo_models/state_request.go create mode 100644 api/geo/geo_models/state_response.go create mode 100644 api/geo/geo_models/tax_instance.go create mode 100644 api/geo/geo_models/tax_rate.go create mode 100644 api/geo/geo_models/tax_rate_response.go create mode 100644 api/geo/geo_models/tax_type.go create mode 100644 api/geo/geo_models/tax_type_id.go create mode 100644 api/geo/geo_models/tax_type_request.go create mode 100644 api/geo/geo_models/tax_type_response.go create mode 100644 api/geo/geo_models/taxnexus_code.go create mode 100644 api/geo/geo_models/taxnexus_code_request.go create mode 100644 api/geo/geo_models/taxnexus_code_response.go create mode 100644 api/gov-gw/gov_gw_client/gov_gw_client.go create mode 100644 api/gov-gw/gov_gw_client/tax_rates/get_coordinates_parameters.go create mode 100644 api/gov-gw/gov_gw_client/tax_rates/get_coordinates_responses.go create mode 100644 api/gov-gw/gov_gw_client/tax_rates/tax_rates_client.go create mode 100644 api/gov-gw/gov_gw_models/coordinate.go create mode 100644 api/gov-gw/gov_gw_models/coordinate_request.go create mode 100644 api/gov-gw/gov_gw_models/coordinate_request_item.go create mode 100644 api/gov-gw/gov_gw_models/coordinate_response.go create mode 100644 api/gov-gw/gov_gw_models/error.go create mode 100644 api/gov-gw/gov_gw_models/invalid_error.go create mode 100644 api/gov-gw/gov_gw_models/pagination.go create mode 100644 api/gov-gw/gov_gw_models/request_meta.go create mode 100644 api/gov-gw/gov_gw_models/response_meta.go create mode 100644 api/gov-gw/gov_gw_models/tax_type_id.go create mode 100644 api/ledger/ledger_client/accounting_rule/accounting_rule_client.go create mode 100644 api/ledger/ledger_client/accounting_rule/get_accounting_rules_parameters.go create mode 100644 api/ledger/ledger_client/accounting_rule/get_accounting_rules_responses.go create mode 100644 api/ledger/ledger_client/accounting_rule/post_accounting_rules_parameters.go create mode 100644 api/ledger/ledger_client/accounting_rule/post_accounting_rules_responses.go create mode 100644 api/ledger/ledger_client/accounting_ruleset/accounting_ruleset_client.go create mode 100644 api/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_parameters.go create mode 100644 api/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_responses.go create mode 100644 api/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_parameters.go create mode 100644 api/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_responses.go create mode 100644 api/ledger/ledger_client/coa/coa_client.go create mode 100644 api/ledger/ledger_client/coa/get_coas_parameters.go create mode 100644 api/ledger/ledger_client/coa/get_coas_responses.go create mode 100644 api/ledger/ledger_client/coa/post_coas_parameters.go create mode 100644 api/ledger/ledger_client/coa/post_coas_responses.go create mode 100644 api/ledger/ledger_client/gl_account/get_gl_accounts_parameters.go create mode 100644 api/ledger/ledger_client/gl_account/get_gl_accounts_responses.go create mode 100644 api/ledger/ledger_client/gl_account/gl_account_client.go create mode 100644 api/ledger/ledger_client/gl_account/post_gl_accounts_parameters.go create mode 100644 api/ledger/ledger_client/gl_account/post_gl_accounts_responses.go create mode 100644 api/ledger/ledger_client/gl_balance/get_gl_balances_parameters.go create mode 100644 api/ledger/ledger_client/gl_balance/get_gl_balances_responses.go create mode 100644 api/ledger/ledger_client/gl_balance/gl_balance_client.go create mode 100644 api/ledger/ledger_client/gl_balance/post_gl_balances_parameters.go create mode 100644 api/ledger/ledger_client/gl_balance/post_gl_balances_responses.go create mode 100644 api/ledger/ledger_client/journal_entry/get_journal_entries_parameters.go create mode 100644 api/ledger/ledger_client/journal_entry/get_journal_entries_responses.go create mode 100644 api/ledger/ledger_client/journal_entry/journal_entry_client.go create mode 100644 api/ledger/ledger_client/journal_entry/post_journal_entries_parameters.go create mode 100644 api/ledger/ledger_client/journal_entry/post_journal_entries_responses.go create mode 100644 api/ledger/ledger_client/journal_item/get_journal_items_parameters.go create mode 100644 api/ledger/ledger_client/journal_item/get_journal_items_responses.go create mode 100644 api/ledger/ledger_client/journal_item/journal_item_client.go create mode 100644 api/ledger/ledger_client/ledger_client.go create mode 100644 api/ledger/ledger_client/period/get_periods_parameters.go create mode 100644 api/ledger/ledger_client/period/get_periods_responses.go create mode 100644 api/ledger/ledger_client/period/period_client.go create mode 100644 api/ledger/ledger_client/period/post_periods_parameters.go create mode 100644 api/ledger/ledger_client/period/post_periods_responses.go create mode 100644 api/ledger/ledger_models/accounting_rule.go create mode 100644 api/ledger/ledger_models/accounting_rule_request.go create mode 100644 api/ledger/ledger_models/accounting_rule_response.go create mode 100644 api/ledger/ledger_models/accounting_ruleset.go create mode 100644 api/ledger/ledger_models/accounting_ruleset_item.go create mode 100644 api/ledger/ledger_models/accounting_ruleset_request.go create mode 100644 api/ledger/ledger_models/accounting_ruleset_response.go create mode 100644 api/ledger/ledger_models/coa.go create mode 100644 api/ledger/ledger_models/coa_item.go create mode 100644 api/ledger/ledger_models/coa_request.go create mode 100644 api/ledger/ledger_models/coa_response.go create mode 100644 api/ledger/ledger_models/delete_response.go create mode 100644 api/ledger/ledger_models/error.go create mode 100644 api/ledger/ledger_models/gl_account.go create mode 100644 api/ledger/ledger_models/gl_account_request.go create mode 100644 api/ledger/ledger_models/gl_account_response.go create mode 100644 api/ledger/ledger_models/gl_balance.go create mode 100644 api/ledger/ledger_models/gl_balance_request.go create mode 100644 api/ledger/ledger_models/gl_balance_response.go create mode 100644 api/ledger/ledger_models/invalid_error.go create mode 100644 api/ledger/ledger_models/journal_entry.go create mode 100644 api/ledger/ledger_models/journal_entry_request.go create mode 100644 api/ledger/ledger_models/journal_entry_response.go create mode 100644 api/ledger/ledger_models/journal_item.go create mode 100644 api/ledger/ledger_models/journal_item_response.go create mode 100644 api/ledger/ledger_models/journal_item_summary.go create mode 100644 api/ledger/ledger_models/journal_item_summary_response.go create mode 100644 api/ledger/ledger_models/message.go create mode 100644 api/ledger/ledger_models/pagination.go create mode 100644 api/ledger/ledger_models/period.go create mode 100644 api/ledger/ledger_models/period_request.go create mode 100644 api/ledger/ledger_models/period_response.go create mode 100644 api/ledger/ledger_models/put_response.go create mode 100644 api/ledger/ledger_models/request_meta.go create mode 100644 api/ledger/ledger_models/response_meta.go create mode 100644 api/metrc-gw/metrc_gw_client/facilities/facilities_client.go create mode 100644 api/metrc-gw/metrc_gw_client/facilities/get_facilities_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/facilities/get_facilities_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/get_harvests_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/get_harvests_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/harvests_client.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/put_harvests_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/harvests/put_harvests_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/items/delete_item_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/items/delete_item_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/items/get_brands_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/items/get_brands_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/items/get_item_product_categories_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/items/get_item_product_categories_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/items/get_items_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/items/get_items_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/items/items_client.go create mode 100644 api/metrc-gw/metrc_gw_client/items/post_items_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/items/post_items_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/items/put_items_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/items/put_items_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/lab_tests/lab_tests_client.go create mode 100644 api/metrc-gw/metrc_gw_client/metrc_gw_client.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/get_package_types_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/get_package_types_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/get_packages_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/get_packages_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/packages_client.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/post_packages_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/post_packages_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/put_packages_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/packages/put_packages_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/plant_batches_client.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/delete_plant_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/delete_plant_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plants_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/get_plants_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/plants_client.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/post_plants_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/post_plants_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/put_plants_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/plants/put_plants_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/delete_room_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/delete_room_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/get_rooms_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/get_rooms_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/post_rooms_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/post_rooms_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/put_rooms_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/put_rooms_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/rooms/rooms_client.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_customer_types_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_customer_types_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_receipts_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_receipts_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_transactions_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/get_sales_transactions_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/post_sales_receipts_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/post_sales_receipts_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/post_sales_transactions_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/post_sales_transactions_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/put_sales_receipts_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/put_sales_receipts_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/put_sales_transactions_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/put_sales_transactions_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sales/sales_client.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/delete_strain_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/delete_strain_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/get_strains_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/get_strains_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/post_strains_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/post_strains_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/put_strains_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/put_strains_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/strains/strains_client.go create mode 100644 api/metrc-gw/metrc_gw_client/sys/get_metrics_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/sys/get_metrics_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/sys/sys_client.go create mode 100644 api/metrc-gw/metrc_gw_client/transfers/get_transfers_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/transfers/get_transfers_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/transfers/transfers_client.go create mode 100644 api/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_parameters.go create mode 100644 api/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_responses.go create mode 100644 api/metrc-gw/metrc_gw_client/units_of_measure/units_of_measure_client.go create mode 100644 api/metrc-gw/metrc_gw_models/customer_type.go create mode 100644 api/metrc-gw/metrc_gw_models/customer_type_response.go create mode 100644 api/metrc-gw/metrc_gw_models/error.go create mode 100644 api/metrc-gw/metrc_gw_models/facility.go create mode 100644 api/metrc-gw/metrc_gw_models/facility_response.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_package.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_package_ingredient.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_package_request.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_response.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_update.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_update_request.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_update_response.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_waste_type.go create mode 100644 api/metrc-gw/metrc_gw_models/harvest_waste_type_response.go create mode 100644 api/metrc-gw/metrc_gw_models/invalid_error.go create mode 100644 api/metrc-gw/metrc_gw_models/item.go create mode 100644 api/metrc-gw/metrc_gw_models/item_request.go create mode 100644 api/metrc-gw/metrc_gw_models/item_response.go create mode 100644 api/metrc-gw/metrc_gw_models/lab_test_state.go create mode 100644 api/metrc-gw/metrc_gw_models/lab_test_state_response.go create mode 100644 api/metrc-gw/metrc_gw_models/lab_test_type.go create mode 100644 api/metrc-gw/metrc_gw_models/lab_test_type_response.go create mode 100644 api/metrc-gw/metrc_gw_models/license.go create mode 100644 api/metrc-gw/metrc_gw_models/package.go create mode 100644 api/metrc-gw/metrc_gw_models/package_adjustment_reason.go create mode 100644 api/metrc-gw/metrc_gw_models/package_adjustment_reason_response.go create mode 100644 api/metrc-gw/metrc_gw_models/package_request.go create mode 100644 api/metrc-gw/metrc_gw_models/package_response.go create mode 100644 api/metrc-gw/metrc_gw_models/package_type.go create mode 100644 api/metrc-gw/metrc_gw_models/package_type_response.go create mode 100644 api/metrc-gw/metrc_gw_models/pagination.go create mode 100644 api/metrc-gw/metrc_gw_models/plant.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_batch.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_batch_request.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_batch_response.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_growth_phase.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_growth_phase_response.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_request.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_response.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_waste_method.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_waste_method_response.go create mode 100644 api/metrc-gw/metrc_gw_models/plant_waste_reason_response.go create mode 100644 api/metrc-gw/metrc_gw_models/product_category.go create mode 100644 api/metrc-gw/metrc_gw_models/product_category_response.go create mode 100644 api/metrc-gw/metrc_gw_models/request_meta.go create mode 100644 api/metrc-gw/metrc_gw_models/response_meta.go create mode 100644 api/metrc-gw/metrc_gw_models/room.go create mode 100644 api/metrc-gw/metrc_gw_models/room_request.go create mode 100644 api/metrc-gw/metrc_gw_models/room_response.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_delivery.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_delivery_request.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_delivery_response.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_delivery_return_reason.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_delivery_return_reason_response.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_receipt.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_receipt_request.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_receipt_response.go create mode 100644 api/metrc-gw/metrc_gw_models/sales_transaction_date_response.go create mode 100644 api/metrc-gw/metrc_gw_models/strain.go create mode 100644 api/metrc-gw/metrc_gw_models/strain_request.go create mode 100644 api/metrc-gw/metrc_gw_models/strain_response.go create mode 100644 api/metrc-gw/metrc_gw_models/transaction.go create mode 100644 api/metrc-gw/metrc_gw_models/transaction_request.go create mode 100644 api/metrc-gw/metrc_gw_models/transaction_response.go create mode 100644 api/metrc-gw/metrc_gw_models/transfer.go create mode 100644 api/metrc-gw/metrc_gw_models/transfer_response.go create mode 100644 api/metrc-gw/metrc_gw_models/units_of_measure.go create mode 100644 api/metrc-gw/metrc_gw_models/units_of_measure_response.go create mode 100644 api/ops/ops_client/cash_receipt/cash_receipt_client.go create mode 100644 api/ops/ops_client/cash_receipt/delete_cash_receipt_parameters.go create mode 100644 api/ops/ops_client/cash_receipt/delete_cash_receipt_responses.go create mode 100644 api/ops/ops_client/cash_receipt/get_cash_receipts_parameters.go create mode 100644 api/ops/ops_client/cash_receipt/get_cash_receipts_responses.go create mode 100644 api/ops/ops_client/cash_receipt/post_cash_receipts_parameters.go create mode 100644 api/ops/ops_client/cash_receipt/post_cash_receipts_responses.go create mode 100644 api/ops/ops_client/cash_receipt/put_cash_receipts_parameters.go create mode 100644 api/ops/ops_client/cash_receipt/put_cash_receipts_responses.go create mode 100644 api/ops/ops_client/charge/charge_client.go create mode 100644 api/ops/ops_client/charge/delete_charge_parameters.go create mode 100644 api/ops/ops_client/charge/delete_charge_responses.go create mode 100644 api/ops/ops_client/charge/get_charges_parameters.go create mode 100644 api/ops/ops_client/charge/get_charges_responses.go create mode 100644 api/ops/ops_client/charge/post_charges_parameters.go create mode 100644 api/ops/ops_client/charge/post_charges_responses.go create mode 100644 api/ops/ops_client/charge/put_charges_parameters.go create mode 100644 api/ops/ops_client/charge/put_charges_responses.go create mode 100644 api/ops/ops_client/cors/cash_receipt_options_parameters.go create mode 100644 api/ops/ops_client/cors/cash_receipt_options_responses.go create mode 100644 api/ops/ops_client/cors/charge_options_parameters.go create mode 100644 api/ops/ops_client/cors/charge_options_responses.go create mode 100644 api/ops/ops_client/cors/cors_client.go create mode 100644 api/ops/ops_client/cors/eft_options_parameters.go create mode 100644 api/ops/ops_client/cors/eft_options_responses.go create mode 100644 api/ops/ops_client/cors/invoice_options_parameters.go create mode 100644 api/ops/ops_client/cors/invoice_options_responses.go create mode 100644 api/ops/ops_client/cors/orders_options_parameters.go create mode 100644 api/ops/ops_client/cors/orders_options_responses.go create mode 100644 api/ops/ops_client/cors/payment_method_options_parameters.go create mode 100644 api/ops/ops_client/cors/payment_method_options_responses.go create mode 100644 api/ops/ops_client/cors/po_options_parameters.go create mode 100644 api/ops/ops_client/cors/po_options_responses.go create mode 100644 api/ops/ops_client/cors/product_options_observable_parameters.go create mode 100644 api/ops/ops_client/cors/product_options_observable_responses.go create mode 100644 api/ops/ops_client/cors/product_options_parameters.go create mode 100644 api/ops/ops_client/cors/product_options_responses.go create mode 100644 api/ops/ops_client/cors/quote_options_parameters.go create mode 100644 api/ops/ops_client/cors/quote_options_responses.go create mode 100644 api/ops/ops_client/cors/tax_invoice_options_parameters.go create mode 100644 api/ops/ops_client/cors/tax_invoice_options_responses.go create mode 100644 api/ops/ops_client/cors/tax_order_options_parameters.go create mode 100644 api/ops/ops_client/cors/tax_order_options_responses.go create mode 100644 api/ops/ops_client/cors/tax_po_options_parameters.go create mode 100644 api/ops/ops_client/cors/tax_po_options_responses.go create mode 100644 api/ops/ops_client/cors/tax_quote_options_parameters.go create mode 100644 api/ops/ops_client/cors/tax_quote_options_responses.go create mode 100644 api/ops/ops_client/eft/eft_client.go create mode 100644 api/ops/ops_client/eft/get_efts_parameters.go create mode 100644 api/ops/ops_client/eft/get_efts_responses.go create mode 100644 api/ops/ops_client/eft/post_efts_parameters.go create mode 100644 api/ops/ops_client/eft/post_efts_responses.go create mode 100644 api/ops/ops_client/eft/put_efts_parameters.go create mode 100644 api/ops/ops_client/eft/put_efts_responses.go create mode 100644 api/ops/ops_client/invoice/delete_invoice_parameters.go create mode 100644 api/ops/ops_client/invoice/delete_invoice_responses.go create mode 100644 api/ops/ops_client/invoice/get_invoices_parameters.go create mode 100644 api/ops/ops_client/invoice/get_invoices_responses.go create mode 100644 api/ops/ops_client/invoice/invoice_client.go create mode 100644 api/ops/ops_client/invoice/post_invoices_parameters.go create mode 100644 api/ops/ops_client/invoice/post_invoices_responses.go create mode 100644 api/ops/ops_client/invoice/put_invoices_parameters.go create mode 100644 api/ops/ops_client/invoice/put_invoices_responses.go create mode 100644 api/ops/ops_client/ops_client.go create mode 100644 api/ops/ops_client/order/delete_order_parameters.go create mode 100644 api/ops/ops_client/order/delete_order_responses.go create mode 100644 api/ops/ops_client/order/get_orders_parameters.go create mode 100644 api/ops/ops_client/order/get_orders_responses.go create mode 100644 api/ops/ops_client/order/order_client.go create mode 100644 api/ops/ops_client/order/post_orders_parameters.go create mode 100644 api/ops/ops_client/order/post_orders_responses.go create mode 100644 api/ops/ops_client/order/put_orders_parameters.go create mode 100644 api/ops/ops_client/order/put_orders_responses.go create mode 100644 api/ops/ops_client/payment_method/delete_payment_method_parameters.go create mode 100644 api/ops/ops_client/payment_method/delete_payment_method_responses.go create mode 100644 api/ops/ops_client/payment_method/get_payment_methods_parameters.go create mode 100644 api/ops/ops_client/payment_method/get_payment_methods_responses.go create mode 100644 api/ops/ops_client/payment_method/payment_method_client.go create mode 100644 api/ops/ops_client/payment_method/post_payment_methods_parameters.go create mode 100644 api/ops/ops_client/payment_method/post_payment_methods_responses.go create mode 100644 api/ops/ops_client/payment_method/put_payment_methods_parameters.go create mode 100644 api/ops/ops_client/payment_method/put_payment_methods_responses.go create mode 100644 api/ops/ops_client/product/delete_product_parameters.go create mode 100644 api/ops/ops_client/product/delete_product_responses.go create mode 100644 api/ops/ops_client/product/get_products_observable_parameters.go create mode 100644 api/ops/ops_client/product/get_products_observable_responses.go create mode 100644 api/ops/ops_client/product/get_products_parameters.go create mode 100644 api/ops/ops_client/product/get_products_responses.go create mode 100644 api/ops/ops_client/product/post_products_parameters.go create mode 100644 api/ops/ops_client/product/post_products_responses.go create mode 100644 api/ops/ops_client/product/product_client.go create mode 100644 api/ops/ops_client/product/put_products_parameters.go create mode 100644 api/ops/ops_client/product/put_products_responses.go create mode 100644 api/ops/ops_client/purchase_order/delete_purchase_order_parameters.go create mode 100644 api/ops/ops_client/purchase_order/delete_purchase_order_responses.go create mode 100644 api/ops/ops_client/purchase_order/get_purchase_orders_parameters.go create mode 100644 api/ops/ops_client/purchase_order/get_purchase_orders_responses.go create mode 100644 api/ops/ops_client/purchase_order/post_purchase_orders_parameters.go create mode 100644 api/ops/ops_client/purchase_order/post_purchase_orders_responses.go create mode 100644 api/ops/ops_client/purchase_order/purchase_order_client.go create mode 100644 api/ops/ops_client/purchase_order/put_purchase_orders_parameters.go create mode 100644 api/ops/ops_client/purchase_order/put_purchase_orders_responses.go create mode 100644 api/ops/ops_client/quote/delete_quote_parameters.go create mode 100644 api/ops/ops_client/quote/delete_quote_responses.go create mode 100644 api/ops/ops_client/quote/get_quotes_parameters.go create mode 100644 api/ops/ops_client/quote/get_quotes_responses.go create mode 100644 api/ops/ops_client/quote/post_quotes_parameters.go create mode 100644 api/ops/ops_client/quote/post_quotes_responses.go create mode 100644 api/ops/ops_client/quote/put_quotes_parameters.go create mode 100644 api/ops/ops_client/quote/put_quotes_responses.go create mode 100644 api/ops/ops_client/quote/quote_client.go create mode 100644 api/ops/ops_client/tax/post_taxes_invoices_parameters.go create mode 100644 api/ops/ops_client/tax/post_taxes_invoices_responses.go create mode 100644 api/ops/ops_client/tax/post_taxes_orders_parameters.go create mode 100644 api/ops/ops_client/tax/post_taxes_orders_responses.go create mode 100644 api/ops/ops_client/tax/post_taxes_pos_parameters.go create mode 100644 api/ops/ops_client/tax/post_taxes_pos_responses.go create mode 100644 api/ops/ops_client/tax/post_taxes_quotes_parameters.go create mode 100644 api/ops/ops_client/tax/post_taxes_quotes_responses.go create mode 100644 api/ops/ops_client/tax/tax_client.go create mode 100644 api/ops/ops_models/address.go create mode 100644 api/ops/ops_models/cash_receipt.go create mode 100644 api/ops/ops_models/cash_receipt_request.go create mode 100644 api/ops/ops_models/cash_receipt_response.go create mode 100644 api/ops/ops_models/charge.go create mode 100644 api/ops/ops_models/charge_request.go create mode 100644 api/ops/ops_models/charge_response.go create mode 100644 api/ops/ops_models/contract.go create mode 100644 api/ops/ops_models/credit_card.go create mode 100644 api/ops/ops_models/delete_response.go create mode 100644 api/ops/ops_models/eft.go create mode 100644 api/ops/ops_models/eft_item.go create mode 100644 api/ops/ops_models/eft_request.go create mode 100644 api/ops/ops_models/eft_response.go create mode 100644 api/ops/ops_models/error.go create mode 100644 api/ops/ops_models/invalid_error.go create mode 100644 api/ops/ops_models/invoice.go create mode 100644 api/ops/ops_models/invoice_basic.go create mode 100644 api/ops/ops_models/invoice_item.go create mode 100644 api/ops/ops_models/invoice_request.go create mode 100644 api/ops/ops_models/invoice_response.go create mode 100644 api/ops/ops_models/item_basic.go create mode 100644 api/ops/ops_models/message.go create mode 100644 api/ops/ops_models/order.go create mode 100644 api/ops/ops_models/order_item.go create mode 100644 api/ops/ops_models/order_request.go create mode 100644 api/ops/ops_models/order_response.go create mode 100644 api/ops/ops_models/pagination.go create mode 100644 api/ops/ops_models/payment_method.go create mode 100644 api/ops/ops_models/payment_method_request.go create mode 100644 api/ops/ops_models/payment_method_response.go create mode 100644 api/ops/ops_models/pricebook.go create mode 100644 api/ops/ops_models/pricebook_entry.go create mode 100644 api/ops/ops_models/product.go create mode 100644 api/ops/ops_models/product_request.go create mode 100644 api/ops/ops_models/product_response.go create mode 100644 api/ops/ops_models/purchase_order.go create mode 100644 api/ops/ops_models/purchase_order_item.go create mode 100644 api/ops/ops_models/purchase_order_request.go create mode 100644 api/ops/ops_models/purchase_order_response.go create mode 100644 api/ops/ops_models/put_response.go create mode 100644 api/ops/ops_models/quote.go create mode 100644 api/ops/ops_models/quote_basic.go create mode 100644 api/ops/ops_models/quote_item.go create mode 100644 api/ops/ops_models/quote_request.go create mode 100644 api/ops/ops_models/quote_response.go create mode 100644 api/ops/ops_models/response_meta.go create mode 100644 api/ops/ops_models/subscription.go create mode 100644 api/ops/ops_models/subscription_request.go create mode 100644 api/ops/ops_models/subscription_response.go create mode 100644 api/ops/ops_models/tax_transaction.go create mode 100644 api/ops/ops_models/tax_transaction_response.go create mode 100644 api/ops/ops_models/total.go create mode 100644 api/ops/ops_models/total_item.go create mode 100644 api/ops/ops_models/total_tax_item.go create mode 100644 api/pdf/pdf_client/pdf/get_p_d_f_parameters.go create mode 100644 api/pdf/pdf_client/pdf/get_p_d_f_responses.go create mode 100644 api/pdf/pdf_client/pdf/pdf_client.go create mode 100644 api/pdf/pdf_client/pdf_client.go create mode 100644 api/pdf/pdf_models/error.go create mode 100644 api/plex/plex_client/invoice/get_invoices_parameters.go create mode 100644 api/plex/plex_client/invoice/get_invoices_responses.go create mode 100644 api/plex/plex_client/invoice/get_medicinal_parameters.go create mode 100644 api/plex/plex_client/invoice/get_medicinal_responses.go create mode 100644 api/plex/plex_client/invoice/invoice_client.go create mode 100644 api/plex/plex_client/invoice_item/get_invoiceitems_parameters.go create mode 100644 api/plex/plex_client/invoice_item/get_invoiceitems_responses.go create mode 100644 api/plex/plex_client/invoice_item/invoice_item_client.go create mode 100644 api/plex/plex_client/plex_client.go create mode 100644 api/plex/plex_client/tax/get_district_taxes_parameters.go create mode 100644 api/plex/plex_client/tax/get_district_taxes_responses.go create mode 100644 api/plex/plex_client/tax/get_sales_and_use_tax_return_parameters.go create mode 100644 api/plex/plex_client/tax/get_sales_and_use_tax_return_responses.go create mode 100644 api/plex/plex_client/tax/get_use_tax_parameters.go create mode 100644 api/plex/plex_client/tax/get_use_tax_responses.go create mode 100644 api/plex/plex_client/tax/tax_client.go create mode 100644 api/plex/plex_models/additional_deductions.go create mode 100644 api/plex/plex_models/district_taxes.go create mode 100644 api/plex/plex_models/error.go create mode 100644 api/plex/plex_models/invoice_item_summary.go create mode 100644 api/plex/plex_models/invoice_item_summary_response.go create mode 100644 api/plex/plex_models/invoice_summary.go create mode 100644 api/plex/plex_models/invoice_summary_response.go create mode 100644 api/plex/plex_models/pagination.go create mode 100644 api/plex/plex_models/request_meta.go create mode 100644 api/plex/plex_models/response_meta.go create mode 100644 api/plex/plex_models/tax_return.go create mode 100644 api/plex/plex_models/tax_return_panel.go create mode 100644 api/plex/plex_models/tax_return_response.go create mode 100644 api/plex/plex_models/tax_summary.go create mode 100644 api/plex/plex_models/tax_summary_response.go create mode 100644 api/plex/plex_models/use_tax.go create mode 100644 api/plex/plex_models/use_tax_response.go create mode 100644 api/regs/regs_client/authority/authority_client.go create mode 100644 api/regs/regs_client/authority/get_authorities_parameters.go create mode 100644 api/regs/regs_client/authority/get_authorities_responses.go create mode 100644 api/regs/regs_client/authority/post_authorities_parameters.go create mode 100644 api/regs/regs_client/authority/post_authorities_responses.go create mode 100644 api/regs/regs_client/authority/put_authorities_parameters.go create mode 100644 api/regs/regs_client/authority/put_authorities_responses.go create mode 100644 api/regs/regs_client/backend/backend_client.go create mode 100644 api/regs/regs_client/backend/delete_backend_parameters.go create mode 100644 api/regs/regs_client/backend/delete_backend_responses.go create mode 100644 api/regs/regs_client/backend/get_backends_parameters.go create mode 100644 api/regs/regs_client/backend/get_backends_responses.go create mode 100644 api/regs/regs_client/backend/post_backends_parameters.go create mode 100644 api/regs/regs_client/backend/post_backends_responses.go create mode 100644 api/regs/regs_client/backend/put_backends_parameters.go create mode 100644 api/regs/regs_client/backend/put_backends_responses.go create mode 100644 api/regs/regs_client/cors/authority_options_parameters.go create mode 100644 api/regs/regs_client/cors/authority_options_responses.go create mode 100644 api/regs/regs_client/cors/backend_options_parameters.go create mode 100644 api/regs/regs_client/cors/backend_options_responses.go create mode 100644 api/regs/regs_client/cors/cors_client.go create mode 100644 api/regs/regs_client/cors/filing_options_parameters.go create mode 100644 api/regs/regs_client/cors/filing_options_responses.go create mode 100644 api/regs/regs_client/cors/filing_type_options_parameters.go create mode 100644 api/regs/regs_client/cors/filing_type_options_responses.go create mode 100644 api/regs/regs_client/cors/license_options_parameters.go create mode 100644 api/regs/regs_client/cors/license_options_responses.go create mode 100644 api/regs/regs_client/cors/license_type_options_parameters.go create mode 100644 api/regs/regs_client/cors/license_type_options_responses.go create mode 100644 api/regs/regs_client/cors/notebook_options_parameters.go create mode 100644 api/regs/regs_client/cors/notebook_options_responses.go create mode 100644 api/regs/regs_client/cors/rating_engine_options_parameters.go create mode 100644 api/regs/regs_client/cors/rating_engine_options_responses.go create mode 100644 api/regs/regs_client/cors/submission_options_parameters.go create mode 100644 api/regs/regs_client/cors/submission_options_responses.go create mode 100644 api/regs/regs_client/cors/tax_type_account_options_parameters.go create mode 100644 api/regs/regs_client/cors/tax_type_account_options_responses.go create mode 100644 api/regs/regs_client/cors/transaction_options_parameters.go create mode 100644 api/regs/regs_client/cors/transaction_options_responses.go create mode 100644 api/regs/regs_client/filing/filing_client.go create mode 100644 api/regs/regs_client/filing/get_filings_parameters.go create mode 100644 api/regs/regs_client/filing/get_filings_responses.go create mode 100644 api/regs/regs_client/filing/post_filings_parameters.go create mode 100644 api/regs/regs_client/filing/post_filings_responses.go create mode 100644 api/regs/regs_client/filing/put_filings_parameters.go create mode 100644 api/regs/regs_client/filing/put_filings_responses.go create mode 100644 api/regs/regs_client/filing_type/filing_type_client.go create mode 100644 api/regs/regs_client/filing_type/get_filing_types_parameters.go create mode 100644 api/regs/regs_client/filing_type/get_filing_types_responses.go create mode 100644 api/regs/regs_client/filing_type/post_filing_types_parameters.go create mode 100644 api/regs/regs_client/filing_type/post_filing_types_responses.go create mode 100644 api/regs/regs_client/filing_type/put_filing_types_parameters.go create mode 100644 api/regs/regs_client/filing_type/put_filing_types_responses.go create mode 100644 api/regs/regs_client/license/get_licenses_parameters.go create mode 100644 api/regs/regs_client/license/get_licenses_responses.go create mode 100644 api/regs/regs_client/license/license_client.go create mode 100644 api/regs/regs_client/license/post_licenses_parameters.go create mode 100644 api/regs/regs_client/license/post_licenses_responses.go create mode 100644 api/regs/regs_client/license/put_licenses_parameters.go create mode 100644 api/regs/regs_client/license/put_licenses_responses.go create mode 100644 api/regs/regs_client/license_type/get_license_types_parameters.go create mode 100644 api/regs/regs_client/license_type/get_license_types_responses.go create mode 100644 api/regs/regs_client/license_type/license_type_client.go create mode 100644 api/regs/regs_client/license_type/post_license_types_parameters.go create mode 100644 api/regs/regs_client/license_type/post_license_types_responses.go create mode 100644 api/regs/regs_client/notebook/get_notebooks_parameters.go create mode 100644 api/regs/regs_client/notebook/get_notebooks_responses.go create mode 100644 api/regs/regs_client/notebook/notebook_client.go create mode 100644 api/regs/regs_client/notebook/post_notebooks_parameters.go create mode 100644 api/regs/regs_client/notebook/post_notebooks_responses.go create mode 100644 api/regs/regs_client/notebook/put_notebooks_parameters.go create mode 100644 api/regs/regs_client/notebook/put_notebooks_responses.go create mode 100644 api/regs/regs_client/rating_engine/delete_rating_engine_parameters.go create mode 100644 api/regs/regs_client/rating_engine/delete_rating_engine_responses.go create mode 100644 api/regs/regs_client/rating_engine/get_rating_engines_parameters.go create mode 100644 api/regs/regs_client/rating_engine/get_rating_engines_responses.go create mode 100644 api/regs/regs_client/rating_engine/post_rating_engines_parameters.go create mode 100644 api/regs/regs_client/rating_engine/post_rating_engines_responses.go create mode 100644 api/regs/regs_client/rating_engine/put_rating_engines_parameters.go create mode 100644 api/regs/regs_client/rating_engine/put_rating_engines_responses.go create mode 100644 api/regs/regs_client/rating_engine/rating_engine_client.go create mode 100644 api/regs/regs_client/regs_client.go create mode 100644 api/regs/regs_client/submission/get_submissions_parameters.go create mode 100644 api/regs/regs_client/submission/get_submissions_responses.go create mode 100644 api/regs/regs_client/submission/post_submissions_parameters.go create mode 100644 api/regs/regs_client/submission/post_submissions_responses.go create mode 100644 api/regs/regs_client/submission/put_submissions_parameters.go create mode 100644 api/regs/regs_client/submission/put_submissions_responses.go create mode 100644 api/regs/regs_client/submission/submission_client.go create mode 100644 api/regs/regs_client/tax_type_account/delete_type_accounts_parameters.go create mode 100644 api/regs/regs_client/tax_type_account/delete_type_accounts_responses.go create mode 100644 api/regs/regs_client/tax_type_account/get_tax_type_accounts_parameters.go create mode 100644 api/regs/regs_client/tax_type_account/get_tax_type_accounts_responses.go create mode 100644 api/regs/regs_client/tax_type_account/post_tax_type_accounts_parameters.go create mode 100644 api/regs/regs_client/tax_type_account/post_tax_type_accounts_responses.go create mode 100644 api/regs/regs_client/tax_type_account/put_tax_type_accounts_parameters.go create mode 100644 api/regs/regs_client/tax_type_account/put_tax_type_accounts_responses.go create mode 100644 api/regs/regs_client/tax_type_account/tax_type_account_client.go create mode 100644 api/regs/regs_client/transaction/get_transactions_parameters.go create mode 100644 api/regs/regs_client/transaction/get_transactions_responses.go create mode 100644 api/regs/regs_client/transaction/post_transactions_parameters.go create mode 100644 api/regs/regs_client/transaction/post_transactions_responses.go create mode 100644 api/regs/regs_client/transaction/put_transactions_parameters.go create mode 100644 api/regs/regs_client/transaction/put_transactions_responses.go create mode 100644 api/regs/regs_client/transaction/transaction_client.go create mode 100644 api/regs/regs_models/authority.go create mode 100644 api/regs/regs_models/authority_request.go create mode 100644 api/regs/regs_models/authority_response.go create mode 100644 api/regs/regs_models/backend.go create mode 100644 api/regs/regs_models/backend_request.go create mode 100644 api/regs/regs_models/backend_response.go create mode 100644 api/regs/regs_models/delete_response.go create mode 100644 api/regs/regs_models/error.go create mode 100644 api/regs/regs_models/filing.go create mode 100644 api/regs/regs_models/filing_request.go create mode 100644 api/regs/regs_models/filing_response.go create mode 100644 api/regs/regs_models/filing_schedule_item.go create mode 100644 api/regs/regs_models/filing_type.go create mode 100644 api/regs/regs_models/filing_type_instance.go create mode 100644 api/regs/regs_models/filing_type_request.go create mode 100644 api/regs/regs_models/filing_type_response.go create mode 100644 api/regs/regs_models/geo_license_type_instance.go create mode 100644 api/regs/regs_models/invalid_error.go create mode 100644 api/regs/regs_models/license.go create mode 100644 api/regs/regs_models/license_request.go create mode 100644 api/regs/regs_models/license_response.go create mode 100644 api/regs/regs_models/license_type.go create mode 100644 api/regs/regs_models/license_type_request.go create mode 100644 api/regs/regs_models/license_type_response.go create mode 100644 api/regs/regs_models/message.go create mode 100644 api/regs/regs_models/notebook.go create mode 100644 api/regs/regs_models/notebook_item.go create mode 100644 api/regs/regs_models/notebook_request.go create mode 100644 api/regs/regs_models/notebook_response.go create mode 100644 api/regs/regs_models/pagination.go create mode 100644 api/regs/regs_models/rating_engine.go create mode 100644 api/regs/regs_models/rating_engine_item.go create mode 100644 api/regs/regs_models/rating_engine_request.go create mode 100644 api/regs/regs_models/rating_engine_response.go create mode 100644 api/regs/regs_models/request_meta.go create mode 100644 api/regs/regs_models/response_meta.go create mode 100644 api/regs/regs_models/submission.go create mode 100644 api/regs/regs_models/submission_request.go create mode 100644 api/regs/regs_models/submission_response.go create mode 100644 api/regs/regs_models/tax_type_account.go create mode 100644 api/regs/regs_models/tax_type_account_request.go create mode 100644 api/regs/regs_models/tax_type_account_response.go create mode 100644 api/regs/regs_models/transaction.go create mode 100644 api/regs/regs_models/transaction_request.go create mode 100644 api/regs/regs_models/transaction_response.go create mode 100644 api/render/render_client/account/account_client.go create mode 100644 api/render/render_client/account/get_render_account_parameters.go create mode 100644 api/render/render_client/account/get_render_account_responses.go create mode 100644 api/render/render_client/cors/account_options_parameters.go create mode 100644 api/render/render_client/cors/account_options_responses.go create mode 100644 api/render/render_client/cors/cors_client.go create mode 100644 api/render/render_client/cors/county_options_parameters.go create mode 100644 api/render/render_client/cors/county_options_responses.go create mode 100644 api/render/render_client/cors/ingest_options_parameters.go create mode 100644 api/render/render_client/cors/ingest_options_responses.go create mode 100644 api/render/render_client/cors/invoice_options_parameters.go create mode 100644 api/render/render_client/cors/invoice_options_responses.go create mode 100644 api/render/render_client/cors/report_options_parameters.go create mode 100644 api/render/render_client/cors/report_options_responses.go create mode 100644 api/render/render_client/cors/tax_options_parameters.go create mode 100644 api/render/render_client/cors/tax_options_responses.go create mode 100644 api/render/render_client/county/county_client.go create mode 100644 api/render/render_client/county/get_render_county_parameters.go create mode 100644 api/render/render_client/county/get_render_county_responses.go create mode 100644 api/render/render_client/ingest/get_render_ingests_parameters.go create mode 100644 api/render/render_client/ingest/get_render_ingests_responses.go create mode 100644 api/render/render_client/ingest/ingest_client.go create mode 100644 api/render/render_client/invoice/get_render_invoice_parameters.go create mode 100644 api/render/render_client/invoice/get_render_invoice_responses.go create mode 100644 api/render/render_client/invoice/invoice_client.go create mode 100644 api/render/render_client/render_client.go create mode 100644 api/render/render_client/report/get_render_reports_parameters.go create mode 100644 api/render/render_client/report/get_render_reports_responses.go create mode 100644 api/render/render_client/report/report_client.go create mode 100644 api/render/render_client/tax/get_render_taxes_parameters.go create mode 100644 api/render/render_client/tax/get_render_taxes_responses.go create mode 100644 api/render/render_client/tax/tax_client.go create mode 100644 api/render/render_models/document.go create mode 100644 api/render/render_models/document_response.go create mode 100644 api/render/render_models/error.go create mode 100644 api/render/render_models/invalid_error.go create mode 100644 api/render/render_models/pagination.go create mode 100644 api/render/render_models/response_meta.go create mode 100644 api/sf-gate/sf_gate_client/accounting_rules/accounting_rules_client.go create mode 100644 api/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_parameters.go create mode 100644 api/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_responses.go create mode 100644 api/sf-gate/sf_gate_client/accounting_rulesets/accounting_rulesets_client.go create mode 100644 api/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_parameters.go create mode 100644 api/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_responses.go create mode 100644 api/sf-gate/sf_gate_client/accounts/accounts_client.go create mode 100644 api/sf-gate/sf_gate_client/accounts/get_accounts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/accounts/get_accounts_responses.go create mode 100644 api/sf-gate/sf_gate_client/accounts/post_accounts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/accounts/post_accounts_responses.go create mode 100644 api/sf-gate/sf_gate_client/accounts/put_account_parameters.go create mode 100644 api/sf-gate/sf_gate_client/accounts/put_account_responses.go create mode 100644 api/sf-gate/sf_gate_client/authorities/authorities_client.go create mode 100644 api/sf-gate/sf_gate_client/authorities/get_authorities_parameters.go create mode 100644 api/sf-gate/sf_gate_client/authorities/get_authorities_responses.go create mode 100644 api/sf-gate/sf_gate_client/backends/backends_client.go create mode 100644 api/sf-gate/sf_gate_client/backends/get_backends_parameters.go create mode 100644 api/sf-gate/sf_gate_client/backends/get_backends_responses.go create mode 100644 api/sf-gate/sf_gate_client/cash_receipts/cash_receipts_client.go create mode 100644 api/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_responses.go create mode 100644 api/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_responses.go create mode 100644 api/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_responses.go create mode 100644 api/sf-gate/sf_gate_client/clusters/clusters_client.go create mode 100644 api/sf-gate/sf_gate_client/clusters/get_clusters_parameters.go create mode 100644 api/sf-gate/sf_gate_client/clusters/get_clusters_responses.go create mode 100644 api/sf-gate/sf_gate_client/clusters/post_clusters_parameters.go create mode 100644 api/sf-gate/sf_gate_client/clusters/post_clusters_responses.go create mode 100644 api/sf-gate/sf_gate_client/clusters/put_clusters_parameters.go create mode 100644 api/sf-gate/sf_gate_client/clusters/put_clusters_responses.go create mode 100644 api/sf-gate/sf_gate_client/companies/companies_client.go create mode 100644 api/sf-gate/sf_gate_client/companies/get_companies_parameters.go create mode 100644 api/sf-gate/sf_gate_client/companies/get_companies_responses.go create mode 100644 api/sf-gate/sf_gate_client/contacts/contacts_client.go create mode 100644 api/sf-gate/sf_gate_client/contacts/delete_contact_parameters.go create mode 100644 api/sf-gate/sf_gate_client/contacts/delete_contact_responses.go create mode 100644 api/sf-gate/sf_gate_client/contacts/get_contacts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/contacts/get_contacts_responses.go create mode 100644 api/sf-gate/sf_gate_client/contacts/post_contacts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/contacts/post_contacts_responses.go create mode 100644 api/sf-gate/sf_gate_client/contacts/put_contacts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/contacts/put_contacts_responses.go create mode 100644 api/sf-gate/sf_gate_client/counties/counties_client.go create mode 100644 api/sf-gate/sf_gate_client/counties/get_counties_parameters.go create mode 100644 api/sf-gate/sf_gate_client/counties/get_counties_responses.go create mode 100644 api/sf-gate/sf_gate_client/countries/countries_client.go create mode 100644 api/sf-gate/sf_gate_client/countries/get_countries_parameters.go create mode 100644 api/sf-gate/sf_gate_client/countries/get_countries_responses.go create mode 100644 api/sf-gate/sf_gate_client/databases/databases_client.go create mode 100644 api/sf-gate/sf_gate_client/databases/get_databases_parameters.go create mode 100644 api/sf-gate/sf_gate_client/databases/get_databases_responses.go create mode 100644 api/sf-gate/sf_gate_client/databases/post_databases_parameters.go create mode 100644 api/sf-gate/sf_gate_client/databases/post_databases_responses.go create mode 100644 api/sf-gate/sf_gate_client/databases/put_databases_parameters.go create mode 100644 api/sf-gate/sf_gate_client/databases/put_databases_responses.go create mode 100644 api/sf-gate/sf_gate_client/domains/domains_client.go create mode 100644 api/sf-gate/sf_gate_client/domains/get_domains_parameters.go create mode 100644 api/sf-gate/sf_gate_client/domains/get_domains_responses.go create mode 100644 api/sf-gate/sf_gate_client/filing_types/filing_types_client.go create mode 100644 api/sf-gate/sf_gate_client/filing_types/get_filing_types_parameters.go create mode 100644 api/sf-gate/sf_gate_client/filing_types/get_filing_types_responses.go create mode 100644 api/sf-gate/sf_gate_client/filing_types/post_filing_types_parameters.go create mode 100644 api/sf-gate/sf_gate_client/filing_types/post_filing_types_responses.go create mode 100644 api/sf-gate/sf_gate_client/filing_types/put_filing_types_parameters.go create mode 100644 api/sf-gate/sf_gate_client/filing_types/put_filing_types_responses.go create mode 100644 api/sf-gate/sf_gate_client/filings/filings_client.go create mode 100644 api/sf-gate/sf_gate_client/filings/get_filings_parameters.go create mode 100644 api/sf-gate/sf_gate_client/filings/get_filings_responses.go create mode 100644 api/sf-gate/sf_gate_client/filings/post_filings_parameters.go create mode 100644 api/sf-gate/sf_gate_client/filings/post_filings_responses.go create mode 100644 api/sf-gate/sf_gate_client/filings/put_filings_parameters.go create mode 100644 api/sf-gate/sf_gate_client/filings/put_filings_responses.go create mode 100644 api/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_responses.go create mode 100644 api/sf-gate/sf_gate_client/gl_accounts/gl_accounts_client.go create mode 100644 api/sf-gate/sf_gate_client/gl_balances/get_gl_balances_parameters.go create mode 100644 api/sf-gate/sf_gate_client/gl_balances/get_gl_balances_responses.go create mode 100644 api/sf-gate/sf_gate_client/gl_balances/gl_balances_client.go create mode 100644 api/sf-gate/sf_gate_client/ingests/get_ingests_parameters.go create mode 100644 api/sf-gate/sf_gate_client/ingests/get_ingests_responses.go create mode 100644 api/sf-gate/sf_gate_client/ingests/ingests_client.go create mode 100644 api/sf-gate/sf_gate_client/ingests/post_ingests_parameters.go create mode 100644 api/sf-gate/sf_gate_client/ingests/post_ingests_responses.go create mode 100644 api/sf-gate/sf_gate_client/ingests/put_ingests_parameters.go create mode 100644 api/sf-gate/sf_gate_client/ingests/put_ingests_responses.go create mode 100644 api/sf-gate/sf_gate_client/invoices/get_invoices_parameters.go create mode 100644 api/sf-gate/sf_gate_client/invoices/get_invoices_responses.go create mode 100644 api/sf-gate/sf_gate_client/invoices/invoices_client.go create mode 100644 api/sf-gate/sf_gate_client/invoices/post_invoices_parameters.go create mode 100644 api/sf-gate/sf_gate_client/invoices/post_invoices_responses.go create mode 100644 api/sf-gate/sf_gate_client/invoices/put_invoices_parameters.go create mode 100644 api/sf-gate/sf_gate_client/invoices/put_invoices_responses.go create mode 100644 api/sf-gate/sf_gate_client/jobs/get_jobs_parameters.go create mode 100644 api/sf-gate/sf_gate_client/jobs/get_jobs_responses.go create mode 100644 api/sf-gate/sf_gate_client/jobs/jobs_client.go create mode 100644 api/sf-gate/sf_gate_client/jobs/post_jobs_parameters.go create mode 100644 api/sf-gate/sf_gate_client/jobs/post_jobs_responses.go create mode 100644 api/sf-gate/sf_gate_client/jobs/put_jobs_parameters.go create mode 100644 api/sf-gate/sf_gate_client/jobs/put_jobs_responses.go create mode 100644 api/sf-gate/sf_gate_client/license_types/get_license_types_parameters.go create mode 100644 api/sf-gate/sf_gate_client/license_types/get_license_types_responses.go create mode 100644 api/sf-gate/sf_gate_client/license_types/license_types_client.go create mode 100644 api/sf-gate/sf_gate_client/licenses/get_licenses_parameters.go create mode 100644 api/sf-gate/sf_gate_client/licenses/get_licenses_responses.go create mode 100644 api/sf-gate/sf_gate_client/licenses/licenses_client.go create mode 100644 api/sf-gate/sf_gate_client/licenses/post_licenses_parameters.go create mode 100644 api/sf-gate/sf_gate_client/licenses/post_licenses_responses.go create mode 100644 api/sf-gate/sf_gate_client/licenses/put_licenses_parameters.go create mode 100644 api/sf-gate/sf_gate_client/licenses/put_licenses_responses.go create mode 100644 api/sf-gate/sf_gate_client/notebooks/get_notebooks_parameters.go create mode 100644 api/sf-gate/sf_gate_client/notebooks/get_notebooks_responses.go create mode 100644 api/sf-gate/sf_gate_client/notebooks/notebooks_client.go create mode 100644 api/sf-gate/sf_gate_client/notebooks/post_notebooks_parameters.go create mode 100644 api/sf-gate/sf_gate_client/notebooks/post_notebooks_responses.go create mode 100644 api/sf-gate/sf_gate_client/notebooks/put_notebooks_parameters.go create mode 100644 api/sf-gate/sf_gate_client/notebooks/put_notebooks_responses.go create mode 100644 api/sf-gate/sf_gate_client/orders/get_orders_parameters.go create mode 100644 api/sf-gate/sf_gate_client/orders/get_orders_responses.go create mode 100644 api/sf-gate/sf_gate_client/orders/orders_client.go create mode 100644 api/sf-gate/sf_gate_client/orders/post_orders_parameters.go create mode 100644 api/sf-gate/sf_gate_client/orders/post_orders_responses.go create mode 100644 api/sf-gate/sf_gate_client/orders/put_orders_parameters.go create mode 100644 api/sf-gate/sf_gate_client/orders/put_orders_responses.go create mode 100644 api/sf-gate/sf_gate_client/periods/get_periods_parameters.go create mode 100644 api/sf-gate/sf_gate_client/periods/get_periods_responses.go create mode 100644 api/sf-gate/sf_gate_client/periods/periods_client.go create mode 100644 api/sf-gate/sf_gate_client/places/get_places_parameters.go create mode 100644 api/sf-gate/sf_gate_client/places/get_places_responses.go create mode 100644 api/sf-gate/sf_gate_client/places/places_client.go create mode 100644 api/sf-gate/sf_gate_client/products/get_products_parameters.go create mode 100644 api/sf-gate/sf_gate_client/products/get_products_responses.go create mode 100644 api/sf-gate/sf_gate_client/products/products_client.go create mode 100644 api/sf-gate/sf_gate_client/purchase_orders/get_pos_parameters.go create mode 100644 api/sf-gate/sf_gate_client/purchase_orders/get_pos_responses.go create mode 100644 api/sf-gate/sf_gate_client/purchase_orders/post_pos_parameters.go create mode 100644 api/sf-gate/sf_gate_client/purchase_orders/post_pos_responses.go create mode 100644 api/sf-gate/sf_gate_client/purchase_orders/purchase_orders_client.go create mode 100644 api/sf-gate/sf_gate_client/purchase_orders/put_pos_parameters.go create mode 100644 api/sf-gate/sf_gate_client/purchase_orders/put_pos_responses.go create mode 100644 api/sf-gate/sf_gate_client/quotes/get_quotes_parameters.go create mode 100644 api/sf-gate/sf_gate_client/quotes/get_quotes_responses.go create mode 100644 api/sf-gate/sf_gate_client/quotes/post_quotes_parameters.go create mode 100644 api/sf-gate/sf_gate_client/quotes/post_quotes_responses.go create mode 100644 api/sf-gate/sf_gate_client/quotes/put_quotes_parameters.go create mode 100644 api/sf-gate/sf_gate_client/quotes/put_quotes_responses.go create mode 100644 api/sf-gate/sf_gate_client/quotes/quotes_client.go create mode 100644 api/sf-gate/sf_gate_client/roles/get_roles_parameters.go create mode 100644 api/sf-gate/sf_gate_client/roles/get_roles_responses.go create mode 100644 api/sf-gate/sf_gate_client/roles/roles_client.go create mode 100644 api/sf-gate/sf_gate_client/services/get_services_parameters.go create mode 100644 api/sf-gate/sf_gate_client/services/get_services_responses.go create mode 100644 api/sf-gate/sf_gate_client/services/post_services_parameters.go create mode 100644 api/sf-gate/sf_gate_client/services/post_services_responses.go create mode 100644 api/sf-gate/sf_gate_client/services/put_services_parameters.go create mode 100644 api/sf-gate/sf_gate_client/services/put_services_responses.go create mode 100644 api/sf-gate/sf_gate_client/services/services_client.go create mode 100644 api/sf-gate/sf_gate_client/sf_gate_client.go create mode 100644 api/sf-gate/sf_gate_client/statements/get_statements_parameters.go create mode 100644 api/sf-gate/sf_gate_client/statements/get_statements_responses.go create mode 100644 api/sf-gate/sf_gate_client/statements/post_statements_parameters.go create mode 100644 api/sf-gate/sf_gate_client/statements/post_statements_responses.go create mode 100644 api/sf-gate/sf_gate_client/statements/statements_client.go create mode 100644 api/sf-gate/sf_gate_client/states/get_states_parameters.go create mode 100644 api/sf-gate/sf_gate_client/states/get_states_responses.go create mode 100644 api/sf-gate/sf_gate_client/states/states_client.go create mode 100644 api/sf-gate/sf_gate_client/submissions/get_submissions_parameters.go create mode 100644 api/sf-gate/sf_gate_client/submissions/get_submissions_responses.go create mode 100644 api/sf-gate/sf_gate_client/submissions/post_submissions_parameters.go create mode 100644 api/sf-gate/sf_gate_client/submissions/post_submissions_responses.go create mode 100644 api/sf-gate/sf_gate_client/submissions/put_submissions_parameters.go create mode 100644 api/sf-gate/sf_gate_client/submissions/put_submissions_responses.go create mode 100644 api/sf-gate/sf_gate_client/submissions/submissions_client.go create mode 100644 api/sf-gate/sf_gate_client/subscriptions/get_subscriptions_parameters.go create mode 100644 api/sf-gate/sf_gate_client/subscriptions/get_subscriptions_responses.go create mode 100644 api/sf-gate/sf_gate_client/subscriptions/post_subscriptions_parameters.go create mode 100644 api/sf-gate/sf_gate_client/subscriptions/post_subscriptions_responses.go create mode 100644 api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_parameters.go create mode 100644 api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_responses.go create mode 100644 api/sf-gate/sf_gate_client/subscriptions/subscriptions_client.go create mode 100644 api/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_responses.go create mode 100644 api/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_responses.go create mode 100644 api/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_parameters.go create mode 100644 api/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_responses.go create mode 100644 api/sf-gate/sf_gate_client/tax_type_accounts/tax_type_accounts_client.go create mode 100644 api/sf-gate/sf_gate_client/tax_types/get_tax_types_parameters.go create mode 100644 api/sf-gate/sf_gate_client/tax_types/get_tax_types_responses.go create mode 100644 api/sf-gate/sf_gate_client/tax_types/tax_types_client.go create mode 100644 api/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_parameters.go create mode 100644 api/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_responses.go create mode 100644 api/sf-gate/sf_gate_client/taxnexus_codes/taxnexus_codes_client.go create mode 100644 api/sf-gate/sf_gate_client/templates/get_templates_parameters.go create mode 100644 api/sf-gate/sf_gate_client/templates/get_templates_responses.go create mode 100644 api/sf-gate/sf_gate_client/templates/templates_client.go create mode 100644 api/sf-gate/sf_gate_client/tenants/get_tenants_parameters.go create mode 100644 api/sf-gate/sf_gate_client/tenants/get_tenants_responses.go create mode 100644 api/sf-gate/sf_gate_client/tenants/put_tenants_parameters.go create mode 100644 api/sf-gate/sf_gate_client/tenants/put_tenants_responses.go create mode 100644 api/sf-gate/sf_gate_client/tenants/tenants_client.go create mode 100644 api/sf-gate/sf_gate_client/tenants/tenants_parameters.go create mode 100644 api/sf-gate/sf_gate_client/tenants/tenants_responses.go create mode 100644 api/sf-gate/sf_gate_client/users/get_users_parameters.go create mode 100644 api/sf-gate/sf_gate_client/users/get_users_responses.go create mode 100644 api/sf-gate/sf_gate_client/users/users_client.go create mode 100644 api/sf-gate/sf_gate_models/account.go create mode 100644 api/sf-gate/sf_gate_models/account_request.go create mode 100644 api/sf-gate/sf_gate_models/account_response.go create mode 100644 api/sf-gate/sf_gate_models/accounting_rule.go create mode 100644 api/sf-gate/sf_gate_models/accounting_rule_request.go create mode 100644 api/sf-gate/sf_gate_models/accounting_rule_response.go create mode 100644 api/sf-gate/sf_gate_models/accounting_ruleset.go create mode 100644 api/sf-gate/sf_gate_models/accounting_ruleset_item.go create mode 100644 api/sf-gate/sf_gate_models/accounting_ruleset_request.go create mode 100644 api/sf-gate/sf_gate_models/accounting_ruleset_response.go create mode 100644 api/sf-gate/sf_gate_models/address.go create mode 100644 api/sf-gate/sf_gate_models/authority.go create mode 100644 api/sf-gate/sf_gate_models/authority_request.go create mode 100644 api/sf-gate/sf_gate_models/authority_response.go create mode 100644 api/sf-gate/sf_gate_models/backend.go create mode 100644 api/sf-gate/sf_gate_models/backend_request.go create mode 100644 api/sf-gate/sf_gate_models/backend_response.go create mode 100644 api/sf-gate/sf_gate_models/cash_receipt.go create mode 100644 api/sf-gate/sf_gate_models/cash_receipt_request.go create mode 100644 api/sf-gate/sf_gate_models/cash_receipt_response.go create mode 100644 api/sf-gate/sf_gate_models/cluster.go create mode 100644 api/sf-gate/sf_gate_models/cluster_request.go create mode 100644 api/sf-gate/sf_gate_models/cluster_response.go create mode 100644 api/sf-gate/sf_gate_models/company.go create mode 100644 api/sf-gate/sf_gate_models/company_response.go create mode 100644 api/sf-gate/sf_gate_models/contact.go create mode 100644 api/sf-gate/sf_gate_models/contact_request.go create mode 100644 api/sf-gate/sf_gate_models/contact_response.go create mode 100644 api/sf-gate/sf_gate_models/contract_basic.go create mode 100644 api/sf-gate/sf_gate_models/country.go create mode 100644 api/sf-gate/sf_gate_models/country_response.go create mode 100644 api/sf-gate/sf_gate_models/county.go create mode 100644 api/sf-gate/sf_gate_models/county_response.go create mode 100644 api/sf-gate/sf_gate_models/credit_card.go create mode 100644 api/sf-gate/sf_gate_models/database.go create mode 100644 api/sf-gate/sf_gate_models/database_request.go create mode 100644 api/sf-gate/sf_gate_models/database_response.go create mode 100644 api/sf-gate/sf_gate_models/domain.go create mode 100644 api/sf-gate/sf_gate_models/domain_response.go create mode 100644 api/sf-gate/sf_gate_models/error.go create mode 100644 api/sf-gate/sf_gate_models/filing.go create mode 100644 api/sf-gate/sf_gate_models/filing_due_date.go create mode 100644 api/sf-gate/sf_gate_models/filing_request.go create mode 100644 api/sf-gate/sf_gate_models/filing_response.go create mode 100644 api/sf-gate/sf_gate_models/filing_type.go create mode 100644 api/sf-gate/sf_gate_models/filing_type_instance.go create mode 100644 api/sf-gate/sf_gate_models/filing_type_request.go create mode 100644 api/sf-gate/sf_gate_models/filing_type_response.go create mode 100644 api/sf-gate/sf_gate_models/geo_license_type_instance.go create mode 100644 api/sf-gate/sf_gate_models/gl_account.go create mode 100644 api/sf-gate/sf_gate_models/gl_account_request.go create mode 100644 api/sf-gate/sf_gate_models/gl_account_response.go create mode 100644 api/sf-gate/sf_gate_models/gl_balance.go create mode 100644 api/sf-gate/sf_gate_models/gl_balance_response.go create mode 100644 api/sf-gate/sf_gate_models/ids.go create mode 100644 api/sf-gate/sf_gate_models/ids_request.go create mode 100644 api/sf-gate/sf_gate_models/ingest.go create mode 100644 api/sf-gate/sf_gate_models/ingest_request.go create mode 100644 api/sf-gate/sf_gate_models/ingest_response.go create mode 100644 api/sf-gate/sf_gate_models/invalid_error.go create mode 100644 api/sf-gate/sf_gate_models/invoice.go create mode 100644 api/sf-gate/sf_gate_models/invoice_basic.go create mode 100644 api/sf-gate/sf_gate_models/invoice_item.go create mode 100644 api/sf-gate/sf_gate_models/invoice_request.go create mode 100644 api/sf-gate/sf_gate_models/invoice_response.go create mode 100644 api/sf-gate/sf_gate_models/item_basic.go create mode 100644 api/sf-gate/sf_gate_models/job.go create mode 100644 api/sf-gate/sf_gate_models/job_request.go create mode 100644 api/sf-gate/sf_gate_models/job_response.go create mode 100644 api/sf-gate/sf_gate_models/license.go create mode 100644 api/sf-gate/sf_gate_models/license_request.go create mode 100644 api/sf-gate/sf_gate_models/license_response.go create mode 100644 api/sf-gate/sf_gate_models/license_type.go create mode 100644 api/sf-gate/sf_gate_models/license_type_response.go create mode 100644 api/sf-gate/sf_gate_models/message.go create mode 100644 api/sf-gate/sf_gate_models/notebook.go create mode 100644 api/sf-gate/sf_gate_models/notebook_item.go create mode 100644 api/sf-gate/sf_gate_models/notebook_request.go create mode 100644 api/sf-gate/sf_gate_models/notebook_response.go create mode 100644 api/sf-gate/sf_gate_models/order.go create mode 100644 api/sf-gate/sf_gate_models/order_basic.go create mode 100644 api/sf-gate/sf_gate_models/order_basic_request.go create mode 100644 api/sf-gate/sf_gate_models/order_item.go create mode 100644 api/sf-gate/sf_gate_models/order_response.go create mode 100644 api/sf-gate/sf_gate_models/pagination.go create mode 100644 api/sf-gate/sf_gate_models/period.go create mode 100644 api/sf-gate/sf_gate_models/period_request.go create mode 100644 api/sf-gate/sf_gate_models/period_response.go create mode 100644 api/sf-gate/sf_gate_models/place.go create mode 100644 api/sf-gate/sf_gate_models/place_response.go create mode 100644 api/sf-gate/sf_gate_models/pricebook.go create mode 100644 api/sf-gate/sf_gate_models/pricebook_entry.go create mode 100644 api/sf-gate/sf_gate_models/product.go create mode 100644 api/sf-gate/sf_gate_models/product_request.go create mode 100644 api/sf-gate/sf_gate_models/product_response.go create mode 100644 api/sf-gate/sf_gate_models/purchase_order.go create mode 100644 api/sf-gate/sf_gate_models/purchase_order_basic.go create mode 100644 api/sf-gate/sf_gate_models/purchase_order_item.go create mode 100644 api/sf-gate/sf_gate_models/purchase_order_request.go create mode 100644 api/sf-gate/sf_gate_models/purchase_order_response.go create mode 100644 api/sf-gate/sf_gate_models/quote.go create mode 100644 api/sf-gate/sf_gate_models/quote_basic.go create mode 100644 api/sf-gate/sf_gate_models/quote_item.go create mode 100644 api/sf-gate/sf_gate_models/quote_item_basic.go create mode 100644 api/sf-gate/sf_gate_models/quote_response.go create mode 100644 api/sf-gate/sf_gate_models/request_meta.go create mode 100644 api/sf-gate/sf_gate_models/response_meta.go create mode 100644 api/sf-gate/sf_gate_models/role.go create mode 100644 api/sf-gate/sf_gate_models/role_request.go create mode 100644 api/sf-gate/sf_gate_models/role_response.go create mode 100644 api/sf-gate/sf_gate_models/service.go create mode 100644 api/sf-gate/sf_gate_models/service_request.go create mode 100644 api/sf-gate/sf_gate_models/service_response.go create mode 100644 api/sf-gate/sf_gate_models/state.go create mode 100644 api/sf-gate/sf_gate_models/state_response.go create mode 100644 api/sf-gate/sf_gate_models/statement.go create mode 100644 api/sf-gate/sf_gate_models/statement_request.go create mode 100644 api/sf-gate/sf_gate_models/statement_response.go create mode 100644 api/sf-gate/sf_gate_models/submission.go create mode 100644 api/sf-gate/sf_gate_models/submission_request.go create mode 100644 api/sf-gate/sf_gate_models/submission_response.go create mode 100644 api/sf-gate/sf_gate_models/subscription.go create mode 100644 api/sf-gate/sf_gate_models/subscription_request.go create mode 100644 api/sf-gate/sf_gate_models/subscription_response.go create mode 100644 api/sf-gate/sf_gate_models/tax_instance.go create mode 100644 api/sf-gate/sf_gate_models/tax_invoices_request.go create mode 100644 api/sf-gate/sf_gate_models/tax_orders_request.go create mode 100644 api/sf-gate/sf_gate_models/tax_purchase_orders_request.go create mode 100644 api/sf-gate/sf_gate_models/tax_quotes_request.go create mode 100644 api/sf-gate/sf_gate_models/tax_transaction.go create mode 100644 api/sf-gate/sf_gate_models/tax_transaction_response.go create mode 100644 api/sf-gate/sf_gate_models/tax_type.go create mode 100644 api/sf-gate/sf_gate_models/tax_type_account.go create mode 100644 api/sf-gate/sf_gate_models/tax_type_account_request.go create mode 100644 api/sf-gate/sf_gate_models/tax_type_account_response.go create mode 100644 api/sf-gate/sf_gate_models/tax_type_response.go create mode 100644 api/sf-gate/sf_gate_models/taxnexus_code.go create mode 100644 api/sf-gate/sf_gate_models/taxnexus_code_response.go create mode 100644 api/sf-gate/sf_gate_models/template.go create mode 100644 api/sf-gate/sf_gate_models/template_response.go create mode 100644 api/sf-gate/sf_gate_models/tenant.go create mode 100644 api/sf-gate/sf_gate_models/tenant_request.go create mode 100644 api/sf-gate/sf_gate_models/tenant_response.go create mode 100644 api/sf-gate/sf_gate_models/tenant_user.go create mode 100644 api/sf-gate/sf_gate_models/user.go create mode 100644 api/sf-gate/sf_gate_models/user_response.go create mode 100644 api/sf-gate/sf_gate_models/user_role.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/vendor-gw/vendor_gw_client/accounts/accounts_client.go create mode 100644 api/vendor-gw/vendor_gw_client/accounts/get_accounts_parameters.go create mode 100644 api/vendor-gw/vendor_gw_client/accounts/get_accounts_responses.go create mode 100644 api/vendor-gw/vendor_gw_client/invoices/get_invoices_parameters.go create mode 100644 api/vendor-gw/vendor_gw_client/invoices/get_invoices_responses.go create mode 100644 api/vendor-gw/vendor_gw_client/invoices/invoices_client.go create mode 100644 api/vendor-gw/vendor_gw_client/purchase_orders/get_pos_parameters.go create mode 100644 api/vendor-gw/vendor_gw_client/purchase_orders/get_pos_responses.go create mode 100644 api/vendor-gw/vendor_gw_client/purchase_orders/purchase_orders_client.go create mode 100644 api/vendor-gw/vendor_gw_client/vendor_gw_client.go create mode 100644 api/vendor-gw/vendor_gw_models/account_basic.go create mode 100644 api/vendor-gw/vendor_gw_models/account_response.go create mode 100644 api/vendor-gw/vendor_gw_models/address.go create mode 100644 api/vendor-gw/vendor_gw_models/contact_basic.go create mode 100644 api/vendor-gw/vendor_gw_models/error.go create mode 100644 api/vendor-gw/vendor_gw_models/invalid_error.go create mode 100644 api/vendor-gw/vendor_gw_models/invoice_basic.go create mode 100644 api/vendor-gw/vendor_gw_models/invoice_response.go create mode 100644 api/vendor-gw/vendor_gw_models/item_basic.go create mode 100644 api/vendor-gw/vendor_gw_models/license_basic.go create mode 100644 api/vendor-gw/vendor_gw_models/pagination.go create mode 100644 api/vendor-gw/vendor_gw_models/purchase_order_basic.go create mode 100644 api/vendor-gw/vendor_gw_models/purchase_order_response.go create mode 100644 api/vendor-gw/vendor_gw_models/response_meta.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 build/COPYRIGHT create mode 100644 build/Dockerfile create mode 100644 go.sum diff --git a/Makefile b/Makefile index 5abff95..47b1680 100644 --- a/Makefile +++ b/Makefile @@ -5,104 +5,235 @@ swagger: # generate auth # rm -rf ./api - mkdir -p api/v0.0.1/auth + mkdir -p api/auth swagger generate client \ --log-output=./swagger/logs/generate-auth-client.log \ --copyright-file=./build/COPYRIGHT \ --name=auth \ --spec=./swagger/auth-taxnexus.yaml \ - --target=./api/v0.0.1/auth \ + --target=./api/auth \ --client-package=auth-client \ --model-package=auth-models \ --principal=app.User # + # generate auth0 + # + rm -rf ./api + mkdir -p api/auth0 + swagger generate client \ + --log-output=./swagger/logs/generate-auth0-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=auth0 \ + --spec=./swagger/auth0.yaml \ + --target=./api/auth0 \ + --client-package=auth0-client \ + --model-package=auth0-models \ + --principal=app.User + # + # generate blaze + # + mkdir api/blaze + swagger generate client \ + --log-output=./swagger/logs/generate-blaze-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=blaze \ + --spec=./swagger/blaze-taxnexus.yaml \ + --target=./api/blaze \ + --client-package=blaze-client \ + --model-package=blaze-models \ + --principal=app.User + # # generate crm # - mkdir api/v0.0.1/crm + mkdir api/crm swagger generate client \ --log-output=./swagger/logs/generate-crm-client.log \ --copyright-file=./build/COPYRIGHT \ --name=crm \ --spec=./swagger/crm-taxnexus.yaml \ - --target=./api/v0.0.1/crm \ + --target=./api/crm \ --client-package=crm-client \ --model-package=crm-models \ --principal=app.User # # generate devops # - mkdir api/v0.0.1/devops + mkdir api/devops swagger generate client \ --log-output=./swagger/logs/generate-devops-client.log \ --copyright-file=./build/COPYRIGHT \ --name=devops \ --spec=./swagger/devops-taxnexus.yaml \ - --target=./api/v0.0.1/devops \ + --target=./api/devops \ --client-package=devops-client \ --model-package=devops-models \ --principal=app.User # # generate geo # - mkdir api/v0.0.1/geo + mkdir api/geo swagger generate client \ --log-output=./swagger/logs/generate-geo-client.log \ --copyright-file=./build/COPYRIGHT \ --name=geo \ --spec=./swagger/geo-taxnexus.yaml \ - --target=./api/v0.0.1/geo \ + --target=./api/geo \ --client-package=geo-client \ --model-package=geo-models \ --principal=app.User # + # generate gov-gw + # + mkdir api/gov-gw + swagger generate client \ + --log-output=./swagger/logs/generate-gov-gw-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=gov-gw \ + --spec=./swagger/gov-gw-taxnexus.yaml \ + --target=./api/gov-gw \ + --client-package=gov-gw-client \ + --model-package=gov-gw-models \ + --principal=app.User + # # generate ledger # - mkdir api/v0.0.1/ledger + mkdir api/ledger swagger generate client \ --log-output=./swagger/logs/generate-ledger-client.log \ --copyright-file=./build/COPYRIGHT \ --name=ledger \ --spec=./swagger/ledger-taxnexus.yaml \ - --target=./api/v0.0.1/ledger \ + --target=./api/ledger \ --client-package=ledger-client \ --model-package=ledger-models \ --principal=app.User # + # generate metrc-gw + # + mkdir api/metrc-gw + swagger generate client \ + --log-output=./swagger/logs/generate-metrc-gw-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=metrc-gw \ + --spec=./swagger/metrc-gw-taxnexus.yaml \ + --target=./api/metrc-gw \ + --client-package=metrc-gw-client \ + --model-package=metrc-gw-models \ + --principal=app.User + # # generate ops # - mkdir api/v0.0.1/ops + mkdir api/ops swagger generate client \ --log-output=./swagger/logs/generate-ops-client.log \ --copyright-file=./build/COPYRIGHT \ --name=ops \ --spec=./swagger/ops-taxnexus.yaml \ - --target=./api/v0.0.1/ops \ + --target=./api/ops \ --client-package=ops-client \ --model-package=ops-models \ --principal=app.User # + # generate pdf + # + mkdir api/pdf + swagger generate client \ + --log-output=./swagger/logs/generate-pdf-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=pdf \ + --spec=./swagger/pdf-taxnexus.yaml \ + --target=./api/pdf \ + --client-package=pdf-client \ + --model-package=pdf-models \ + --principal=app.User + # + # generate plex + # + mkdir api/plex + swagger generate client \ + --log-output=./swagger/logs/generate-plex-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=plex \ + --spec=./swagger/plex-taxnexus.yaml \ + --target=./api/plex \ + --client-package=plex-client \ + --model-package=plex-models \ + --principal=app.User + # # generate regs # - mkdir api/v0.0.1/regs + mkdir api/regs swagger generate client \ --log-output=./swagger/logs/generate-regs-client.log \ --copyright-file=./build/COPYRIGHT \ --name=regs \ --spec=./swagger/regs-taxnexus.yaml \ - --target=./api/v0.0.1/regs \ + --target=./api/regs \ --client-package=regs-client \ --model-package=regs-models \ --principal=app.User # + # generate render + # + mkdir api/render + swagger generate client \ + --log-output=./swagger/logs/generate-render-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=render \ + --spec=./swagger/render-taxnexus.yaml \ + --target=./api/render \ + --client-package=render-client \ + --model-package=render-models \ + --principal=app.User + # + # generate sf-gate + # + mkdir api/sf-gate + swagger generate client \ + --log-output=./swagger/logs/generate-sf-gate-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=sf-gate \ + --spec=./swagger/sf-gate-taxnexus.yaml \ + --target=./api/sf-gate \ + --client-package=sf-gate-client \ + --model-package=sf-gate-models \ + --principal=app.User + # + # generate stash + # + mkdir api/stash + swagger generate client \ + --log-output=./swagger/logs/generate-stash-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=stash \ + --spec=./swagger/stash-taxnexus.yaml \ + --target=./api/stash \ + --client-package=stash-client \ + --model-package=stash-models \ + --principal=app.User + # + # generate vendor-gw + # + mkdir api/vendor-gw + swagger generate client \ + --log-output=./swagger/logs/generate-vendor-gw-client.log \ + --copyright-file=./build/COPYRIGHT \ + --name=vendor-gw \ + --spec=./swagger/vendor-gw-taxnexus.yaml \ + --target=./api/vendor-gw \ + --client-package=vendor-gw-client \ + --model-package=vendor-gw-models \ + --principal=app.User + # # generate workflow # - mkdir api/v0.0.1/workflow + mkdir api/workflow swagger generate client \ --log-output=./swagger/logs/generate-workflow-client.log \ --copyright-file=./build/COPYRIGHT \ --name=workflow \ --spec=./swagger/workflow-taxnexus.yaml \ - --target=./api/v0.0.1/workflow \ + --target=./api/workflow \ --client-package=workflow-client \ --model-package=workflow-models \ --principal=app.User diff --git a/api/auth0/auth0_client/auth/auth_client.go b/api/auth0/auth0_client/auth/auth_client.go new file mode 100644 index 0000000..51a76eb --- /dev/null +++ b/api/auth0/auth0_client/auth/auth_client.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth + +// 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 auth API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for auth API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + PostCredentials(params *PostCredentialsParams) (*PostCredentialsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PostCredentials posts to oauth token + + Get credential token +*/ +func (a *Client) PostCredentials(params *PostCredentialsParams) (*PostCredentialsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCredentialsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCredentials", + Method: "POST", + PathPattern: "/oauth/token", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PostCredentialsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCredentialsOK) + 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 postCredentials: 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/auth0/auth0_client/auth/post_credentials_parameters.go b/api/auth0/auth0_client/auth/post_credentials_parameters.go new file mode 100644 index 0000000..aa62824 --- /dev/null +++ b/api/auth0/auth0_client/auth/post_credentials_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth + +// 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/taxnexus/go/lib/api/auth0/auth0_models" +) + +// NewPostCredentialsParams creates a new PostCredentialsParams object +// with the default values initialized. +func NewPostCredentialsParams() *PostCredentialsParams { + var () + return &PostCredentialsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCredentialsParamsWithTimeout creates a new PostCredentialsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCredentialsParamsWithTimeout(timeout time.Duration) *PostCredentialsParams { + var () + return &PostCredentialsParams{ + + timeout: timeout, + } +} + +// NewPostCredentialsParamsWithContext creates a new PostCredentialsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCredentialsParamsWithContext(ctx context.Context) *PostCredentialsParams { + var () + return &PostCredentialsParams{ + + Context: ctx, + } +} + +// NewPostCredentialsParamsWithHTTPClient creates a new PostCredentialsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCredentialsParamsWithHTTPClient(client *http.Client) *PostCredentialsParams { + var () + return &PostCredentialsParams{ + HTTPClient: client, + } +} + +/*PostCredentialsParams contains all the parameters to send to the API endpoint +for the post credentials operation typically these are written to a http.Request +*/ +type PostCredentialsParams struct { + + /*CredentialsRequest + Get Authentation Token + + */ + CredentialsRequest *auth0_models.CredentialsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post credentials params +func (o *PostCredentialsParams) WithTimeout(timeout time.Duration) *PostCredentialsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post credentials params +func (o *PostCredentialsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post credentials params +func (o *PostCredentialsParams) WithContext(ctx context.Context) *PostCredentialsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post credentials params +func (o *PostCredentialsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post credentials params +func (o *PostCredentialsParams) WithHTTPClient(client *http.Client) *PostCredentialsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post credentials params +func (o *PostCredentialsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCredentialsRequest adds the credentialsRequest to the post credentials params +func (o *PostCredentialsParams) WithCredentialsRequest(credentialsRequest *auth0_models.CredentialsRequest) *PostCredentialsParams { + o.SetCredentialsRequest(credentialsRequest) + return o +} + +// SetCredentialsRequest adds the credentialsRequest to the post credentials params +func (o *PostCredentialsParams) SetCredentialsRequest(credentialsRequest *auth0_models.CredentialsRequest) { + o.CredentialsRequest = credentialsRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CredentialsRequest != nil { + if err := r.SetBodyParam(o.CredentialsRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/auth0/auth0_client/auth/post_credentials_responses.go b/api/auth0/auth0_client/auth/post_credentials_responses.go new file mode 100644 index 0000000..f857973 --- /dev/null +++ b/api/auth0/auth0_client/auth/post_credentials_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth + +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_models" +) + +// PostCredentialsReader is a Reader for the PostCredentials structure. +type PostCredentialsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCredentialsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCredentialsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCredentialsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCredentialsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostCredentialsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCredentialsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostCredentialsOK creates a PostCredentialsOK with default headers values +func NewPostCredentialsOK() *PostCredentialsOK { + return &PostCredentialsOK{} +} + +/*PostCredentialsOK handles this case with default header values. + +Credentials response from Auth0 +*/ +type PostCredentialsOK struct { + Payload *auth0_models.CredentialsResponse +} + +func (o *PostCredentialsOK) Error() string { + return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsOK %+v", 200, o.Payload) +} + +func (o *PostCredentialsOK) GetPayload() *auth0_models.CredentialsResponse { + return o.Payload +} + +func (o *PostCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.CredentialsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCredentialsUnauthorized creates a PostCredentialsUnauthorized with default headers values +func NewPostCredentialsUnauthorized() *PostCredentialsUnauthorized { + return &PostCredentialsUnauthorized{} +} + +/*PostCredentialsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostCredentialsUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *PostCredentialsUnauthorized) Error() string { + return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCredentialsUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostCredentialsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCredentialsForbidden creates a PostCredentialsForbidden with default headers values +func NewPostCredentialsForbidden() *PostCredentialsForbidden { + return &PostCredentialsForbidden{} +} + +/*PostCredentialsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostCredentialsForbidden struct { + Payload *auth0_models.Error +} + +func (o *PostCredentialsForbidden) Error() string { + return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsForbidden %+v", 403, o.Payload) +} + +func (o *PostCredentialsForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostCredentialsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCredentialsNotFound creates a PostCredentialsNotFound with default headers values +func NewPostCredentialsNotFound() *PostCredentialsNotFound { + return &PostCredentialsNotFound{} +} + +/*PostCredentialsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostCredentialsNotFound struct { + Payload *auth0_models.Error +} + +func (o *PostCredentialsNotFound) Error() string { + return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsNotFound %+v", 404, o.Payload) +} + +func (o *PostCredentialsNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostCredentialsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCredentialsUnprocessableEntity creates a PostCredentialsUnprocessableEntity with default headers values +func NewPostCredentialsUnprocessableEntity() *PostCredentialsUnprocessableEntity { + return &PostCredentialsUnprocessableEntity{} +} + +/*PostCredentialsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostCredentialsUnprocessableEntity struct { + Payload *auth0_models.Error +} + +func (o *PostCredentialsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostCredentialsUnprocessableEntity) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostCredentialsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCredentialsInternalServerError creates a PostCredentialsInternalServerError with default headers values +func NewPostCredentialsInternalServerError() *PostCredentialsInternalServerError { + return &PostCredentialsInternalServerError{} +} + +/*PostCredentialsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostCredentialsInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *PostCredentialsInternalServerError) Error() string { + return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCredentialsInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostCredentialsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/auth0_client.go b/api/auth0/auth0_client/auth0_client.go new file mode 100644 index 0000000..437ea29 --- /dev/null +++ b/api/auth0/auth0_client/auth0_client.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_client/auth" + "github.com/taxnexus/go/lib/api/auth0/auth0_client/role" + "github.com/taxnexus/go/lib/api/auth0/auth0_client/user" +) + +// Default auth0 HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "taxnexus.auth0.com" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"https"} + +// NewHTTPClient creates a new auth0 HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Auth0 { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new auth0 HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Auth0 { + // 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 auth0 client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Auth0 { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Auth0) + cli.Transport = transport + cli.Auth = auth.New(transport, formats) + cli.Role = role.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 +} + +// Auth0 is a client for auth0 +type Auth0 struct { + Auth auth.ClientService + + Role role.ClientService + + User user.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Auth0) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Auth.SetTransport(transport) + c.Role.SetTransport(transport) + c.User.SetTransport(transport) +} diff --git a/api/auth0/auth0_client/role/get_roles_parameters.go b/api/auth0/auth0_client/role/get_roles_parameters.go new file mode 100644 index 0000000..ccd2364 --- /dev/null +++ b/api/auth0/auth0_client/role/get_roles_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package role + +// 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" +) + +// NewGetRolesParams creates a new GetRolesParams object +// with the default values initialized. +func NewGetRolesParams() *GetRolesParams { + var () + return &GetRolesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRolesParamsWithTimeout creates a new GetRolesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRolesParamsWithTimeout(timeout time.Duration) *GetRolesParams { + var () + return &GetRolesParams{ + + timeout: timeout, + } +} + +// NewGetRolesParamsWithContext creates a new GetRolesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRolesParamsWithContext(ctx context.Context) *GetRolesParams { + var () + return &GetRolesParams{ + + Context: ctx, + } +} + +// NewGetRolesParamsWithHTTPClient creates a new GetRolesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRolesParamsWithHTTPClient(client *http.Client) *GetRolesParams { + var () + return &GetRolesParams{ + HTTPClient: client, + } +} + +/*GetRolesParams contains all the parameters to send to the API endpoint +for the get roles operation typically these are written to a http.Request +*/ +type GetRolesParams struct { + + /*Authorization*/ + Authorization string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get roles params +func (o *GetRolesParams) WithTimeout(timeout time.Duration) *GetRolesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get roles params +func (o *GetRolesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get roles params +func (o *GetRolesParams) WithContext(ctx context.Context) *GetRolesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get roles params +func (o *GetRolesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get roles params +func (o *GetRolesParams) WithHTTPClient(client *http.Client) *GetRolesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get roles params +func (o *GetRolesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorization adds the authorization to the get roles params +func (o *GetRolesParams) WithAuthorization(authorization string) *GetRolesParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the get roles params +func (o *GetRolesParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/auth0/auth0_client/role/get_roles_responses.go b/api/auth0/auth0_client/role/get_roles_responses.go new file mode 100644 index 0000000..1b16d79 --- /dev/null +++ b/api/auth0/auth0_client/role/get_roles_responses.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package role + +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_models" +) + +// GetRolesReader is a Reader for the GetRoles structure. +type GetRolesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRolesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRolesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRolesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRolesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRolesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRolesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRolesOK creates a GetRolesOK with default headers values +func NewGetRolesOK() *GetRolesOK { + return &GetRolesOK{} +} + +/*GetRolesOK handles this case with default header values. + +Taxnexus Response with User objects +*/ +type GetRolesOK struct { + Payload []*auth0_models.User +} + +func (o *GetRolesOK) Error() string { + return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesOK %+v", 200, o.Payload) +} + +func (o *GetRolesOK) GetPayload() []*auth0_models.User { + return o.Payload +} + +func (o *GetRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesUnauthorized creates a GetRolesUnauthorized with default headers values +func NewGetRolesUnauthorized() *GetRolesUnauthorized { + return &GetRolesUnauthorized{} +} + +/*GetRolesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetRolesUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *GetRolesUnauthorized) Error() string { + return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRolesUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetRolesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesForbidden creates a GetRolesForbidden with default headers values +func NewGetRolesForbidden() *GetRolesForbidden { + return &GetRolesForbidden{} +} + +/*GetRolesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRolesForbidden struct { + Payload *auth0_models.Error +} + +func (o *GetRolesForbidden) Error() string { + return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesForbidden %+v", 403, o.Payload) +} + +func (o *GetRolesForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesNotFound creates a GetRolesNotFound with default headers values +func NewGetRolesNotFound() *GetRolesNotFound { + return &GetRolesNotFound{} +} + +/*GetRolesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRolesNotFound struct { + Payload *auth0_models.Error +} + +func (o *GetRolesNotFound) Error() string { + return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesNotFound %+v", 404, o.Payload) +} + +func (o *GetRolesNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetRolesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesUnprocessableEntity creates a GetRolesUnprocessableEntity with default headers values +func NewGetRolesUnprocessableEntity() *GetRolesUnprocessableEntity { + return &GetRolesUnprocessableEntity{} +} + +/*GetRolesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRolesUnprocessableEntity struct { + Payload *auth0_models.Error +} + +func (o *GetRolesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRolesUnprocessableEntity) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetRolesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesInternalServerError creates a GetRolesInternalServerError with default headers values +func NewGetRolesInternalServerError() *GetRolesInternalServerError { + return &GetRolesInternalServerError{} +} + +/*GetRolesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRolesInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *GetRolesInternalServerError) Error() string { + return fmt.Sprintf("[GET /api/v2/roles][%d] getRolesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRolesInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/role/post_role_users_parameters.go b/api/auth0/auth0_client/role/post_role_users_parameters.go new file mode 100644 index 0000000..8d0c5c0 --- /dev/null +++ b/api/auth0/auth0_client/role/post_role_users_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package role + +// 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/taxnexus/go/lib/api/auth0/auth0_models" +) + +// NewPostRoleUsersParams creates a new PostRoleUsersParams object +// with the default values initialized. +func NewPostRoleUsersParams() *PostRoleUsersParams { + var () + return &PostRoleUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostRoleUsersParamsWithTimeout creates a new PostRoleUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostRoleUsersParamsWithTimeout(timeout time.Duration) *PostRoleUsersParams { + var () + return &PostRoleUsersParams{ + + timeout: timeout, + } +} + +// NewPostRoleUsersParamsWithContext creates a new PostRoleUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostRoleUsersParamsWithContext(ctx context.Context) *PostRoleUsersParams { + var () + return &PostRoleUsersParams{ + + Context: ctx, + } +} + +// NewPostRoleUsersParamsWithHTTPClient creates a new PostRoleUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostRoleUsersParamsWithHTTPClient(client *http.Client) *PostRoleUsersParams { + var () + return &PostRoleUsersParams{ + HTTPClient: client, + } +} + +/*PostRoleUsersParams contains all the parameters to send to the API endpoint +for the post role users operation typically these are written to a http.Request +*/ +type PostRoleUsersParams struct { + + /*Authorization*/ + Authorization string + /*RoleUsersRequest + An array of User IDs to add to a Role + + */ + RoleUsersRequest *auth0_models.RoleUsersRequest + /*RoleID + An Auth0 Role ID + + */ + RoleID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post role users params +func (o *PostRoleUsersParams) WithTimeout(timeout time.Duration) *PostRoleUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post role users params +func (o *PostRoleUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post role users params +func (o *PostRoleUsersParams) WithContext(ctx context.Context) *PostRoleUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post role users params +func (o *PostRoleUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post role users params +func (o *PostRoleUsersParams) WithHTTPClient(client *http.Client) *PostRoleUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post role users params +func (o *PostRoleUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorization adds the authorization to the post role users params +func (o *PostRoleUsersParams) WithAuthorization(authorization string) *PostRoleUsersParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the post role users params +func (o *PostRoleUsersParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WithRoleUsersRequest adds the roleUsersRequest to the post role users params +func (o *PostRoleUsersParams) WithRoleUsersRequest(roleUsersRequest *auth0_models.RoleUsersRequest) *PostRoleUsersParams { + o.SetRoleUsersRequest(roleUsersRequest) + return o +} + +// SetRoleUsersRequest adds the roleUsersRequest to the post role users params +func (o *PostRoleUsersParams) SetRoleUsersRequest(roleUsersRequest *auth0_models.RoleUsersRequest) { + o.RoleUsersRequest = roleUsersRequest +} + +// WithRoleID adds the roleID to the post role users params +func (o *PostRoleUsersParams) WithRoleID(roleID string) *PostRoleUsersParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the post role users params +func (o *PostRoleUsersParams) SetRoleID(roleID string) { + o.RoleID = roleID +} + +// WriteToRequest writes these params to a swagger request +func (o *PostRoleUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + if o.RoleUsersRequest != nil { + if err := r.SetBodyParam(o.RoleUsersRequest); err != nil { + return err + } + } + + // path param roleId + if err := r.SetPathParam("roleId", o.RoleID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/auth0/auth0_client/role/post_role_users_responses.go b/api/auth0/auth0_client/role/post_role_users_responses.go new file mode 100644 index 0000000..60ffd0d --- /dev/null +++ b/api/auth0/auth0_client/role/post_role_users_responses.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package role + +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_models" +) + +// PostRoleUsersReader is a Reader for the PostRoleUsers structure. +type PostRoleUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostRoleUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostRoleUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostRoleUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostRoleUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostRoleUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostRoleUsersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostRoleUsersOK creates a PostRoleUsersOK with default headers values +func NewPostRoleUsersOK() *PostRoleUsersOK { + return &PostRoleUsersOK{} +} + +/*PostRoleUsersOK handles this case with default header values. + +Role users successfully updated +*/ +type PostRoleUsersOK struct { +} + +func (o *PostRoleUsersOK) Error() string { + return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersOK ", 200) +} + +func (o *PostRoleUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPostRoleUsersUnauthorized creates a PostRoleUsersUnauthorized with default headers values +func NewPostRoleUsersUnauthorized() *PostRoleUsersUnauthorized { + return &PostRoleUsersUnauthorized{} +} + +/*PostRoleUsersUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostRoleUsersUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *PostRoleUsersUnauthorized) Error() string { + return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostRoleUsersUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostRoleUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRoleUsersForbidden creates a PostRoleUsersForbidden with default headers values +func NewPostRoleUsersForbidden() *PostRoleUsersForbidden { + return &PostRoleUsersForbidden{} +} + +/*PostRoleUsersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostRoleUsersForbidden struct { + Payload *auth0_models.Error +} + +func (o *PostRoleUsersForbidden) Error() string { + return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersForbidden %+v", 403, o.Payload) +} + +func (o *PostRoleUsersForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostRoleUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRoleUsersNotFound creates a PostRoleUsersNotFound with default headers values +func NewPostRoleUsersNotFound() *PostRoleUsersNotFound { + return &PostRoleUsersNotFound{} +} + +/*PostRoleUsersNotFound handles this case with default header values. + +Resource was not found +*/ +type PostRoleUsersNotFound struct { + Payload *auth0_models.Error +} + +func (o *PostRoleUsersNotFound) Error() string { + return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersNotFound %+v", 404, o.Payload) +} + +func (o *PostRoleUsersNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostRoleUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRoleUsersInternalServerError creates a PostRoleUsersInternalServerError with default headers values +func NewPostRoleUsersInternalServerError() *PostRoleUsersInternalServerError { + return &PostRoleUsersInternalServerError{} +} + +/*PostRoleUsersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostRoleUsersInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *PostRoleUsersInternalServerError) Error() string { + return fmt.Sprintf("[POST /api/v2/roles/{roleId}/users][%d] postRoleUsersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostRoleUsersInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostRoleUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/role/role_client.go b/api/auth0/auth0_client/role/role_client.go new file mode 100644 index 0000000..589f9e7 --- /dev/null +++ b/api/auth0/auth0_client/role/role_client.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package role + +// 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 role API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for role API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRoles(params *GetRolesParams) (*GetRolesOK, error) + + PostRoleUsers(params *PostRoleUsersParams) (*PostRoleUsersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRoles gets roles from auth0 + + Get Roles from Auth0 +*/ +func (a *Client) GetRoles(params *GetRolesParams) (*GetRolesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRolesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRoles", + Method: "GET", + PathPattern: "/api/v2/roles", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetRolesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRolesOK) + 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 getRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostRoleUsers adds users to role + + Add users to role +*/ +func (a *Client) PostRoleUsers(params *PostRoleUsersParams) (*PostRoleUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostRoleUsersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postRoleUsers", + Method: "POST", + PathPattern: "/api/v2/roles/{roleId}/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PostRoleUsersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostRoleUsersOK) + 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 postRoleUsers: 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/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_parameters.go b/api/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_parameters.go new file mode 100644 index 0000000..88d6a3b --- /dev/null +++ b/api/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/auth0/auth0_models" +) + +// NewDeleteAPIV2UsersUserIDRolesParams creates a new DeleteAPIV2UsersUserIDRolesParams object +// with the default values initialized. +func NewDeleteAPIV2UsersUserIDRolesParams() *DeleteAPIV2UsersUserIDRolesParams { + var () + return &DeleteAPIV2UsersUserIDRolesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteAPIV2UsersUserIDRolesParamsWithTimeout creates a new DeleteAPIV2UsersUserIDRolesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteAPIV2UsersUserIDRolesParamsWithTimeout(timeout time.Duration) *DeleteAPIV2UsersUserIDRolesParams { + var () + return &DeleteAPIV2UsersUserIDRolesParams{ + + timeout: timeout, + } +} + +// NewDeleteAPIV2UsersUserIDRolesParamsWithContext creates a new DeleteAPIV2UsersUserIDRolesParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteAPIV2UsersUserIDRolesParamsWithContext(ctx context.Context) *DeleteAPIV2UsersUserIDRolesParams { + var () + return &DeleteAPIV2UsersUserIDRolesParams{ + + Context: ctx, + } +} + +// NewDeleteAPIV2UsersUserIDRolesParamsWithHTTPClient creates a new DeleteAPIV2UsersUserIDRolesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteAPIV2UsersUserIDRolesParamsWithHTTPClient(client *http.Client) *DeleteAPIV2UsersUserIDRolesParams { + var () + return &DeleteAPIV2UsersUserIDRolesParams{ + HTTPClient: client, + } +} + +/*DeleteAPIV2UsersUserIDRolesParams contains all the parameters to send to the API endpoint +for the delete API v2 users user ID roles operation typically these are written to a http.Request +*/ +type DeleteAPIV2UsersUserIDRolesParams struct { + + /*Authorization*/ + Authorization string + /*UserRolesRequest + An array of User IDs to add to a Role + + */ + UserRolesRequest *auth0_models.UserRolesRequest + /*UserID + An Auth0 User ID + + */ + UserID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) WithTimeout(timeout time.Duration) *DeleteAPIV2UsersUserIDRolesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) WithContext(ctx context.Context) *DeleteAPIV2UsersUserIDRolesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) WithHTTPClient(client *http.Client) *DeleteAPIV2UsersUserIDRolesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorization adds the authorization to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) WithAuthorization(authorization string) *DeleteAPIV2UsersUserIDRolesParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WithUserRolesRequest adds the userRolesRequest to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) WithUserRolesRequest(userRolesRequest *auth0_models.UserRolesRequest) *DeleteAPIV2UsersUserIDRolesParams { + o.SetUserRolesRequest(userRolesRequest) + return o +} + +// SetUserRolesRequest adds the userRolesRequest to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) SetUserRolesRequest(userRolesRequest *auth0_models.UserRolesRequest) { + o.UserRolesRequest = userRolesRequest +} + +// WithUserID adds the userID to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) WithUserID(userID string) *DeleteAPIV2UsersUserIDRolesParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the delete API v2 users user ID roles params +func (o *DeleteAPIV2UsersUserIDRolesParams) SetUserID(userID string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteAPIV2UsersUserIDRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + if o.UserRolesRequest != nil { + if err := r.SetBodyParam(o.UserRolesRequest); 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/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_responses.go b/api/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_responses.go new file mode 100644 index 0000000..58c52ca --- /dev/null +++ b/api/auth0/auth0_client/user/delete_api_v2_users_user_id_roles_responses.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_models" +) + +// DeleteAPIV2UsersUserIDRolesReader is a Reader for the DeleteAPIV2UsersUserIDRoles structure. +type DeleteAPIV2UsersUserIDRolesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteAPIV2UsersUserIDRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteAPIV2UsersUserIDRolesNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteAPIV2UsersUserIDRolesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteAPIV2UsersUserIDRolesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteAPIV2UsersUserIDRolesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteAPIV2UsersUserIDRolesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteAPIV2UsersUserIDRolesNoContent creates a DeleteAPIV2UsersUserIDRolesNoContent with default headers values +func NewDeleteAPIV2UsersUserIDRolesNoContent() *DeleteAPIV2UsersUserIDRolesNoContent { + return &DeleteAPIV2UsersUserIDRolesNoContent{} +} + +/*DeleteAPIV2UsersUserIDRolesNoContent handles this case with default header values. + +User roles successfully removed +*/ +type DeleteAPIV2UsersUserIDRolesNoContent struct { +} + +func (o *DeleteAPIV2UsersUserIDRolesNoContent) Error() string { + return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesNoContent ", 204) +} + +func (o *DeleteAPIV2UsersUserIDRolesNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteAPIV2UsersUserIDRolesUnauthorized creates a DeleteAPIV2UsersUserIDRolesUnauthorized with default headers values +func NewDeleteAPIV2UsersUserIDRolesUnauthorized() *DeleteAPIV2UsersUserIDRolesUnauthorized { + return &DeleteAPIV2UsersUserIDRolesUnauthorized{} +} + +/*DeleteAPIV2UsersUserIDRolesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type DeleteAPIV2UsersUserIDRolesUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *DeleteAPIV2UsersUserIDRolesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAPIV2UsersUserIDRolesForbidden creates a DeleteAPIV2UsersUserIDRolesForbidden with default headers values +func NewDeleteAPIV2UsersUserIDRolesForbidden() *DeleteAPIV2UsersUserIDRolesForbidden { + return &DeleteAPIV2UsersUserIDRolesForbidden{} +} + +/*DeleteAPIV2UsersUserIDRolesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteAPIV2UsersUserIDRolesForbidden struct { + Payload *auth0_models.Error +} + +func (o *DeleteAPIV2UsersUserIDRolesForbidden) Error() string { + return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesForbidden %+v", 403, o.Payload) +} + +func (o *DeleteAPIV2UsersUserIDRolesForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *DeleteAPIV2UsersUserIDRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAPIV2UsersUserIDRolesNotFound creates a DeleteAPIV2UsersUserIDRolesNotFound with default headers values +func NewDeleteAPIV2UsersUserIDRolesNotFound() *DeleteAPIV2UsersUserIDRolesNotFound { + return &DeleteAPIV2UsersUserIDRolesNotFound{} +} + +/*DeleteAPIV2UsersUserIDRolesNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteAPIV2UsersUserIDRolesNotFound struct { + Payload *auth0_models.Error +} + +func (o *DeleteAPIV2UsersUserIDRolesNotFound) Error() string { + return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesNotFound %+v", 404, o.Payload) +} + +func (o *DeleteAPIV2UsersUserIDRolesNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *DeleteAPIV2UsersUserIDRolesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteAPIV2UsersUserIDRolesInternalServerError creates a DeleteAPIV2UsersUserIDRolesInternalServerError with default headers values +func NewDeleteAPIV2UsersUserIDRolesInternalServerError() *DeleteAPIV2UsersUserIDRolesInternalServerError { + return &DeleteAPIV2UsersUserIDRolesInternalServerError{} +} + +/*DeleteAPIV2UsersUserIDRolesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteAPIV2UsersUserIDRolesInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /api/v2/users/{userId}/roles][%d] deleteApiV2UsersUserIdRolesInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *DeleteAPIV2UsersUserIDRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/user/get_user_by_email_parameters.go b/api/auth0/auth0_client/user/get_user_by_email_parameters.go new file mode 100644 index 0000000..3d0d030 --- /dev/null +++ b/api/auth0/auth0_client/user/get_user_by_email_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetUserByEmailParams creates a new GetUserByEmailParams object +// with the default values initialized. +func NewGetUserByEmailParams() *GetUserByEmailParams { + var () + return &GetUserByEmailParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUserByEmailParamsWithTimeout creates a new GetUserByEmailParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUserByEmailParamsWithTimeout(timeout time.Duration) *GetUserByEmailParams { + var () + return &GetUserByEmailParams{ + + timeout: timeout, + } +} + +// NewGetUserByEmailParamsWithContext creates a new GetUserByEmailParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUserByEmailParamsWithContext(ctx context.Context) *GetUserByEmailParams { + var () + return &GetUserByEmailParams{ + + Context: ctx, + } +} + +// NewGetUserByEmailParamsWithHTTPClient creates a new GetUserByEmailParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUserByEmailParamsWithHTTPClient(client *http.Client) *GetUserByEmailParams { + var () + return &GetUserByEmailParams{ + HTTPClient: client, + } +} + +/*GetUserByEmailParams contains all the parameters to send to the API endpoint +for the get user by email operation typically these are written to a http.Request +*/ +type GetUserByEmailParams struct { + + /*Authorization*/ + Authorization string + /*Email*/ + Email string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get user by email params +func (o *GetUserByEmailParams) WithTimeout(timeout time.Duration) *GetUserByEmailParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get user by email params +func (o *GetUserByEmailParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get user by email params +func (o *GetUserByEmailParams) WithContext(ctx context.Context) *GetUserByEmailParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get user by email params +func (o *GetUserByEmailParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get user by email params +func (o *GetUserByEmailParams) WithHTTPClient(client *http.Client) *GetUserByEmailParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get user by email params +func (o *GetUserByEmailParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorization adds the authorization to the get user by email params +func (o *GetUserByEmailParams) WithAuthorization(authorization string) *GetUserByEmailParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the get user by email params +func (o *GetUserByEmailParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WithEmail adds the email to the get user by email params +func (o *GetUserByEmailParams) WithEmail(email string) *GetUserByEmailParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the get user by email params +func (o *GetUserByEmailParams) SetEmail(email string) { + o.Email = email +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUserByEmailParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + // query param email + qrEmail := o.Email + qEmail := qrEmail + if qEmail != "" { + if err := r.SetQueryParam("email", qEmail); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/auth0/auth0_client/user/get_user_by_email_responses.go b/api/auth0/auth0_client/user/get_user_by_email_responses.go new file mode 100644 index 0000000..3887456 --- /dev/null +++ b/api/auth0/auth0_client/user/get_user_by_email_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_models" +) + +// GetUserByEmailReader is a Reader for the GetUserByEmail structure. +type GetUserByEmailReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUserByEmailReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUserByEmailOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUserByEmailUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUserByEmailForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUserByEmailNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUserByEmailInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetUserByEmailOK creates a GetUserByEmailOK with default headers values +func NewGetUserByEmailOK() *GetUserByEmailOK { + return &GetUserByEmailOK{} +} + +/*GetUserByEmailOK handles this case with default header values. + +Taxnexus Response with User objects +*/ +type GetUserByEmailOK struct { + Payload []*auth0_models.User +} + +func (o *GetUserByEmailOK) Error() string { + return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailOK %+v", 200, o.Payload) +} + +func (o *GetUserByEmailOK) GetPayload() []*auth0_models.User { + return o.Payload +} + +func (o *GetUserByEmailOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserByEmailUnauthorized creates a GetUserByEmailUnauthorized with default headers values +func NewGetUserByEmailUnauthorized() *GetUserByEmailUnauthorized { + return &GetUserByEmailUnauthorized{} +} + +/*GetUserByEmailUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUserByEmailUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *GetUserByEmailUnauthorized) Error() string { + return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailUnauthorized %+v", 401, o.Payload) +} + +func (o *GetUserByEmailUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserByEmailUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserByEmailForbidden creates a GetUserByEmailForbidden with default headers values +func NewGetUserByEmailForbidden() *GetUserByEmailForbidden { + return &GetUserByEmailForbidden{} +} + +/*GetUserByEmailForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetUserByEmailForbidden struct { + Payload *auth0_models.Error +} + +func (o *GetUserByEmailForbidden) Error() string { + return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailForbidden %+v", 403, o.Payload) +} + +func (o *GetUserByEmailForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserByEmailForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserByEmailNotFound creates a GetUserByEmailNotFound with default headers values +func NewGetUserByEmailNotFound() *GetUserByEmailNotFound { + return &GetUserByEmailNotFound{} +} + +/*GetUserByEmailNotFound handles this case with default header values. + +Resource was not found +*/ +type GetUserByEmailNotFound struct { + Payload *auth0_models.Error +} + +func (o *GetUserByEmailNotFound) Error() string { + return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailNotFound %+v", 404, o.Payload) +} + +func (o *GetUserByEmailNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserByEmailNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserByEmailInternalServerError creates a GetUserByEmailInternalServerError with default headers values +func NewGetUserByEmailInternalServerError() *GetUserByEmailInternalServerError { + return &GetUserByEmailInternalServerError{} +} + +/*GetUserByEmailInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetUserByEmailInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *GetUserByEmailInternalServerError) Error() string { + return fmt.Sprintf("[GET /api/v2/users-by-email][%d] getUserByEmailInternalServerError %+v", 500, o.Payload) +} + +func (o *GetUserByEmailInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserByEmailInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/user/get_user_roles_parameters.go b/api/auth0/auth0_client/user/get_user_roles_parameters.go new file mode 100644 index 0000000..40a6c76 --- /dev/null +++ b/api/auth0/auth0_client/user/get_user_roles_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetUserRolesParams creates a new GetUserRolesParams object +// with the default values initialized. +func NewGetUserRolesParams() *GetUserRolesParams { + var () + return &GetUserRolesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUserRolesParamsWithTimeout creates a new GetUserRolesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUserRolesParamsWithTimeout(timeout time.Duration) *GetUserRolesParams { + var () + return &GetUserRolesParams{ + + timeout: timeout, + } +} + +// NewGetUserRolesParamsWithContext creates a new GetUserRolesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUserRolesParamsWithContext(ctx context.Context) *GetUserRolesParams { + var () + return &GetUserRolesParams{ + + Context: ctx, + } +} + +// NewGetUserRolesParamsWithHTTPClient creates a new GetUserRolesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUserRolesParamsWithHTTPClient(client *http.Client) *GetUserRolesParams { + var () + return &GetUserRolesParams{ + HTTPClient: client, + } +} + +/*GetUserRolesParams contains all the parameters to send to the API endpoint +for the get user roles operation typically these are written to a http.Request +*/ +type GetUserRolesParams struct { + + /*Authorization*/ + Authorization string + /*UserID + An Auth0 User ID + + */ + UserID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get user roles params +func (o *GetUserRolesParams) WithTimeout(timeout time.Duration) *GetUserRolesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get user roles params +func (o *GetUserRolesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get user roles params +func (o *GetUserRolesParams) WithContext(ctx context.Context) *GetUserRolesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get user roles params +func (o *GetUserRolesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get user roles params +func (o *GetUserRolesParams) WithHTTPClient(client *http.Client) *GetUserRolesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get user roles params +func (o *GetUserRolesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorization adds the authorization to the get user roles params +func (o *GetUserRolesParams) WithAuthorization(authorization string) *GetUserRolesParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the get user roles params +func (o *GetUserRolesParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WithUserID adds the userID to the get user roles params +func (o *GetUserRolesParams) WithUserID(userID string) *GetUserRolesParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get user roles params +func (o *GetUserRolesParams) SetUserID(userID string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUserRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); 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/auth0/auth0_client/user/get_user_roles_responses.go b/api/auth0/auth0_client/user/get_user_roles_responses.go new file mode 100644 index 0000000..d6cf3c3 --- /dev/null +++ b/api/auth0/auth0_client/user/get_user_roles_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_models" +) + +// GetUserRolesReader is a Reader for the GetUserRoles structure. +type GetUserRolesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUserRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUserRolesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUserRolesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUserRolesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUserRolesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUserRolesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetUserRolesOK creates a GetUserRolesOK with default headers values +func NewGetUserRolesOK() *GetUserRolesOK { + return &GetUserRolesOK{} +} + +/*GetUserRolesOK handles this case with default header values. + +Taxnexus Response with User objects +*/ +type GetUserRolesOK struct { + Payload *auth0_models.RoleResponse +} + +func (o *GetUserRolesOK) Error() string { + return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesOK %+v", 200, o.Payload) +} + +func (o *GetUserRolesOK) GetPayload() *auth0_models.RoleResponse { + return o.Payload +} + +func (o *GetUserRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.RoleResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserRolesUnauthorized creates a GetUserRolesUnauthorized with default headers values +func NewGetUserRolesUnauthorized() *GetUserRolesUnauthorized { + return &GetUserRolesUnauthorized{} +} + +/*GetUserRolesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUserRolesUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *GetUserRolesUnauthorized) Error() string { + return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetUserRolesUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserRolesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserRolesForbidden creates a GetUserRolesForbidden with default headers values +func NewGetUserRolesForbidden() *GetUserRolesForbidden { + return &GetUserRolesForbidden{} +} + +/*GetUserRolesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetUserRolesForbidden struct { + Payload *auth0_models.Error +} + +func (o *GetUserRolesForbidden) Error() string { + return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesForbidden %+v", 403, o.Payload) +} + +func (o *GetUserRolesForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserRolesNotFound creates a GetUserRolesNotFound with default headers values +func NewGetUserRolesNotFound() *GetUserRolesNotFound { + return &GetUserRolesNotFound{} +} + +/*GetUserRolesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetUserRolesNotFound struct { + Payload *auth0_models.Error +} + +func (o *GetUserRolesNotFound) Error() string { + return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesNotFound %+v", 404, o.Payload) +} + +func (o *GetUserRolesNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserRolesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUserRolesInternalServerError creates a GetUserRolesInternalServerError with default headers values +func NewGetUserRolesInternalServerError() *GetUserRolesInternalServerError { + return &GetUserRolesInternalServerError{} +} + +/*GetUserRolesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetUserRolesInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *GetUserRolesInternalServerError) Error() string { + return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetUserRolesInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUserRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/user/get_users_parameters.go b/api/auth0/auth0_client/user/get_users_parameters.go new file mode 100644 index 0000000..ffe04d3 --- /dev/null +++ b/api/auth0/auth0_client/user/get_users_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetUsersParams() *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUsersParamsWithTimeout creates a new GetUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: timeout, + } +} + +// NewGetUsersParamsWithContext creates a new GetUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams { + var () + return &GetUsersParams{ + + Context: ctx, + } +} + +// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams { + var () + 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 { + + /*Authorization*/ + Authorization string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithAuthorization adds the authorization to the get users params +func (o *GetUsersParams) WithAuthorization(authorization string) *GetUsersParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the get users params +func (o *GetUsersParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// 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 + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/auth0/auth0_client/user/get_users_responses.go b/api/auth0/auth0_client/user/get_users_responses.go new file mode 100644 index 0000000..fd12dd6 --- /dev/null +++ b/api/auth0/auth0_client/user/get_users_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_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 500: + result := NewGetUsersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetUsersOK creates a GetUsersOK with default headers values +func NewGetUsersOK() *GetUsersOK { + return &GetUsersOK{} +} + +/*GetUsersOK handles this case with default header values. + +Taxnexus Response with User objects +*/ +type GetUsersOK struct { + Payload []*auth0_models.User +} + +func (o *GetUsersOK) Error() string { + return fmt.Sprintf("[GET /api/v2/users][%d] getUsersOK %+v", 200, o.Payload) +} + +func (o *GetUsersOK) GetPayload() []*auth0_models.User { + return o.Payload +} + +func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // 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 handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUsersUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *GetUsersUnauthorized) Error() string { + return fmt.Sprintf("[GET /api/v2/users][%d] getUsersUnauthorized %+v", 401, o.Payload) +} + +func (o *GetUsersUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetUsersForbidden struct { + Payload *auth0_models.Error +} + +func (o *GetUsersForbidden) Error() string { + return fmt.Sprintf("[GET /api/v2/users][%d] getUsersForbidden %+v", 403, o.Payload) +} + +func (o *GetUsersForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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 handles this case with default header values. + +Resource was not found +*/ +type GetUsersNotFound struct { + Payload *auth0_models.Error +} + +func (o *GetUsersNotFound) Error() string { + return fmt.Sprintf("[GET /api/v2/users][%d] getUsersNotFound %+v", 404, o.Payload) +} + +func (o *GetUsersNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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 handles this case with default header values. + +Server Internal Error +*/ +type GetUsersInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *GetUsersInternalServerError) Error() string { + return fmt.Sprintf("[GET /api/v2/users][%d] getUsersInternalServerError %+v", 500, o.Payload) +} + +func (o *GetUsersInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *GetUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/user/post_users_parameters.go b/api/auth0/auth0_client/user/post_users_parameters.go new file mode 100644 index 0000000..a3aea4e --- /dev/null +++ b/api/auth0/auth0_client/user/post_users_parameters.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/auth0/auth0_models" +) + +// NewPostUsersParams creates a new PostUsersParams object +// with the default values initialized. +func NewPostUsersParams() *PostUsersParams { + var () + return &PostUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostUsersParamsWithTimeout creates a new PostUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostUsersParamsWithTimeout(timeout time.Duration) *PostUsersParams { + var () + return &PostUsersParams{ + + timeout: timeout, + } +} + +// NewPostUsersParamsWithContext creates a new PostUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostUsersParamsWithContext(ctx context.Context) *PostUsersParams { + var () + return &PostUsersParams{ + + Context: ctx, + } +} + +// NewPostUsersParamsWithHTTPClient creates a new PostUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostUsersParamsWithHTTPClient(client *http.Client) *PostUsersParams { + var () + 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 { + + /*Authorization*/ + Authorization string + /*UserRequest + An array of User records + + */ + UserRequest *auth0_models.UserRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithAuthorization adds the authorization to the post users params +func (o *PostUsersParams) WithAuthorization(authorization string) *PostUsersParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the post users params +func (o *PostUsersParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WithUserRequest adds the userRequest to the post users params +func (o *PostUsersParams) WithUserRequest(userRequest *auth0_models.UserRequest) *PostUsersParams { + o.SetUserRequest(userRequest) + return o +} + +// SetUserRequest adds the userRequest to the post users params +func (o *PostUsersParams) SetUserRequest(userRequest *auth0_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 + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + 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/auth0/auth0_client/user/post_users_responses.go b/api/auth0/auth0_client/user/post_users_responses.go new file mode 100644 index 0000000..ff62641 --- /dev/null +++ b/api/auth0/auth0_client/user/post_users_responses.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/auth0/auth0_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 201: + result := NewPostUsersCreated() + 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 409: + result := NewPostUsersConflict() + 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("unknown error", response, response.Code()) + } +} + +// NewPostUsersCreated creates a PostUsersCreated with default headers values +func NewPostUsersCreated() *PostUsersCreated { + return &PostUsersCreated{} +} + +/*PostUsersCreated handles this case with default header values. + +New user created +*/ +type PostUsersCreated struct { +} + +func (o *PostUsersCreated) Error() string { + return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersCreated ", 201) +} + +func (o *PostUsersCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPostUsersUnauthorized creates a PostUsersUnauthorized with default headers values +func NewPostUsersUnauthorized() *PostUsersUnauthorized { + return &PostUsersUnauthorized{} +} + +/*PostUsersUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostUsersUnauthorized struct { + Payload *auth0_models.Error +} + +func (o *PostUsersUnauthorized) Error() string { + return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostUsersUnauthorized) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostUsersForbidden struct { + Payload *auth0_models.Error +} + +func (o *PostUsersForbidden) Error() string { + return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersForbidden %+v", 403, o.Payload) +} + +func (o *PostUsersForbidden) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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 handles this case with default header values. + +Resource was not found +*/ +type PostUsersNotFound struct { + Payload *auth0_models.Error +} + +func (o *PostUsersNotFound) Error() string { + return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersNotFound %+v", 404, o.Payload) +} + +func (o *PostUsersNotFound) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersConflict creates a PostUsersConflict with default headers values +func NewPostUsersConflict() *PostUsersConflict { + return &PostUsersConflict{} +} + +/*PostUsersConflict handles this case with default header values. + +User already exists +*/ +type PostUsersConflict struct { +} + +func (o *PostUsersConflict) Error() string { + return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersConflict ", 409) +} + +func (o *PostUsersConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPostUsersInternalServerError creates a PostUsersInternalServerError with default headers values +func NewPostUsersInternalServerError() *PostUsersInternalServerError { + return &PostUsersInternalServerError{} +} + +/*PostUsersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostUsersInternalServerError struct { + Payload *auth0_models.Error +} + +func (o *PostUsersInternalServerError) Error() string { + return fmt.Sprintf("[POST /api/v2/users-by-email][%d] postUsersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostUsersInternalServerError) GetPayload() *auth0_models.Error { + return o.Payload +} + +func (o *PostUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(auth0_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/auth0/auth0_client/user/user_client.go b/api/auth0/auth0_client/user/user_client.go new file mode 100644 index 0000000..577dcb2 --- /dev/null +++ b/api/auth0/auth0_client/user/user_client.go @@ -0,0 +1,228 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams) (*DeleteAPIV2UsersUserIDRolesNoContent, error) + + GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK, error) + + GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, error) + + GetUsers(params *GetUsersParams) (*GetUsersOK, error) + + PostUsers(params *PostUsersParams) (*PostUsersCreated, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteAPIV2UsersUserIDRoles delete API v2 users user ID roles API +*/ +func (a *Client) DeleteAPIV2UsersUserIDRoles(params *DeleteAPIV2UsersUserIDRolesParams) (*DeleteAPIV2UsersUserIDRolesNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAPIV2UsersUserIDRolesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteAPIV2UsersUserIDRoles", + Method: "DELETE", + PathPattern: "/api/v2/users/{userId}/roles", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteAPIV2UsersUserIDRolesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteAPIV2UsersUserIDRolesNoContent) + 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 DeleteAPIV2UsersUserIDRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetUserByEmail gets a single user from auth0 by email address + + Get a single user from Auth0 by Email Address +*/ +func (a *Client) GetUserByEmail(params *GetUserByEmailParams) (*GetUserByEmailOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUserByEmailParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getUserByEmail", + Method: "GET", + PathPattern: "/api/v2/users-by-email", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetUserByEmailReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetUserByEmailOK) + 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 getUserByEmail: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetUserRoles gets a user s roles + + Get a User's Roles +*/ +func (a *Client) GetUserRoles(params *GetUserRolesParams) (*GetUserRolesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUserRolesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getUserRoles", + Method: "GET", + PathPattern: "/api/v2/users/{userId}/roles", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetUserRolesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetUserRolesOK) + 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 getUserRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetUsers gets all users from auth0 + + Get all users from Auth0 +*/ +func (a *Client) GetUsers(params *GetUsersParams) (*GetUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getUsers", + Method: "GET", + PathPattern: "/api/v2/users", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetUsersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + 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) +} + +/* + PostUsers creates new auth0 user + + create new Auth0 user +*/ +func (a *Client) PostUsers(params *PostUsersParams) (*PostUsersCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostUsersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postUsers", + Method: "POST", + PathPattern: "/api/v2/users-by-email", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PostUsersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostUsersCreated) + 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) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/auth0/auth0_models/credentials_request.go b/api/auth0/auth0_models/credentials_request.go new file mode 100644 index 0000000..576d5fe --- /dev/null +++ b/api/auth0/auth0_models/credentials_request.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CredentialsRequest credentials request +// +// swagger:model CredentialsRequest +type CredentialsRequest struct { + + // audience + Audience string `json:"audience,omitempty"` + + // client id + ClientID string `json:"client_id,omitempty"` + + // client secret + ClientSecret string `json:"client_secret,omitempty"` + + // grant type + GrantType string `json:"grant_type,omitempty"` +} + +// Validate validates this credentials request +func (m *CredentialsRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CredentialsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CredentialsRequest) UnmarshalBinary(b []byte) error { + var res CredentialsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth0/auth0_models/credentials_response.go b/api/auth0/auth0_models/credentials_response.go new file mode 100644 index 0000000..12e24df --- /dev/null +++ b/api/auth0/auth0_models/credentials_response.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CredentialsResponse credentials response +// +// swagger:model CredentialsResponse +type CredentialsResponse struct { + + // access token + AccessToken string `json:"access_token,omitempty"` + + // expires in + ExpiresIn int64 `json:"expires_in,omitempty"` + + // scope + Scope string `json:"scope,omitempty"` + + // token type + TokenType string `json:"token_type,omitempty"` +} + +// Validate validates this credentials response +func (m *CredentialsResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CredentialsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CredentialsResponse) UnmarshalBinary(b []byte) error { + var res CredentialsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth0/auth0_models/error.go b/api/auth0/auth0_models/error.go new file mode 100644 index 0000000..d4c181d --- /dev/null +++ b/api/auth0/auth0_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/auth0/auth0_models/new_user.go b/api/auth0/auth0_models/new_user.go new file mode 100644 index 0000000..bbd36c0 --- /dev/null +++ b/api/auth0/auth0_models/new_user.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUser new user +// +// swagger:model NewUser +type NewUser struct { + + // blocked + Blocked bool `json:"blocked,omitempty"` + + // connection + Connection string `json:"connection,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // email verified + EmailVerified bool `json:"email_verified,omitempty"` + + // family name + FamilyName string `json:"family_name,omitempty"` + + // given name + GivenName string `json:"given_name,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // nickname + Nickname string `json:"nickname,omitempty"` + + // password + Password string `json:"password,omitempty"` + + // phone number + PhoneNumber string `json:"phone_number,omitempty"` + + // phone verified + PhoneVerified bool `json:"phone_verified,omitempty"` + + // picture + Picture string `json:"picture,omitempty"` + + // user id + UserID string `json:"user_id,omitempty"` + + // username + Username string `json:"username,omitempty"` + + // verify email + VerifyEmail bool `json:"verify_email,omitempty"` +} + +// Validate validates this new user +func (m *NewUser) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NewUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewUser) UnmarshalBinary(b []byte) error { + var res NewUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth0/auth0_models/role.go b/api/auth0/auth0_models/role.go new file mode 100644 index 0000000..78cc826 --- /dev/null +++ b/api/auth0/auth0_models/role.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Role role +// +// swagger:model Role +type Role struct { + + // description + Description string `json:"description,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this role +func (m *Role) Validate(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/auth0/auth0_models/role_response.go b/api/auth0/auth0_models/role_response.go new file mode 100644 index 0000000..70b691f --- /dev/null +++ b/api/auth0/auth0_models/role_response.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RoleResponse role response +// +// swagger:model RoleResponse +type RoleResponse struct { + + // roles + Roles []*Role `json:"roles"` +} + +// Validate validates this role response +func (m *RoleResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoleResponse) 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 +} + +// 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/auth0/auth0_models/role_users_request.go b/api/auth0/auth0_models/role_users_request.go new file mode 100644 index 0000000..e55b35b --- /dev/null +++ b/api/auth0/auth0_models/role_users_request.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RoleUsersRequest role users request +// +// swagger:model RoleUsersRequest +type RoleUsersRequest struct { + + // users + Users []string `json:"users"` +} + +// Validate validates this role users request +func (m *RoleUsersRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RoleUsersRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoleUsersRequest) UnmarshalBinary(b []byte) error { + var res RoleUsersRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth0/auth0_models/user.go b/api/auth0/auth0_models/user.go new file mode 100644 index 0000000..ca59a0f --- /dev/null +++ b/api/auth0/auth0_models/user.go @@ -0,0 +1,305 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// User user +// +// swagger:model User +type User struct { + + // app metadata + AppMetadata *UserAppMetadata `json:"app_metadata,omitempty"` + + // created at + CreatedAt string `json:"created_at,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // email verified + EmailVerified bool `json:"email_verified,omitempty"` + + // family name + FamilyName string `json:"family_name,omitempty"` + + // given name + GivenName string `json:"given_name,omitempty"` + + // identities + Identities []*UserIdentitiesItems0 `json:"identities"` + + // last ip + LastIP string `json:"last_ip,omitempty"` + + // last login + LastLogin string `json:"last_login,omitempty"` + + // last password reset + LastPasswordReset string `json:"last_password_reset,omitempty"` + + // logins count + LoginsCount int64 `json:"logins_count,omitempty"` + + // multifactor last modified + MultifactorLastModified string `json:"multifactor_last_modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // nickname + Nickname string `json:"nickname,omitempty"` + + // picture + Picture string `json:"picture,omitempty"` + + // updated at + UpdatedAt string `json:"updated_at,omitempty"` + + // user id + UserID string `json:"user_id,omitempty"` + + // user metadata + UserMetadata *UserUserMetadata `json:"user_metadata,omitempty"` +} + +// Validate validates this user +func (m *User) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppMetadata(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIdentities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserMetadata(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) validateAppMetadata(formats strfmt.Registry) error { + + if swag.IsZero(m.AppMetadata) { // not required + return nil + } + + if m.AppMetadata != nil { + if err := m.AppMetadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("app_metadata") + } + return err + } + } + + return nil +} + +func (m *User) validateIdentities(formats strfmt.Registry) error { + + if swag.IsZero(m.Identities) { // not required + return nil + } + + for i := 0; i < len(m.Identities); i++ { + if swag.IsZero(m.Identities[i]) { // not required + continue + } + + if m.Identities[i] != nil { + if err := m.Identities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("identities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *User) validateUserMetadata(formats strfmt.Registry) error { + + if swag.IsZero(m.UserMetadata) { // not required + return nil + } + + if m.UserMetadata != nil { + if err := m.UserMetadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user_metadata") + } + 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 +} + +// UserAppMetadata user app metadata +// +// swagger:model UserAppMetadata +type UserAppMetadata struct { + + // roles + Roles []string `json:"roles"` + + // taxnexus account id + TaxnexusAccountID string `json:"taxnexus_account_id,omitempty"` + + // taxnexus contact id + TaxnexusContactID string `json:"taxnexus_contact_id,omitempty"` + + // taxnexus user id + TaxnexusUserID string `json:"taxnexus_user_id,omitempty"` +} + +// Validate validates this user app metadata +func (m *UserAppMetadata) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserAppMetadata) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserAppMetadata) UnmarshalBinary(b []byte) error { + var res UserAppMetadata + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UserIdentitiesItems0 user identities items0 +// +// swagger:model UserIdentitiesItems0 +type UserIdentitiesItems0 struct { + + // connection + Connection string `json:"connection,omitempty"` + + // is social + IsSocial bool `json:"isSocial,omitempty"` + + // provider + Provider string `json:"provider,omitempty"` + + // user id + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this user identities items0 +func (m *UserIdentitiesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserIdentitiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserIdentitiesItems0) UnmarshalBinary(b []byte) error { + var res UserIdentitiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UserUserMetadata user user metadata +// +// swagger:model UserUserMetadata +type UserUserMetadata struct { + + // taxnexus email + TaxnexusEmail string `json:"taxnexus_email,omitempty"` + + // taxnexus firstname + TaxnexusFirstname string `json:"taxnexus_firstname,omitempty"` + + // taxnexus fullname + TaxnexusFullname string `json:"taxnexus_fullname,omitempty"` + + // taxnexus lastname + TaxnexusLastname string `json:"taxnexus_lastname,omitempty"` + + // taxnexus phone + TaxnexusPhone string `json:"taxnexus_phone,omitempty"` +} + +// Validate validates this user user metadata +func (m *UserUserMetadata) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserUserMetadata) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserUserMetadata) UnmarshalBinary(b []byte) error { + var res UserUserMetadata + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/auth0/auth0_models/user_request.go b/api/auth0/auth0_models/user_request.go new file mode 100644 index 0000000..585ca06 --- /dev/null +++ b/api/auth0/auth0_models/user_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserRequest An array Auth0 new user objects +// +// swagger:model UserRequest +type UserRequest struct { + + // users + Users []*NewUser `json:"users"` +} + +// Validate validates this user request +func (m *UserRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUsers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserRequest) validateUsers(formats strfmt.Registry) error { + + if swag.IsZero(m.Users) { // not required + return nil + } + + for i := 0; i < len(m.Users); i++ { + if swag.IsZero(m.Users[i]) { // not required + continue + } + + if m.Users[i] != nil { + if err := m.Users[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("users" + "." + 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/auth0/auth0_models/user_roles_request.go b/api/auth0/auth0_models/user_roles_request.go new file mode 100644 index 0000000..054860e --- /dev/null +++ b/api/auth0/auth0_models/user_roles_request.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package auth0_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserRolesRequest user roles request +// +// swagger:model UserRolesRequest +type UserRolesRequest struct { + + // roles + Roles []string `json:"roles"` +} + +// Validate validates this user roles request +func (m *UserRolesRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserRolesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserRolesRequest) UnmarshalBinary(b []byte) error { + var res UserRolesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_client/blaze_client.go b/api/blaze/blaze_client/blaze_client.go new file mode 100644 index 0000000..38f616f --- /dev/null +++ b/api/blaze/blaze_client/blaze_client.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_client/members" + "github.com/taxnexus/go/lib/api/blaze/blaze_client/products" + "github.com/taxnexus/go/lib/api/blaze/blaze_client/purchase_orders" + "github.com/taxnexus/go/lib/api/blaze/blaze_client/shop" + "github.com/taxnexus/go/lib/api/blaze/blaze_client/transactions" + "github.com/taxnexus/go/lib/api/blaze/blaze_client/vendors" +) + +// Default blaze HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "api.blaze.me" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/api/v1" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"https"} + +// NewHTTPClient creates a new blaze HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Blaze { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new blaze HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Blaze { + // 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 blaze client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Blaze { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Blaze) + cli.Transport = transport + cli.Members = members.New(transport, formats) + cli.Products = products.New(transport, formats) + cli.PurchaseOrders = purchase_orders.New(transport, formats) + cli.Shop = shop.New(transport, formats) + cli.Transactions = transactions.New(transport, formats) + cli.Vendors = vendors.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 +} + +// Blaze is a client for blaze +type Blaze struct { + Members members.ClientService + + Products products.ClientService + + PurchaseOrders purchase_orders.ClientService + + Shop shop.ClientService + + Transactions transactions.ClientService + + Vendors vendors.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Blaze) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Members.SetTransport(transport) + c.Products.SetTransport(transport) + c.PurchaseOrders.SetTransport(transport) + c.Shop.SetTransport(transport) + c.Transactions.SetTransport(transport) + c.Vendors.SetTransport(transport) +} diff --git a/api/blaze/blaze_client/members/get_member_parameters.go b/api/blaze/blaze_client/members/get_member_parameters.go new file mode 100644 index 0000000..e2bb956 --- /dev/null +++ b/api/blaze/blaze_client/members/get_member_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package members + +// 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" +) + +// NewGetMemberParams creates a new GetMemberParams object +// with the default values initialized. +func NewGetMemberParams() *GetMemberParams { + var () + return &GetMemberParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetMemberParamsWithTimeout creates a new GetMemberParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetMemberParamsWithTimeout(timeout time.Duration) *GetMemberParams { + var () + return &GetMemberParams{ + + timeout: timeout, + } +} + +// NewGetMemberParamsWithContext creates a new GetMemberParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetMemberParamsWithContext(ctx context.Context) *GetMemberParams { + var () + return &GetMemberParams{ + + Context: ctx, + } +} + +// NewGetMemberParamsWithHTTPClient creates a new GetMemberParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetMemberParamsWithHTTPClient(client *http.Client) *GetMemberParams { + var () + return &GetMemberParams{ + HTTPClient: client, + } +} + +/*GetMemberParams contains all the parameters to send to the API endpoint +for the get member operation typically these are written to a http.Request +*/ +type GetMemberParams struct { + + /*MemberID + The Blaze Member Object Id + + */ + MemberID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get member params +func (o *GetMemberParams) WithTimeout(timeout time.Duration) *GetMemberParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get member params +func (o *GetMemberParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get member params +func (o *GetMemberParams) WithContext(ctx context.Context) *GetMemberParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get member params +func (o *GetMemberParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get member params +func (o *GetMemberParams) WithHTTPClient(client *http.Client) *GetMemberParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get member params +func (o *GetMemberParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMemberID adds the memberID to the get member params +func (o *GetMemberParams) WithMemberID(memberID string) *GetMemberParams { + o.SetMemberID(memberID) + return o +} + +// SetMemberID adds the memberId to the get member params +func (o *GetMemberParams) SetMemberID(memberID string) { + o.MemberID = memberID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMemberParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param memberId + if err := r.SetPathParam("memberId", o.MemberID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/blaze/blaze_client/members/get_member_responses.go b/api/blaze/blaze_client/members/get_member_responses.go new file mode 100644 index 0000000..1249ead --- /dev/null +++ b/api/blaze/blaze_client/members/get_member_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package members + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetMemberReader is a Reader for the GetMember structure. +type GetMemberReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMemberReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMemberOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetMemberUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetMemberForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetMemberNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetMemberInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetMemberOK creates a GetMemberOK with default headers values +func NewGetMemberOK() *GetMemberOK { + return &GetMemberOK{} +} + +/*GetMemberOK handles this case with default header values. + +Product was successfully retrieved +*/ +type GetMemberOK struct { + Payload *blaze_models.MemberResponse +} + +func (o *GetMemberOK) Error() string { + return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberOK %+v", 200, o.Payload) +} + +func (o *GetMemberOK) GetPayload() *blaze_models.MemberResponse { + return o.Payload +} + +func (o *GetMemberOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.MemberResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMemberUnauthorized creates a GetMemberUnauthorized with default headers values +func NewGetMemberUnauthorized() *GetMemberUnauthorized { + return &GetMemberUnauthorized{} +} + +/*GetMemberUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetMemberUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetMemberUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMemberUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetMemberUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMemberForbidden creates a GetMemberForbidden with default headers values +func NewGetMemberForbidden() *GetMemberForbidden { + return &GetMemberForbidden{} +} + +/*GetMemberForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetMemberForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetMemberForbidden) Error() string { + return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberForbidden %+v", 403, o.Payload) +} + +func (o *GetMemberForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetMemberForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMemberNotFound creates a GetMemberNotFound with default headers values +func NewGetMemberNotFound() *GetMemberNotFound { + return &GetMemberNotFound{} +} + +/*GetMemberNotFound handles this case with default header values. + +Resource was not found +*/ +type GetMemberNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetMemberNotFound) Error() string { + return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberNotFound %+v", 404, o.Payload) +} + +func (o *GetMemberNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetMemberNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMemberInternalServerError creates a GetMemberInternalServerError with default headers values +func NewGetMemberInternalServerError() *GetMemberInternalServerError { + return &GetMemberInternalServerError{} +} + +/*GetMemberInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetMemberInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetMemberInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/members/{memberId}][%d] getMemberInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMemberInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetMemberInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/members/members_client.go b/api/blaze/blaze_client/members/members_client.go new file mode 100644 index 0000000..d1cb8c9 --- /dev/null +++ b/api/blaze/blaze_client/members/members_client.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package members + +// 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 members API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for members API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter) (*GetMemberOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetMember Get A Member (contact) +*/ +func (a *Client) GetMember(params *GetMemberParams, authInfo runtime.ClientAuthInfoWriter) (*GetMemberOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMemberParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getMember", + Method: "GET", + PathPattern: "/partner/members/{memberId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetMemberReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetMemberOK) + 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 getMember: 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/blaze/blaze_client/products/get_product_parameters.go b/api/blaze/blaze_client/products/get_product_parameters.go new file mode 100644 index 0000000..ec383c4 --- /dev/null +++ b/api/blaze/blaze_client/products/get_product_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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" +) + +// NewGetProductParams creates a new GetProductParams object +// with the default values initialized. +func NewGetProductParams() *GetProductParams { + var () + return &GetProductParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProductParamsWithTimeout creates a new GetProductParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProductParamsWithTimeout(timeout time.Duration) *GetProductParams { + var () + return &GetProductParams{ + + timeout: timeout, + } +} + +// NewGetProductParamsWithContext creates a new GetProductParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProductParamsWithContext(ctx context.Context) *GetProductParams { + var () + return &GetProductParams{ + + Context: ctx, + } +} + +// NewGetProductParamsWithHTTPClient creates a new GetProductParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProductParamsWithHTTPClient(client *http.Client) *GetProductParams { + var () + return &GetProductParams{ + HTTPClient: client, + } +} + +/*GetProductParams contains all the parameters to send to the API endpoint +for the get product operation typically these are written to a http.Request +*/ +type GetProductParams struct { + + /*ProductID + The Blaze Product Object Id + + */ + ProductID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get product params +func (o *GetProductParams) WithTimeout(timeout time.Duration) *GetProductParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get product params +func (o *GetProductParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get product params +func (o *GetProductParams) WithContext(ctx context.Context) *GetProductParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get product params +func (o *GetProductParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get product params +func (o *GetProductParams) WithHTTPClient(client *http.Client) *GetProductParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get product params +func (o *GetProductParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProductID adds the productID to the get product params +func (o *GetProductParams) WithProductID(productID string) *GetProductParams { + o.SetProductID(productID) + return o +} + +// SetProductID adds the productId to the get product params +func (o *GetProductParams) SetProductID(productID string) { + o.ProductID = productID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param productId + if err := r.SetPathParam("productId", o.ProductID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/blaze/blaze_client/products/get_product_responses.go b/api/blaze/blaze_client/products/get_product_responses.go new file mode 100644 index 0000000..6f40c37 --- /dev/null +++ b/api/blaze/blaze_client/products/get_product_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetProductReader is a Reader for the GetProduct structure. +type GetProductReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProductOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetProductUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetProductForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetProductNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetProductInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetProductOK creates a GetProductOK with default headers values +func NewGetProductOK() *GetProductOK { + return &GetProductOK{} +} + +/*GetProductOK handles this case with default header values. + +Product was successfully retrieved +*/ +type GetProductOK struct { + Payload *blaze_models.ProductResponse +} + +func (o *GetProductOK) Error() string { + return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductOK %+v", 200, o.Payload) +} + +func (o *GetProductOK) GetPayload() *blaze_models.ProductResponse { + return o.Payload +} + +func (o *GetProductOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.ProductResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductUnauthorized creates a GetProductUnauthorized with default headers values +func NewGetProductUnauthorized() *GetProductUnauthorized { + return &GetProductUnauthorized{} +} + +/*GetProductUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetProductUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetProductUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductUnauthorized %+v", 401, o.Payload) +} + +func (o *GetProductUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductForbidden creates a GetProductForbidden with default headers values +func NewGetProductForbidden() *GetProductForbidden { + return &GetProductForbidden{} +} + +/*GetProductForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetProductForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetProductForbidden) Error() string { + return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductForbidden %+v", 403, o.Payload) +} + +func (o *GetProductForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductNotFound creates a GetProductNotFound with default headers values +func NewGetProductNotFound() *GetProductNotFound { + return &GetProductNotFound{} +} + +/*GetProductNotFound handles this case with default header values. + +Resource was not found +*/ +type GetProductNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetProductNotFound) Error() string { + return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductNotFound %+v", 404, o.Payload) +} + +func (o *GetProductNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductInternalServerError creates a GetProductInternalServerError with default headers values +func NewGetProductInternalServerError() *GetProductInternalServerError { + return &GetProductInternalServerError{} +} + +/*GetProductInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetProductInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetProductInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/products/{productId}][%d] getProductInternalServerError %+v", 500, o.Payload) +} + +func (o *GetProductInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/products/get_products_parameters.go b/api/blaze/blaze_client/products/get_products_parameters.go new file mode 100644 index 0000000..d32eed3 --- /dev/null +++ b/api/blaze/blaze_client/products/get_products_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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" +) + +// NewGetProductsParams creates a new GetProductsParams object +// with the default values initialized. +func NewGetProductsParams() *GetProductsParams { + + return &GetProductsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProductsParamsWithTimeout creates a new GetProductsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProductsParamsWithTimeout(timeout time.Duration) *GetProductsParams { + + return &GetProductsParams{ + + timeout: timeout, + } +} + +// NewGetProductsParamsWithContext creates a new GetProductsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProductsParamsWithContext(ctx context.Context) *GetProductsParams { + + return &GetProductsParams{ + + Context: ctx, + } +} + +// NewGetProductsParamsWithHTTPClient creates a new GetProductsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProductsParamsWithHTTPClient(client *http.Client) *GetProductsParams { + + return &GetProductsParams{ + HTTPClient: client, + } +} + +/*GetProductsParams contains all the parameters to send to the API endpoint +for the get products operation typically these are written to a http.Request +*/ +type GetProductsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get products params +func (o *GetProductsParams) WithTimeout(timeout time.Duration) *GetProductsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get products params +func (o *GetProductsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get products params +func (o *GetProductsParams) WithContext(ctx context.Context) *GetProductsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get products params +func (o *GetProductsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get products params +func (o *GetProductsParams) WithHTTPClient(client *http.Client) *GetProductsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get products params +func (o *GetProductsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProductsParams) 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/blaze/blaze_client/products/get_products_responses.go b/api/blaze/blaze_client/products/get_products_responses.go new file mode 100644 index 0000000..a2c9e26 --- /dev/null +++ b/api/blaze/blaze_client/products/get_products_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetProductsReader is a Reader for the GetProducts structure. +type GetProductsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProductsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetProductsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetProductsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetProductsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetProductsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetProductsOK creates a GetProductsOK with default headers values +func NewGetProductsOK() *GetProductsOK { + return &GetProductsOK{} +} + +/*GetProductsOK handles this case with default header values. + +Products were successfully retrieved +*/ +type GetProductsOK struct { + Payload *blaze_models.ProductsResponse +} + +func (o *GetProductsOK) Error() string { + return fmt.Sprintf("[GET /partner/products][%d] getProductsOK %+v", 200, o.Payload) +} + +func (o *GetProductsOK) GetPayload() *blaze_models.ProductsResponse { + return o.Payload +} + +func (o *GetProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.ProductsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsUnauthorized creates a GetProductsUnauthorized with default headers values +func NewGetProductsUnauthorized() *GetProductsUnauthorized { + return &GetProductsUnauthorized{} +} + +/*GetProductsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetProductsUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetProductsUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/products][%d] getProductsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetProductsUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsForbidden creates a GetProductsForbidden with default headers values +func NewGetProductsForbidden() *GetProductsForbidden { + return &GetProductsForbidden{} +} + +/*GetProductsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetProductsForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetProductsForbidden) Error() string { + return fmt.Sprintf("[GET /partner/products][%d] getProductsForbidden %+v", 403, o.Payload) +} + +func (o *GetProductsForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsNotFound creates a GetProductsNotFound with default headers values +func NewGetProductsNotFound() *GetProductsNotFound { + return &GetProductsNotFound{} +} + +/*GetProductsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetProductsNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetProductsNotFound) Error() string { + return fmt.Sprintf("[GET /partner/products][%d] getProductsNotFound %+v", 404, o.Payload) +} + +func (o *GetProductsNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsInternalServerError creates a GetProductsInternalServerError with default headers values +func NewGetProductsInternalServerError() *GetProductsInternalServerError { + return &GetProductsInternalServerError{} +} + +/*GetProductsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetProductsInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetProductsInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/products][%d] getProductsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetProductsInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetProductsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/products/products_client.go b/api/blaze/blaze_client/products/products_client.go new file mode 100644 index 0000000..13f0eee --- /dev/null +++ b/api/blaze/blaze_client/products/products_client.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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 products API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for products API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductOK, error) + + GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetProduct Get A Product +*/ +func (a *Client) GetProduct(params *GetProductParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProductParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getProduct", + Method: "GET", + PathPattern: "/partner/products/{productId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetProductReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProductOK) + 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 getProduct: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetProducts Get All Products +*/ +func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProductsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getProducts", + Method: "GET", + PathPattern: "/partner/products", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetProductsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProductsOK) + 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 getProducts: 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/blaze/blaze_client/purchase_orders/get_purchase_order_list_parameters.go b/api/blaze/blaze_client/purchase_orders/get_purchase_order_list_parameters.go new file mode 100644 index 0000000..b10d215 --- /dev/null +++ b/api/blaze/blaze_client/purchase_orders/get_purchase_order_list_parameters.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" +) + +// NewGetPurchaseOrderListParams creates a new GetPurchaseOrderListParams object +// with the default values initialized. +func NewGetPurchaseOrderListParams() *GetPurchaseOrderListParams { + var () + return &GetPurchaseOrderListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPurchaseOrderListParamsWithTimeout creates a new GetPurchaseOrderListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPurchaseOrderListParamsWithTimeout(timeout time.Duration) *GetPurchaseOrderListParams { + var () + return &GetPurchaseOrderListParams{ + + timeout: timeout, + } +} + +// NewGetPurchaseOrderListParamsWithContext creates a new GetPurchaseOrderListParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPurchaseOrderListParamsWithContext(ctx context.Context) *GetPurchaseOrderListParams { + var () + return &GetPurchaseOrderListParams{ + + Context: ctx, + } +} + +// NewGetPurchaseOrderListParamsWithHTTPClient creates a new GetPurchaseOrderListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPurchaseOrderListParamsWithHTTPClient(client *http.Client) *GetPurchaseOrderListParams { + var () + return &GetPurchaseOrderListParams{ + HTTPClient: client, + } +} + +/*GetPurchaseOrderListParams contains all the parameters to send to the API endpoint +for the get purchase order list operation typically these are written to a http.Request +*/ +type GetPurchaseOrderListParams struct { + + /*EndDate + The end date of transaction query + + */ + EndDate string + /*Limit + The number of records to retrieve + + */ + Limit *float64 + /*Start + The starting record in multi-record retrievals + + */ + Start *float64 + /*StartDate + The start date of transaction query + + */ + StartDate string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get purchase order list params +func (o *GetPurchaseOrderListParams) WithTimeout(timeout time.Duration) *GetPurchaseOrderListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get purchase order list params +func (o *GetPurchaseOrderListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get purchase order list params +func (o *GetPurchaseOrderListParams) WithContext(ctx context.Context) *GetPurchaseOrderListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get purchase order list params +func (o *GetPurchaseOrderListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get purchase order list params +func (o *GetPurchaseOrderListParams) WithHTTPClient(client *http.Client) *GetPurchaseOrderListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get purchase order list params +func (o *GetPurchaseOrderListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the get purchase order list params +func (o *GetPurchaseOrderListParams) WithEndDate(endDate string) *GetPurchaseOrderListParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get purchase order list params +func (o *GetPurchaseOrderListParams) SetEndDate(endDate string) { + o.EndDate = endDate +} + +// WithLimit adds the limit to the get purchase order list params +func (o *GetPurchaseOrderListParams) WithLimit(limit *float64) *GetPurchaseOrderListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get purchase order list params +func (o *GetPurchaseOrderListParams) SetLimit(limit *float64) { + o.Limit = limit +} + +// WithStart adds the start to the get purchase order list params +func (o *GetPurchaseOrderListParams) WithStart(start *float64) *GetPurchaseOrderListParams { + o.SetStart(start) + return o +} + +// SetStart adds the start to the get purchase order list params +func (o *GetPurchaseOrderListParams) SetStart(start *float64) { + o.Start = start +} + +// WithStartDate adds the startDate to the get purchase order list params +func (o *GetPurchaseOrderListParams) WithStartDate(startDate string) *GetPurchaseOrderListParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get purchase order list params +func (o *GetPurchaseOrderListParams) SetStartDate(startDate string) { + o.StartDate = startDate +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPurchaseOrderListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param endDate + qrEndDate := o.EndDate + qEndDate := qrEndDate + if qEndDate != "" { + if err := r.SetQueryParam("endDate", qEndDate); err != nil { + return err + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit float64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatFloat64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Start != nil { + + // query param start + var qrStart float64 + if o.Start != nil { + qrStart = *o.Start + } + qStart := swag.FormatFloat64(qrStart) + if qStart != "" { + if err := r.SetQueryParam("start", qStart); err != nil { + return err + } + } + + } + + // query param startDate + qrStartDate := o.StartDate + qStartDate := qrStartDate + if qStartDate != "" { + if err := r.SetQueryParam("startDate", qStartDate); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/blaze/blaze_client/purchase_orders/get_purchase_order_list_responses.go b/api/blaze/blaze_client/purchase_orders/get_purchase_order_list_responses.go new file mode 100644 index 0000000..c2d256b --- /dev/null +++ b/api/blaze/blaze_client/purchase_orders/get_purchase_order_list_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetPurchaseOrderListReader is a Reader for the GetPurchaseOrderList structure. +type GetPurchaseOrderListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPurchaseOrderListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPurchaseOrderListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPurchaseOrderListUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPurchaseOrderListForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPurchaseOrderListNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPurchaseOrderListInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPurchaseOrderListOK creates a GetPurchaseOrderListOK with default headers values +func NewGetPurchaseOrderListOK() *GetPurchaseOrderListOK { + return &GetPurchaseOrderListOK{} +} + +/*GetPurchaseOrderListOK handles this case with default header values. + +Shop was successfully retrieved +*/ +type GetPurchaseOrderListOK struct { + Payload *blaze_models.PurchaseOrderListResponse +} + +func (o *GetPurchaseOrderListOK) Error() string { + return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListOK %+v", 200, o.Payload) +} + +func (o *GetPurchaseOrderListOK) GetPayload() *blaze_models.PurchaseOrderListResponse { + return o.Payload +} + +func (o *GetPurchaseOrderListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.PurchaseOrderListResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrderListUnauthorized creates a GetPurchaseOrderListUnauthorized with default headers values +func NewGetPurchaseOrderListUnauthorized() *GetPurchaseOrderListUnauthorized { + return &GetPurchaseOrderListUnauthorized{} +} + +/*GetPurchaseOrderListUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPurchaseOrderListUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetPurchaseOrderListUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPurchaseOrderListUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrderListUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrderListForbidden creates a GetPurchaseOrderListForbidden with default headers values +func NewGetPurchaseOrderListForbidden() *GetPurchaseOrderListForbidden { + return &GetPurchaseOrderListForbidden{} +} + +/*GetPurchaseOrderListForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPurchaseOrderListForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetPurchaseOrderListForbidden) Error() string { + return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListForbidden %+v", 403, o.Payload) +} + +func (o *GetPurchaseOrderListForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrderListForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrderListNotFound creates a GetPurchaseOrderListNotFound with default headers values +func NewGetPurchaseOrderListNotFound() *GetPurchaseOrderListNotFound { + return &GetPurchaseOrderListNotFound{} +} + +/*GetPurchaseOrderListNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPurchaseOrderListNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetPurchaseOrderListNotFound) Error() string { + return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListNotFound %+v", 404, o.Payload) +} + +func (o *GetPurchaseOrderListNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrderListNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrderListInternalServerError creates a GetPurchaseOrderListInternalServerError with default headers values +func NewGetPurchaseOrderListInternalServerError() *GetPurchaseOrderListInternalServerError { + return &GetPurchaseOrderListInternalServerError{} +} + +/*GetPurchaseOrderListInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPurchaseOrderListInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetPurchaseOrderListInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPurchaseOrderListInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrderListInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/purchase_orders/purchase_orders_client.go b/api/blaze/blaze_client/purchase_orders/purchase_orders_client.go new file mode 100644 index 0000000..c69e983 --- /dev/null +++ b/api/blaze/blaze_client/purchase_orders/purchase_orders_client.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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 purchase orders API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for purchase orders API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrderListOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPurchaseOrderList Get a list of purchase orders +*/ +func (a *Client) GetPurchaseOrderList(params *GetPurchaseOrderListParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrderListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPurchaseOrderListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPurchaseOrderList", + Method: "GET", + PathPattern: "/partner/store/purchaseOrder/list", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetPurchaseOrderListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPurchaseOrderListOK) + 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 getPurchaseOrderList: 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/blaze/blaze_client/shop/get_shop_parameters.go b/api/blaze/blaze_client/shop/get_shop_parameters.go new file mode 100644 index 0000000..213e5ba --- /dev/null +++ b/api/blaze/blaze_client/shop/get_shop_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package shop + +// 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" +) + +// NewGetShopParams creates a new GetShopParams object +// with the default values initialized. +func NewGetShopParams() *GetShopParams { + + return &GetShopParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetShopParamsWithTimeout creates a new GetShopParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetShopParamsWithTimeout(timeout time.Duration) *GetShopParams { + + return &GetShopParams{ + + timeout: timeout, + } +} + +// NewGetShopParamsWithContext creates a new GetShopParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetShopParamsWithContext(ctx context.Context) *GetShopParams { + + return &GetShopParams{ + + Context: ctx, + } +} + +// NewGetShopParamsWithHTTPClient creates a new GetShopParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetShopParamsWithHTTPClient(client *http.Client) *GetShopParams { + + return &GetShopParams{ + HTTPClient: client, + } +} + +/*GetShopParams contains all the parameters to send to the API endpoint +for the get shop operation typically these are written to a http.Request +*/ +type GetShopParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get shop params +func (o *GetShopParams) WithTimeout(timeout time.Duration) *GetShopParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get shop params +func (o *GetShopParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get shop params +func (o *GetShopParams) WithContext(ctx context.Context) *GetShopParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get shop params +func (o *GetShopParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get shop params +func (o *GetShopParams) WithHTTPClient(client *http.Client) *GetShopParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get shop params +func (o *GetShopParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetShopParams) 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/blaze/blaze_client/shop/get_shop_responses.go b/api/blaze/blaze_client/shop/get_shop_responses.go new file mode 100644 index 0000000..c4d4d30 --- /dev/null +++ b/api/blaze/blaze_client/shop/get_shop_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package shop + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetShopReader is a Reader for the GetShop structure. +type GetShopReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetShopReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetShopOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetShopUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetShopForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetShopNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetShopInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetShopOK creates a GetShopOK with default headers values +func NewGetShopOK() *GetShopOK { + return &GetShopOK{} +} + +/*GetShopOK handles this case with default header values. + +Shop was successfully retrieved +*/ +type GetShopOK struct { + Payload *blaze_models.ShopResponse +} + +func (o *GetShopOK) Error() string { + return fmt.Sprintf("[GET /partner/store][%d] getShopOK %+v", 200, o.Payload) +} + +func (o *GetShopOK) GetPayload() *blaze_models.ShopResponse { + return o.Payload +} + +func (o *GetShopOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.ShopResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetShopUnauthorized creates a GetShopUnauthorized with default headers values +func NewGetShopUnauthorized() *GetShopUnauthorized { + return &GetShopUnauthorized{} +} + +/*GetShopUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetShopUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetShopUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/store][%d] getShopUnauthorized %+v", 401, o.Payload) +} + +func (o *GetShopUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetShopUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetShopForbidden creates a GetShopForbidden with default headers values +func NewGetShopForbidden() *GetShopForbidden { + return &GetShopForbidden{} +} + +/*GetShopForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetShopForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetShopForbidden) Error() string { + return fmt.Sprintf("[GET /partner/store][%d] getShopForbidden %+v", 403, o.Payload) +} + +func (o *GetShopForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetShopForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetShopNotFound creates a GetShopNotFound with default headers values +func NewGetShopNotFound() *GetShopNotFound { + return &GetShopNotFound{} +} + +/*GetShopNotFound handles this case with default header values. + +Resource was not found +*/ +type GetShopNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetShopNotFound) Error() string { + return fmt.Sprintf("[GET /partner/store][%d] getShopNotFound %+v", 404, o.Payload) +} + +func (o *GetShopNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetShopNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetShopInternalServerError creates a GetShopInternalServerError with default headers values +func NewGetShopInternalServerError() *GetShopInternalServerError { + return &GetShopInternalServerError{} +} + +/*GetShopInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetShopInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetShopInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/store][%d] getShopInternalServerError %+v", 500, o.Payload) +} + +func (o *GetShopInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetShopInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/shop/shop_client.go b/api/blaze/blaze_client/shop/shop_client.go new file mode 100644 index 0000000..3454bd2 --- /dev/null +++ b/api/blaze/blaze_client/shop/shop_client.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package shop + +// 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 shop API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for shop API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter) (*GetShopOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetShop Get basic Shop parameters +*/ +func (a *Client) GetShop(params *GetShopParams, authInfo runtime.ClientAuthInfoWriter) (*GetShopOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetShopParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getShop", + Method: "GET", + PathPattern: "/partner/store", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetShopReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetShopOK) + 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 getShop: 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/blaze/blaze_client/transactions/get_transaction_by_id_parameters.go b/api/blaze/blaze_client/transactions/get_transaction_by_id_parameters.go new file mode 100644 index 0000000..b329196 --- /dev/null +++ b/api/blaze/blaze_client/transactions/get_transaction_by_id_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transactions + +// 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" +) + +// NewGetTransactionByIDParams creates a new GetTransactionByIDParams object +// with the default values initialized. +func NewGetTransactionByIDParams() *GetTransactionByIDParams { + var () + return &GetTransactionByIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTransactionByIDParamsWithTimeout creates a new GetTransactionByIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTransactionByIDParamsWithTimeout(timeout time.Duration) *GetTransactionByIDParams { + var () + return &GetTransactionByIDParams{ + + timeout: timeout, + } +} + +// NewGetTransactionByIDParamsWithContext creates a new GetTransactionByIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTransactionByIDParamsWithContext(ctx context.Context) *GetTransactionByIDParams { + var () + return &GetTransactionByIDParams{ + + Context: ctx, + } +} + +// NewGetTransactionByIDParamsWithHTTPClient creates a new GetTransactionByIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTransactionByIDParamsWithHTTPClient(client *http.Client) *GetTransactionByIDParams { + var () + return &GetTransactionByIDParams{ + HTTPClient: client, + } +} + +/*GetTransactionByIDParams contains all the parameters to send to the API endpoint +for the get transaction by Id operation typically these are written to a http.Request +*/ +type GetTransactionByIDParams struct { + + /*ItemNumber + The Blaze Transaction Number + + */ + ItemNumber string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get transaction by Id params +func (o *GetTransactionByIDParams) WithTimeout(timeout time.Duration) *GetTransactionByIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get transaction by Id params +func (o *GetTransactionByIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get transaction by Id params +func (o *GetTransactionByIDParams) WithContext(ctx context.Context) *GetTransactionByIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get transaction by Id params +func (o *GetTransactionByIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get transaction by Id params +func (o *GetTransactionByIDParams) WithHTTPClient(client *http.Client) *GetTransactionByIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get transaction by Id params +func (o *GetTransactionByIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithItemNumber adds the itemNumber to the get transaction by Id params +func (o *GetTransactionByIDParams) WithItemNumber(itemNumber string) *GetTransactionByIDParams { + o.SetItemNumber(itemNumber) + return o +} + +// SetItemNumber adds the itemNumber to the get transaction by Id params +func (o *GetTransactionByIDParams) SetItemNumber(itemNumber string) { + o.ItemNumber = itemNumber +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTransactionByIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param itemNumber + if err := r.SetPathParam("itemNumber", o.ItemNumber); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/blaze/blaze_client/transactions/get_transaction_by_id_responses.go b/api/blaze/blaze_client/transactions/get_transaction_by_id_responses.go new file mode 100644 index 0000000..42c312c --- /dev/null +++ b/api/blaze/blaze_client/transactions/get_transaction_by_id_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transactions + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetTransactionByIDReader is a Reader for the GetTransactionByID structure. +type GetTransactionByIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTransactionByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTransactionByIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTransactionByIDUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTransactionByIDForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTransactionByIDNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTransactionByIDInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTransactionByIDOK creates a GetTransactionByIDOK with default headers values +func NewGetTransactionByIDOK() *GetTransactionByIDOK { + return &GetTransactionByIDOK{} +} + +/*GetTransactionByIDOK handles this case with default header values. + +A Transaction was successfully retrieved +*/ +type GetTransactionByIDOK struct { + Payload *blaze_models.TransactionByIDResponse +} + +func (o *GetTransactionByIDOK) Error() string { + return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdOK %+v", 200, o.Payload) +} + +func (o *GetTransactionByIDOK) GetPayload() *blaze_models.TransactionByIDResponse { + return o.Payload +} + +func (o *GetTransactionByIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.TransactionByIDResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionByIDUnauthorized creates a GetTransactionByIDUnauthorized with default headers values +func NewGetTransactionByIDUnauthorized() *GetTransactionByIDUnauthorized { + return &GetTransactionByIDUnauthorized{} +} + +/*GetTransactionByIDUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTransactionByIDUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionByIDUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTransactionByIDUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionByIDUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionByIDForbidden creates a GetTransactionByIDForbidden with default headers values +func NewGetTransactionByIDForbidden() *GetTransactionByIDForbidden { + return &GetTransactionByIDForbidden{} +} + +/*GetTransactionByIDForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTransactionByIDForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionByIDForbidden) Error() string { + return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdForbidden %+v", 403, o.Payload) +} + +func (o *GetTransactionByIDForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionByIDForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionByIDNotFound creates a GetTransactionByIDNotFound with default headers values +func NewGetTransactionByIDNotFound() *GetTransactionByIDNotFound { + return &GetTransactionByIDNotFound{} +} + +/*GetTransactionByIDNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTransactionByIDNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionByIDNotFound) Error() string { + return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdNotFound %+v", 404, o.Payload) +} + +func (o *GetTransactionByIDNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionByIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionByIDInternalServerError creates a GetTransactionByIDInternalServerError with default headers values +func NewGetTransactionByIDInternalServerError() *GetTransactionByIDInternalServerError { + return &GetTransactionByIDInternalServerError{} +} + +/*GetTransactionByIDInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTransactionByIDInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionByIDInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/transactions/{itemNumber}][%d] getTransactionByIdInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTransactionByIDInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionByIDInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/transactions/get_transactions_parameters.go b/api/blaze/blaze_client/transactions/get_transactions_parameters.go new file mode 100644 index 0000000..fe17e3a --- /dev/null +++ b/api/blaze/blaze_client/transactions/get_transactions_parameters.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transactions + +// 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" +) + +// NewGetTransactionsParams creates a new GetTransactionsParams object +// with the default values initialized. +func NewGetTransactionsParams() *GetTransactionsParams { + var () + return &GetTransactionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTransactionsParamsWithTimeout creates a new GetTransactionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTransactionsParamsWithTimeout(timeout time.Duration) *GetTransactionsParams { + var () + return &GetTransactionsParams{ + + timeout: timeout, + } +} + +// NewGetTransactionsParamsWithContext creates a new GetTransactionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTransactionsParamsWithContext(ctx context.Context) *GetTransactionsParams { + var () + return &GetTransactionsParams{ + + Context: ctx, + } +} + +// NewGetTransactionsParamsWithHTTPClient creates a new GetTransactionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTransactionsParamsWithHTTPClient(client *http.Client) *GetTransactionsParams { + var () + return &GetTransactionsParams{ + HTTPClient: client, + } +} + +/*GetTransactionsParams contains all the parameters to send to the API endpoint +for the get transactions operation typically these are written to a http.Request +*/ +type GetTransactionsParams struct { + + /*EndDate + The end date of transaction query + + */ + EndDate string + /*Limit + The number of records to retrieve + + */ + Limit *float64 + /*Start + The starting record in multi-record retrievals + + */ + Start *float64 + /*StartDate + The start date of transaction query + + */ + StartDate string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get transactions params +func (o *GetTransactionsParams) WithTimeout(timeout time.Duration) *GetTransactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get transactions params +func (o *GetTransactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get transactions params +func (o *GetTransactionsParams) WithContext(ctx context.Context) *GetTransactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get transactions params +func (o *GetTransactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get transactions params +func (o *GetTransactionsParams) WithHTTPClient(client *http.Client) *GetTransactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get transactions params +func (o *GetTransactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the get transactions params +func (o *GetTransactionsParams) WithEndDate(endDate string) *GetTransactionsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get transactions params +func (o *GetTransactionsParams) SetEndDate(endDate string) { + o.EndDate = endDate +} + +// WithLimit adds the limit to the get transactions params +func (o *GetTransactionsParams) WithLimit(limit *float64) *GetTransactionsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get transactions params +func (o *GetTransactionsParams) SetLimit(limit *float64) { + o.Limit = limit +} + +// WithStart adds the start to the get transactions params +func (o *GetTransactionsParams) WithStart(start *float64) *GetTransactionsParams { + o.SetStart(start) + return o +} + +// SetStart adds the start to the get transactions params +func (o *GetTransactionsParams) SetStart(start *float64) { + o.Start = start +} + +// WithStartDate adds the startDate to the get transactions params +func (o *GetTransactionsParams) WithStartDate(startDate string) *GetTransactionsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get transactions params +func (o *GetTransactionsParams) SetStartDate(startDate string) { + o.StartDate = startDate +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param endDate + qrEndDate := o.EndDate + qEndDate := qrEndDate + if qEndDate != "" { + if err := r.SetQueryParam("endDate", qEndDate); err != nil { + return err + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit float64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatFloat64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Start != nil { + + // query param start + var qrStart float64 + if o.Start != nil { + qrStart = *o.Start + } + qStart := swag.FormatFloat64(qrStart) + if qStart != "" { + if err := r.SetQueryParam("start", qStart); err != nil { + return err + } + } + + } + + // query param startDate + qrStartDate := o.StartDate + qStartDate := qrStartDate + if qStartDate != "" { + if err := r.SetQueryParam("startDate", qStartDate); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/blaze/blaze_client/transactions/get_transactions_responses.go b/api/blaze/blaze_client/transactions/get_transactions_responses.go new file mode 100644 index 0000000..89cd24d --- /dev/null +++ b/api/blaze/blaze_client/transactions/get_transactions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transactions + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetTransactionsReader is a Reader for the GetTransactions structure. +type GetTransactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTransactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTransactionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTransactionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTransactionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTransactionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTransactionsOK creates a GetTransactionsOK with default headers values +func NewGetTransactionsOK() *GetTransactionsOK { + return &GetTransactionsOK{} +} + +/*GetTransactionsOK handles this case with default header values. + +Transactions were successfully retrieved +*/ +type GetTransactionsOK struct { + Payload *blaze_models.TransactionsResponse +} + +func (o *GetTransactionsOK) Error() string { + return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsOK %+v", 200, o.Payload) +} + +func (o *GetTransactionsOK) GetPayload() *blaze_models.TransactionsResponse { + return o.Payload +} + +func (o *GetTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.TransactionsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsUnauthorized creates a GetTransactionsUnauthorized with default headers values +func NewGetTransactionsUnauthorized() *GetTransactionsUnauthorized { + return &GetTransactionsUnauthorized{} +} + +/*GetTransactionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTransactionsUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionsUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTransactionsUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsForbidden creates a GetTransactionsForbidden with default headers values +func NewGetTransactionsForbidden() *GetTransactionsForbidden { + return &GetTransactionsForbidden{} +} + +/*GetTransactionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTransactionsForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionsForbidden) Error() string { + return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsForbidden %+v", 403, o.Payload) +} + +func (o *GetTransactionsForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsNotFound creates a GetTransactionsNotFound with default headers values +func NewGetTransactionsNotFound() *GetTransactionsNotFound { + return &GetTransactionsNotFound{} +} + +/*GetTransactionsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTransactionsNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionsNotFound) Error() string { + return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsNotFound %+v", 404, o.Payload) +} + +func (o *GetTransactionsNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsInternalServerError creates a GetTransactionsInternalServerError with default headers values +func NewGetTransactionsInternalServerError() *GetTransactionsInternalServerError { + return &GetTransactionsInternalServerError{} +} + +/*GetTransactionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTransactionsInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetTransactionsInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/transactions][%d] getTransactionsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTransactionsInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/transactions/transactions_client.go b/api/blaze/blaze_client/transactions/transactions_client.go new file mode 100644 index 0000000..19688db --- /dev/null +++ b/api/blaze/blaze_client/transactions/transactions_client.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transactions + +// 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 transactions API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for transactions API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionByIDOK, error) + + GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTransactionByID Get a single transaction by ID +*/ +func (a *Client) GetTransactionByID(params *GetTransactionByIDParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionByIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTransactionByIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTransactionById", + Method: "GET", + PathPattern: "/partner/transactions/{itemNumber}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTransactionByIDReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTransactionByIDOK) + 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 getTransactionById: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTransactions Get a Range of Transactions +*/ +func (a *Client) GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTransactionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTransactions", + Method: "GET", + PathPattern: "/partner/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTransactionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTransactionsOK) + 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 getTransactions: 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/blaze/blaze_client/vendors/get_vendor_parameters.go b/api/blaze/blaze_client/vendors/get_vendor_parameters.go new file mode 100644 index 0000000..b92918d --- /dev/null +++ b/api/blaze/blaze_client/vendors/get_vendor_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendors + +// 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" +) + +// NewGetVendorParams creates a new GetVendorParams object +// with the default values initialized. +func NewGetVendorParams() *GetVendorParams { + var () + return &GetVendorParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetVendorParamsWithTimeout creates a new GetVendorParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetVendorParamsWithTimeout(timeout time.Duration) *GetVendorParams { + var () + return &GetVendorParams{ + + timeout: timeout, + } +} + +// NewGetVendorParamsWithContext creates a new GetVendorParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetVendorParamsWithContext(ctx context.Context) *GetVendorParams { + var () + return &GetVendorParams{ + + Context: ctx, + } +} + +// NewGetVendorParamsWithHTTPClient creates a new GetVendorParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetVendorParamsWithHTTPClient(client *http.Client) *GetVendorParams { + var () + return &GetVendorParams{ + HTTPClient: client, + } +} + +/*GetVendorParams contains all the parameters to send to the API endpoint +for the get vendor operation typically these are written to a http.Request +*/ +type GetVendorParams struct { + + /*VendorID + The Blaze Vendor Object Id + + */ + VendorID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get vendor params +func (o *GetVendorParams) WithTimeout(timeout time.Duration) *GetVendorParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get vendor params +func (o *GetVendorParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get vendor params +func (o *GetVendorParams) WithContext(ctx context.Context) *GetVendorParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get vendor params +func (o *GetVendorParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get vendor params +func (o *GetVendorParams) WithHTTPClient(client *http.Client) *GetVendorParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get vendor params +func (o *GetVendorParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithVendorID adds the vendorID to the get vendor params +func (o *GetVendorParams) WithVendorID(vendorID string) *GetVendorParams { + o.SetVendorID(vendorID) + return o +} + +// SetVendorID adds the vendorId to the get vendor params +func (o *GetVendorParams) SetVendorID(vendorID string) { + o.VendorID = vendorID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetVendorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param vendorId + if err := r.SetPathParam("vendorId", o.VendorID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/blaze/blaze_client/vendors/get_vendor_responses.go b/api/blaze/blaze_client/vendors/get_vendor_responses.go new file mode 100644 index 0000000..e7e9954 --- /dev/null +++ b/api/blaze/blaze_client/vendors/get_vendor_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendors + +// 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" + + "github.com/taxnexus/go/lib/api/blaze/blaze_models" +) + +// GetVendorReader is a Reader for the GetVendor structure. +type GetVendorReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetVendorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetVendorOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetVendorUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetVendorForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetVendorNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetVendorInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetVendorOK creates a GetVendorOK with default headers values +func NewGetVendorOK() *GetVendorOK { + return &GetVendorOK{} +} + +/*GetVendorOK handles this case with default header values. + +Product was successfully retrieved +*/ +type GetVendorOK struct { + Payload *blaze_models.VendorResponse +} + +func (o *GetVendorOK) Error() string { + return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorOK %+v", 200, o.Payload) +} + +func (o *GetVendorOK) GetPayload() *blaze_models.VendorResponse { + return o.Payload +} + +func (o *GetVendorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.VendorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVendorUnauthorized creates a GetVendorUnauthorized with default headers values +func NewGetVendorUnauthorized() *GetVendorUnauthorized { + return &GetVendorUnauthorized{} +} + +/*GetVendorUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetVendorUnauthorized struct { + Payload *blaze_models.Error +} + +func (o *GetVendorUnauthorized) Error() string { + return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorUnauthorized %+v", 401, o.Payload) +} + +func (o *GetVendorUnauthorized) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetVendorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVendorForbidden creates a GetVendorForbidden with default headers values +func NewGetVendorForbidden() *GetVendorForbidden { + return &GetVendorForbidden{} +} + +/*GetVendorForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetVendorForbidden struct { + Payload *blaze_models.Error +} + +func (o *GetVendorForbidden) Error() string { + return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorForbidden %+v", 403, o.Payload) +} + +func (o *GetVendorForbidden) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetVendorForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVendorNotFound creates a GetVendorNotFound with default headers values +func NewGetVendorNotFound() *GetVendorNotFound { + return &GetVendorNotFound{} +} + +/*GetVendorNotFound handles this case with default header values. + +Resource was not found +*/ +type GetVendorNotFound struct { + Payload *blaze_models.Error +} + +func (o *GetVendorNotFound) Error() string { + return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorNotFound %+v", 404, o.Payload) +} + +func (o *GetVendorNotFound) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetVendorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVendorInternalServerError creates a GetVendorInternalServerError with default headers values +func NewGetVendorInternalServerError() *GetVendorInternalServerError { + return &GetVendorInternalServerError{} +} + +/*GetVendorInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetVendorInternalServerError struct { + Payload *blaze_models.Error +} + +func (o *GetVendorInternalServerError) Error() string { + return fmt.Sprintf("[GET /partner/vendors/{vendorId}][%d] getVendorInternalServerError %+v", 500, o.Payload) +} + +func (o *GetVendorInternalServerError) GetPayload() *blaze_models.Error { + return o.Payload +} + +func (o *GetVendorInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(blaze_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/blaze/blaze_client/vendors/vendors_client.go b/api/blaze/blaze_client/vendors/vendors_client.go new file mode 100644 index 0000000..80650fe --- /dev/null +++ b/api/blaze/blaze_client/vendors/vendors_client.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendors + +// 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 vendors API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for vendors API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter) (*GetVendorOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetVendor Get A Vendor +*/ +func (a *Client) GetVendor(params *GetVendorParams, authInfo runtime.ClientAuthInfoWriter) (*GetVendorOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetVendorParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getVendor", + Method: "GET", + PathPattern: "/partner/vendors/{vendorId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetVendorReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetVendorOK) + 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 getVendor: 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/blaze/blaze_models/error.go b/api/blaze/blaze_models/error.go new file mode 100644 index 0000000..83af0d1 --- /dev/null +++ b/api/blaze/blaze_models/error.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // error + Error string `json:"error,omitempty"` + + // status + // Maximum: 600 + // Minimum: 100 + Status int64 `json:"status,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Error) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := validate.MinimumInt("status", "body", int64(m.Status), 100, false); err != nil { + return err + } + + if err := validate.MaximumInt("status", "body", int64(m.Status), 600, false); err != nil { + return err + } + + 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/blaze/blaze_models/invalid_error.go b/api/blaze/blaze_models/invalid_error.go new file mode 100644 index 0000000..9c4acc8 --- /dev/null +++ b/api/blaze/blaze_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/blaze/blaze_models/member_response.go b/api/blaze/blaze_models/member_response.go new file mode 100644 index 0000000..6b74f93 --- /dev/null +++ b/api/blaze/blaze_models/member_response.go @@ -0,0 +1,855 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MemberResponse member response +// +// swagger:model MemberResponse +type MemberResponse struct { + + // active transaction + ActiveTransaction float64 `json:"activeTransaction,omitempty"` + + // address + Address *MemberResponseAddress `json:"address,omitempty"` + + // addresses + Addresses []string `json:"addresses"` + + // agreement expired + AgreementExpired bool `json:"agreementExpired,omitempty"` + + // anonymous + Anonymous bool `json:"anonymous,omitempty"` + + // ban patient + BanPatient bool `json:"banPatient,omitempty"` + + // cannabis result + CannabisResult string `json:"cannabisResult,omitempty"` + + // care giver list + CareGiverList []string `json:"careGiverList"` + + // care givers + CareGivers []string `json:"careGivers"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // consumer user Id + ConsumerUserID string `json:"consumerUserId,omitempty"` + + // contracts + Contracts []string `json:"contracts"` + + // created + Created int64 `json:"created,omitempty"` + + // current cannabis limit + CurrentCannabisLimit string `json:"currentCannabisLimit,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // dl expired + DlExpired bool `json:"dlExpired,omitempty"` + + // dob + Dob float64 `json:"dob,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // email opt in + EmailOptIn bool `json:"emailOptIn,omitempty"` + + // email verified + EmailVerified bool `json:"emailVerified,omitempty"` + + // enable loyalty + EnableLoyalty bool `json:"enableLoyalty,omitempty"` + + // enabled care giver + EnabledCareGiver bool `json:"enabledCareGiver,omitempty"` + + // exp statuses + ExpStatuses []string `json:"expStatuses"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // identifications + Identifications []*MemberResponseIdentificationsItems0 `json:"identifications"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // in queue + InQueue bool `json:"inQueue,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // last visit date + LastVisitDate int64 `json:"lastVisitDate,omitempty"` + + // lifetime points + LifetimePoints float64 `json:"lifetimePoints,omitempty"` + + // loyalty points + LoyaltyPoints float64 `json:"loyaltyPoints,omitempty"` + + // marketing source + MarketingSource string `json:"marketingSource,omitempty"` + + // medical + Medical bool `json:"medical,omitempty"` + + // member activities + MemberActivities []string `json:"memberActivities"` + + // member group + MemberGroup *MemberResponseMemberGroup `json:"memberGroup,omitempty"` + + // member group Id + MemberGroupID string `json:"memberGroupId,omitempty"` + + // middle name + MiddleName string `json:"middleName,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // notes + Notes []string `json:"notes"` + + // preferences + Preferences []string `json:"preferences"` + + // primary phone + PrimaryPhone string `json:"primaryPhone,omitempty"` + + // qb customer ref + QbCustomerRef []string `json:"qbCustomerRef"` + + // qb desktop customer ref + QbDesktopCustomerRef string `json:"qbDesktopCustomerRef,omitempty"` + + // recent products + RecentProducts []string `json:"recentProducts"` + + // recommendation expired + RecommendationExpired bool `json:"recommendationExpired,omitempty"` + + // recommendation expiry left + RecommendationExpiryLeft float64 `json:"recommendationExpiryLeft,omitempty"` + + // recommendations + Recommendations []*MemberResponseRecommendationsItems0 `json:"recommendations"` + + // region Id + RegionID string `json:"regionId,omitempty"` + + // search text + SearchText string `json:"searchText,omitempty"` + + // sex + Sex float64 `json:"sex,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // start date + StartDate int64 `json:"startDate,omitempty"` + + // state cannabis limit + StateCannabisLimit string `json:"stateCannabisLimit,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` + + // text opt in + TextOptIn bool `json:"textOptIn,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this member response +func (m *MemberResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIdentifications(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMemberGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecommendations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MemberResponse) 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 *MemberResponse) validateIdentifications(formats strfmt.Registry) error { + + if swag.IsZero(m.Identifications) { // not required + return nil + } + + for i := 0; i < len(m.Identifications); i++ { + if swag.IsZero(m.Identifications[i]) { // not required + continue + } + + if m.Identifications[i] != nil { + if err := m.Identifications[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("identifications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MemberResponse) validateMemberGroup(formats strfmt.Registry) error { + + if swag.IsZero(m.MemberGroup) { // not required + return nil + } + + if m.MemberGroup != nil { + if err := m.MemberGroup.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memberGroup") + } + return err + } + } + + return nil +} + +func (m *MemberResponse) validateRecommendations(formats strfmt.Registry) error { + + if swag.IsZero(m.Recommendations) { // not required + return nil + } + + for i := 0; i < len(m.Recommendations); i++ { + if swag.IsZero(m.Recommendations[i]) { // not required + continue + } + + if m.Recommendations[i] != nil { + if err := m.Recommendations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("recommendations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MemberResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MemberResponse) UnmarshalBinary(b []byte) error { + var res MemberResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// MemberResponseAddress member response address +// +// swagger:model MemberResponseAddress +type MemberResponseAddress struct { + + // address + Address string `json:"address,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this member response address +func (m *MemberResponseAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MemberResponseAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MemberResponseAddress) UnmarshalBinary(b []byte) error { + var res MemberResponseAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// MemberResponseIdentificationsItems0 member response identifications items0 +// +// swagger:model MemberResponseIdentificationsItems0 +type MemberResponseIdentificationsItems0 struct { + + // assets + Assets []*MemberResponseIdentificationsItems0AssetsItems0 `json:"assets"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // expiration date + ExpirationDate int64 `json:"expirationDate,omitempty"` + + // front photo + FrontPhoto string `json:"frontPhoto,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // license number + LicenseNumber string `json:"licenseNumber,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this member response identifications items0 +func (m *MemberResponseIdentificationsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MemberResponseIdentificationsItems0) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MemberResponseIdentificationsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MemberResponseIdentificationsItems0) UnmarshalBinary(b []byte) error { + var res MemberResponseIdentificationsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// MemberResponseIdentificationsItems0AssetsItems0 member response identifications items0 assets items0 +// +// swagger:model MemberResponseIdentificationsItems0AssetsItems0 +type MemberResponseIdentificationsItems0AssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this member response identifications items0 assets items0 +func (m *MemberResponseIdentificationsItems0AssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MemberResponseIdentificationsItems0AssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MemberResponseIdentificationsItems0AssetsItems0) UnmarshalBinary(b []byte) error { + var res MemberResponseIdentificationsItems0AssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// MemberResponseMemberGroup member response member group +// +// swagger:model MemberResponseMemberGroup +type MemberResponseMemberGroup struct { + + // active + Active bool `json:"active,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // default group + DefaultGroup bool `json:"defaultGroup,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // discount + Discount float64 `json:"discount,omitempty"` + + // discount type + DiscountType string `json:"discountType,omitempty"` + + // enable promotion + EnablePromotion bool `json:"enablePromotion,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // member count + MemberCount float64 `json:"memberCount,omitempty"` + + // member count email opt in + MemberCountEmailOptIn float64 `json:"memberCountEmailOptIn,omitempty"` + + // member count text opt in + MemberCountTextOptIn float64 `json:"memberCountTextOptIn,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // promotion Id + PromotionID string `json:"promotionId,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this member response member group +func (m *MemberResponseMemberGroup) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MemberResponseMemberGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MemberResponseMemberGroup) UnmarshalBinary(b []byte) error { + var res MemberResponseMemberGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// MemberResponseRecommendationsItems0 member response recommendations items0 +// +// swagger:model MemberResponseRecommendationsItems0 +type MemberResponseRecommendationsItems0 struct { + + // assets + Assets []*MemberResponseRecommendationsItems0AssetsItems0 `json:"assets"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // doctor + Doctor string `json:"doctor,omitempty"` + + // doctor Id + DoctorID string `json:"doctorId,omitempty"` + + // expiration date + ExpirationDate string `json:"expirationDate,omitempty"` + + // front photo + FrontPhoto string `json:"frontPhoto,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // issue date + IssueDate string `json:"issueDate,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // recommendation number + RecommendationNumber string `json:"recommendationNumber,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // verified + Verified bool `json:"verified,omitempty"` + + // verify method + VerifyMethod string `json:"verifyMethod,omitempty"` + + // verify phone number + VerifyPhoneNumber string `json:"verifyPhoneNumber,omitempty"` + + // verify website + VerifyWebsite string `json:"verifyWebsite,omitempty"` +} + +// Validate validates this member response recommendations items0 +func (m *MemberResponseRecommendationsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MemberResponseRecommendationsItems0) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MemberResponseRecommendationsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MemberResponseRecommendationsItems0) UnmarshalBinary(b []byte) error { + var res MemberResponseRecommendationsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// MemberResponseRecommendationsItems0AssetsItems0 member response recommendations items0 assets items0 +// +// swagger:model MemberResponseRecommendationsItems0AssetsItems0 +type MemberResponseRecommendationsItems0AssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this member response recommendations items0 assets items0 +func (m *MemberResponseRecommendationsItems0AssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MemberResponseRecommendationsItems0AssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MemberResponseRecommendationsItems0AssetsItems0) UnmarshalBinary(b []byte) error { + var res MemberResponseRecommendationsItems0AssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_models/message.go b/api/blaze/blaze_models/message.go new file mode 100644 index 0000000..524d500 --- /dev/null +++ b/api/blaze/blaze_models/message.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Message message +// +// swagger:model Message +type Message struct { + + // code + Code float64 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` +} + +// Validate validates this message +func (m *Message) Validate(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/blaze/blaze_models/product_response.go b/api/blaze/blaze_models/product_response.go new file mode 100644 index 0000000..b81b712 --- /dev/null +++ b/api/blaze/blaze_models/product_response.go @@ -0,0 +1,1835 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductResponse product response +// +// swagger:model ProductResponse +type ProductResponse struct { + + // active + Active bool `json:"active,omitempty"` + + // assets + Assets []*ProductResponseAssetsItems0 `json:"assets"` + + // automatic re order + AutomaticReOrder bool `json:"automaticReOrder,omitempty"` + + // brand + Brand string `json:"brand,omitempty"` + + // brand Id + BrandID string `json:"brandId,omitempty"` + + // brand name + BrandName string `json:"brandName,omitempty"` + + // bundle item results + BundleItemResults []string `json:"bundleItemResults"` + + // bundle items + BundleItems []*ProductResponseBundleItemsItems0 `json:"bundleItems"` + + // by gram + ByGram bool `json:"byGram,omitempty"` + + // by prepackage + ByPrepackage bool `json:"byPrepackage,omitempty"` + + // cannabis type + CannabisType string `json:"cannabisType,omitempty"` + + // category + Category *ProductResponseCategory `json:"category,omitempty"` + + // category Id + CategoryID string `json:"categoryId,omitempty"` + + // cbd + Cbd float64 `json:"cbd,omitempty"` + + // cbda + Cbda float64 `json:"cbda,omitempty"` + + // cbn + Cbn float64 `json:"cbn,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // company link Id + CompanyLinkID string `json:"companyLinkId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // custom gram type + CustomGramType string `json:"customGramType,omitempty"` + + // custom tax info + CustomTaxInfo string `json:"customTaxInfo,omitempty"` + + // custom weight + CustomWeight float64 `json:"customWeight,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // discountable + Discountable bool `json:"discountable,omitempty"` + + // enable excise tax + EnableExciseTax bool `json:"enableExciseTax,omitempty"` + + // enable mix match + EnableMixMatch bool `json:"enableMixMatch,omitempty"` + + // enable weedmap + EnableWeedmap bool `json:"enableWeedmap,omitempty"` + + // flower type + FlowerType string `json:"flowerType,omitempty"` + + // genetics + Genetics string `json:"genetics,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // import src + ImportSrc string `json:"importSrc,omitempty"` + + // low inventory notification + LowInventoryNotification bool `json:"lowInventoryNotification,omitempty"` + + // low threshold + LowThreshold float64 `json:"lowThreshold,omitempty"` + + // medical conditions + MedicalConditions []string `json:"medicalConditions"` + + // medicinal + Medicinal bool `json:"medicinal,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // notes + Notes []string `json:"notes"` + + // potency + Potency bool `json:"potency,omitempty"` + + // potency amount + PotencyAmount *ProductResponsePotencyAmount `json:"potencyAmount,omitempty"` + + // price breaks + PriceBreaks []*ProductResponsePriceBreaksItems0 `json:"priceBreaks"` + + // price includes a l excise + PriceIncludesALExcise bool `json:"priceIncludesALExcise,omitempty"` + + // price includes excise + PriceIncludesExcise bool `json:"priceIncludesExcise,omitempty"` + + // price ranges + PriceRanges []string `json:"priceRanges"` + + // pricing template Id + PricingTemplateID string `json:"pricingTemplateId,omitempty"` + + // product sale type + ProductSaleType string `json:"productSaleType,omitempty"` + + // product type + ProductType string `json:"productType,omitempty"` + + // qb desktop item ref + QbDesktopItemRef string `json:"qbDesktopItemRef,omitempty"` + + // qb item ref + QbItemRef string `json:"qbItemRef,omitempty"` + + // quantities + Quantities []*ProductResponseQuantitiesItems0 `json:"quantities"` + + // quantity available + QuantityAvailable float64 `json:"quantityAvailable,omitempty"` + + // re order level + ReOrderLevel float64 `json:"reOrderLevel,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // show in widget + ShowInWidget bool `json:"showInWidget,omitempty"` + + // sku + Sku string `json:"sku,omitempty"` + + // tags + Tags []string `json:"tags"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax tables + TaxTables []*ProductResponseTaxTablesItems0 `json:"taxTables"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // thc + Thc float64 `json:"thc,omitempty"` + + // thca + Thca float64 `json:"thca,omitempty"` + + // unit price + UnitPrice float64 `json:"unitPrice,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vendor + Vendor *ProductResponseVendor `json:"vendor,omitempty"` + + // vendor Id + VendorID string `json:"vendorId,omitempty"` + + // weight per unit + WeightPerUnit string `json:"weightPerUnit,omitempty"` +} + +// Validate validates this product response +func (m *ProductResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBundleItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCategory(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePotencyAmount(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriceBreaks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuantities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTables(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVendor(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductResponse) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductResponse) validateBundleItems(formats strfmt.Registry) error { + + if swag.IsZero(m.BundleItems) { // not required + return nil + } + + for i := 0; i < len(m.BundleItems); i++ { + if swag.IsZero(m.BundleItems[i]) { // not required + continue + } + + if m.BundleItems[i] != nil { + if err := m.BundleItems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bundleItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductResponse) validateCategory(formats strfmt.Registry) error { + + if swag.IsZero(m.Category) { // not required + return nil + } + + if m.Category != nil { + if err := m.Category.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("category") + } + return err + } + } + + return nil +} + +func (m *ProductResponse) validatePotencyAmount(formats strfmt.Registry) error { + + if swag.IsZero(m.PotencyAmount) { // not required + return nil + } + + if m.PotencyAmount != nil { + if err := m.PotencyAmount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("potencyAmount") + } + return err + } + } + + return nil +} + +func (m *ProductResponse) validatePriceBreaks(formats strfmt.Registry) error { + + if swag.IsZero(m.PriceBreaks) { // not required + return nil + } + + for i := 0; i < len(m.PriceBreaks); i++ { + if swag.IsZero(m.PriceBreaks[i]) { // not required + continue + } + + if m.PriceBreaks[i] != nil { + if err := m.PriceBreaks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("priceBreaks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductResponse) validateQuantities(formats strfmt.Registry) error { + + if swag.IsZero(m.Quantities) { // not required + return nil + } + + for i := 0; i < len(m.Quantities); i++ { + if swag.IsZero(m.Quantities[i]) { // not required + continue + } + + if m.Quantities[i] != nil { + if err := m.Quantities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("quantities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductResponse) validateTaxTables(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTables) { // not required + return nil + } + + for i := 0; i < len(m.TaxTables); i++ { + if swag.IsZero(m.TaxTables[i]) { // not required + continue + } + + if m.TaxTables[i] != nil { + if err := m.TaxTables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductResponse) validateVendor(formats strfmt.Registry) error { + + if swag.IsZero(m.Vendor) { // not required + return nil + } + + if m.Vendor != nil { + if err := m.Vendor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vendor") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponse) UnmarshalBinary(b []byte) error { + var res ProductResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseAssetsItems0 product response assets items0 +// +// swagger:model ProductResponseAssetsItems0 +type ProductResponseAssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response assets items0 +func (m *ProductResponseAssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseAssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseAssetsItems0) UnmarshalBinary(b []byte) error { + var res ProductResponseAssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseBundleItemsItems0 product response bundle items items0 +// +// swagger:model ProductResponseBundleItemsItems0 +type ProductResponseBundleItemsItems0 struct { + + // product Id + ProductID string `json:"productId,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` +} + +// Validate validates this product response bundle items items0 +func (m *ProductResponseBundleItemsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseBundleItemsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseBundleItemsItems0) UnmarshalBinary(b []byte) error { + var res ProductResponseBundleItemsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseCategory product response category +// +// swagger:model ProductResponseCategory +type ProductResponseCategory struct { + + // active + Active bool `json:"active,omitempty"` + + // cannabis + Cannabis bool `json:"cannabis,omitempty"` + + // cannabis type + CannabisType string `json:"cannabisType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // low threshold + LowThreshold float64 `json:"lowThreshold,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // photo + Photo *ProductResponseCategoryPhoto `json:"photo,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // unit type + UnitType string `json:"unitType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response category +func (m *ProductResponseCategory) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePhoto(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductResponseCategory) validatePhoto(formats strfmt.Registry) error { + + if swag.IsZero(m.Photo) { // not required + return nil + } + + if m.Photo != nil { + if err := m.Photo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("category" + "." + "photo") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseCategory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseCategory) UnmarshalBinary(b []byte) error { + var res ProductResponseCategory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseCategoryPhoto product response category photo +// +// swagger:model ProductResponseCategoryPhoto +type ProductResponseCategoryPhoto struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response category photo +func (m *ProductResponseCategoryPhoto) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseCategoryPhoto) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseCategoryPhoto) UnmarshalBinary(b []byte) error { + var res ProductResponseCategoryPhoto + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponsePotencyAmount product response potency amount +// +// swagger:model ProductResponsePotencyAmount +type ProductResponsePotencyAmount struct { + + // cbd + Cbd float64 `json:"cbd,omitempty"` + + // cbda + Cbda float64 `json:"cbda,omitempty"` + + // cbn + Cbn float64 `json:"cbn,omitempty"` + + // thc + Thc float64 `json:"thc,omitempty"` + + // thca + Thca float64 `json:"thca,omitempty"` +} + +// Validate validates this product response potency amount +func (m *ProductResponsePotencyAmount) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponsePotencyAmount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponsePotencyAmount) UnmarshalBinary(b []byte) error { + var res ProductResponsePotencyAmount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponsePriceBreaksItems0 product response price breaks items0 +// +// swagger:model ProductResponsePriceBreaksItems0 +type ProductResponsePriceBreaksItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // price + Price float64 `json:"price,omitempty"` + + // price break type + PriceBreakType string `json:"priceBreakType,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response price breaks items0 +func (m *ProductResponsePriceBreaksItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponsePriceBreaksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponsePriceBreaksItems0) UnmarshalBinary(b []byte) error { + var res ProductResponsePriceBreaksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseQuantitiesItems0 product response quantities items0 +// +// swagger:model ProductResponseQuantitiesItems0 +type ProductResponseQuantitiesItems0 struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // inventory Id + InventoryID string `json:"inventoryId,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response quantities items0 +func (m *ProductResponseQuantitiesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseQuantitiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseQuantitiesItems0) UnmarshalBinary(b []byte) error { + var res ProductResponseQuantitiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseTaxTablesItems0 product response tax tables items0 +// +// swagger:model ProductResponseTaxTablesItems0 +type ProductResponseTaxTablesItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // city tax + CityTax *ProductResponseTaxTablesItems0CityTax `json:"cityTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // county tax + CountyTax *ProductResponseTaxTablesItems0CountyTax `json:"countyTax,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // federal tax + FederalTax *ProductResponseTaxTablesItems0FederalTax `json:"federalTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // state tax + StateTax *ProductResponseTaxTablesItems0StateTax `json:"stateTax,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response tax tables items0 +func (m *ProductResponseTaxTablesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCityTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountyTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFederalTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStateTax(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductResponseTaxTablesItems0) validateCityTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CityTax) { // not required + return nil + } + + if m.CityTax != nil { + if err := m.CityTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cityTax") + } + return err + } + } + + return nil +} + +func (m *ProductResponseTaxTablesItems0) validateCountyTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CountyTax) { // not required + return nil + } + + if m.CountyTax != nil { + if err := m.CountyTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("countyTax") + } + return err + } + } + + return nil +} + +func (m *ProductResponseTaxTablesItems0) validateFederalTax(formats strfmt.Registry) error { + + if swag.IsZero(m.FederalTax) { // not required + return nil + } + + if m.FederalTax != nil { + if err := m.FederalTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("federalTax") + } + return err + } + } + + return nil +} + +func (m *ProductResponseTaxTablesItems0) validateStateTax(formats strfmt.Registry) error { + + if swag.IsZero(m.StateTax) { // not required + return nil + } + + if m.StateTax != nil { + if err := m.StateTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("stateTax") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0) UnmarshalBinary(b []byte) error { + var res ProductResponseTaxTablesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseTaxTablesItems0CityTax product response tax tables items0 city tax +// +// swagger:model ProductResponseTaxTablesItems0CityTax +type ProductResponseTaxTablesItems0CityTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response tax tables items0 city tax +func (m *ProductResponseTaxTablesItems0CityTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0CityTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0CityTax) UnmarshalBinary(b []byte) error { + var res ProductResponseTaxTablesItems0CityTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseTaxTablesItems0CountyTax product response tax tables items0 county tax +// +// swagger:model ProductResponseTaxTablesItems0CountyTax +type ProductResponseTaxTablesItems0CountyTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response tax tables items0 county tax +func (m *ProductResponseTaxTablesItems0CountyTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0CountyTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0CountyTax) UnmarshalBinary(b []byte) error { + var res ProductResponseTaxTablesItems0CountyTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseTaxTablesItems0FederalTax product response tax tables items0 federal tax +// +// swagger:model ProductResponseTaxTablesItems0FederalTax +type ProductResponseTaxTablesItems0FederalTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response tax tables items0 federal tax +func (m *ProductResponseTaxTablesItems0FederalTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0FederalTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0FederalTax) UnmarshalBinary(b []byte) error { + var res ProductResponseTaxTablesItems0FederalTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseTaxTablesItems0StateTax product response tax tables items0 state tax +// +// swagger:model ProductResponseTaxTablesItems0StateTax +type ProductResponseTaxTablesItems0StateTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response tax tables items0 state tax +func (m *ProductResponseTaxTablesItems0StateTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0StateTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseTaxTablesItems0StateTax) UnmarshalBinary(b []byte) error { + var res ProductResponseTaxTablesItems0StateTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseVendor product response vendor +// +// swagger:model ProductResponseVendor +type ProductResponseVendor struct { + + // active + Active bool `json:"active,omitempty"` + + // additional address list + AdditionalAddressList []string `json:"additionalAddressList"` + + // address + Address *ProductResponseVendorAddress `json:"address,omitempty"` + + // arms length type + ArmsLengthType string `json:"armsLengthType,omitempty"` + + // assets + Assets []*ProductResponseVendorAssetsItems0 `json:"assets"` + + // back order enabled + BackOrderEnabled bool `json:"backOrderEnabled,omitempty"` + + // brands + Brands []string `json:"brands"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // company licenses + CompanyLicenses []*ProductResponseVendorCompanyLicensesItems0 `json:"companyLicenses"` + + // company type + CompanyType string `json:"companyType,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // credits + Credits float64 `json:"credits,omitempty"` + + // dba name + DbaName string `json:"dbaName,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // fax + Fax string `json:"fax,omitempty"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // licence type + LicenceType string `json:"licenceType,omitempty"` + + // license expiration date + LicenseExpirationDate float64 `json:"licenseExpirationDate,omitempty"` + + // license number + LicenseNumber string `json:"licenseNumber,omitempty"` + + // mobile number + MobileNumber string `json:"mobileNumber,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // notes + Notes []string `json:"notes"` + + // phone + Phone string `json:"phone,omitempty"` + + // qb desktop ref + QbDesktopRef string `json:"qbDesktopRef,omitempty"` + + // qb vendor ref + QbVendorRef []string `json:"qbVendorRef"` + + // related entity + RelatedEntity bool `json:"relatedEntity,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vendor key + VendorKey string `json:"vendorKey,omitempty"` + + // vendor type + VendorType string `json:"vendorType,omitempty"` + + // website + Website string `json:"website,omitempty"` +} + +// Validate validates this product response vendor +func (m *ProductResponseVendor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCompanyLicenses(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductResponseVendor) 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("vendor" + "." + "address") + } + return err + } + } + + return nil +} + +func (m *ProductResponseVendor) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vendor" + "." + "assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductResponseVendor) validateCompanyLicenses(formats strfmt.Registry) error { + + if swag.IsZero(m.CompanyLicenses) { // not required + return nil + } + + for i := 0; i < len(m.CompanyLicenses); i++ { + if swag.IsZero(m.CompanyLicenses[i]) { // not required + continue + } + + if m.CompanyLicenses[i] != nil { + if err := m.CompanyLicenses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vendor" + "." + "companyLicenses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseVendor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseVendor) UnmarshalBinary(b []byte) error { + var res ProductResponseVendor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseVendorAddress product response vendor address +// +// swagger:model ProductResponseVendorAddress +type ProductResponseVendorAddress struct { + + // address + Address string `json:"address,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this product response vendor address +func (m *ProductResponseVendorAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseVendorAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseVendorAddress) UnmarshalBinary(b []byte) error { + var res ProductResponseVendorAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseVendorAssetsItems0 product response vendor assets items0 +// +// swagger:model ProductResponseVendorAssetsItems0 +type ProductResponseVendorAssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response vendor assets items0 +func (m *ProductResponseVendorAssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseVendorAssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseVendorAssetsItems0) UnmarshalBinary(b []byte) error { + var res ProductResponseVendorAssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductResponseVendorCompanyLicensesItems0 product response vendor company licenses items0 +// +// swagger:model ProductResponseVendorCompanyLicensesItems0 +type ProductResponseVendorCompanyLicensesItems0 struct { + + // company type + CompanyType string `json:"companyType,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // license expiration date + LicenseExpirationDate float64 `json:"licenseExpirationDate,omitempty"` + + // license number + LicenseNumber string `json:"licenseNumber,omitempty"` + + // license type + LicenseType string `json:"licenseType,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // to default + ToDefault bool `json:"toDefault,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this product response vendor company licenses items0 +func (m *ProductResponseVendorCompanyLicensesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductResponseVendorCompanyLicensesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponseVendorCompanyLicensesItems0) UnmarshalBinary(b []byte) error { + var res ProductResponseVendorCompanyLicensesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_models/products_response.go b/api/blaze/blaze_models/products_response.go new file mode 100644 index 0000000..4ce27d1 --- /dev/null +++ b/api/blaze/blaze_models/products_response.go @@ -0,0 +1,908 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductsResponse products response +// +// swagger:model ProductsResponse +type ProductsResponse struct { + + // limit + Limit float64 `json:"limit,omitempty"` + + // skip + Skip float64 `json:"skip,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // values + Values []*ProductsResponseValuesItems0 `json:"values"` +} + +// Validate validates this products response +func (m *ProductsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValues(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductsResponse) validateValues(formats strfmt.Registry) error { + + if swag.IsZero(m.Values) { // not required + return nil + } + + for i := 0; i < len(m.Values); i++ { + if swag.IsZero(m.Values[i]) { // not required + continue + } + + if m.Values[i] != nil { + if err := m.Values[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("values" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponse) UnmarshalBinary(b []byte) error { + var res ProductsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductsResponseValuesItems0 products response values items0 +// +// swagger:model ProductsResponseValuesItems0 +type ProductsResponseValuesItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // assets + Assets []*ProductsResponseValuesItems0AssetsItems0 `json:"assets"` + + // automatic re order + AutomaticReOrder bool `json:"automaticReOrder,omitempty"` + + // brand + Brand string `json:"brand,omitempty"` + + // brand Id + BrandID string `json:"brandId,omitempty"` + + // bundle items + BundleItems []string `json:"bundleItems"` + + // by gram + ByGram bool `json:"byGram,omitempty"` + + // by prepackage + ByPrepackage bool `json:"byPrepackage,omitempty"` + + // cannabis type + CannabisType string `json:"cannabisType,omitempty"` + + // category + Category *ProductsResponseValuesItems0Category `json:"category,omitempty"` + + // category Id + CategoryID string `json:"categoryId,omitempty"` + + // cbd + Cbd float64 `json:"cbd,omitempty"` + + // cbda + Cbda float64 `json:"cbda,omitempty"` + + // cbn + Cbn float64 `json:"cbn,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // company link Id + CompanyLinkID string `json:"companyLinkId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // custom gram type + CustomGramType string `json:"customGramType,omitempty"` + + // custom tax info + CustomTaxInfo string `json:"customTaxInfo,omitempty"` + + // custom weight + CustomWeight float64 `json:"customWeight,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // discountable + Discountable bool `json:"discountable,omitempty"` + + // enable excise tax + EnableExciseTax bool `json:"enableExciseTax,omitempty"` + + // enable mix match + EnableMixMatch bool `json:"enableMixMatch,omitempty"` + + // enable weedmap + EnableWeedmap bool `json:"enableWeedmap,omitempty"` + + // flower type + FlowerType string `json:"flowerType,omitempty"` + + // genetics + Genetics string `json:"genetics,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // import src + ImportSrc string `json:"importSrc,omitempty"` + + // low inventory notification + LowInventoryNotification bool `json:"lowInventoryNotification,omitempty"` + + // low threshold + LowThreshold float64 `json:"lowThreshold,omitempty"` + + // medical conditions + MedicalConditions []string `json:"medicalConditions"` + + // medicinal + Medicinal bool `json:"medicinal,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // notes + Notes []string `json:"notes"` + + // potency + Potency bool `json:"potency,omitempty"` + + // potency amount + PotencyAmount string `json:"potencyAmount,omitempty"` + + // price breaks + PriceBreaks []string `json:"priceBreaks"` + + // price includes a l excise + PriceIncludesALExcise bool `json:"priceIncludesALExcise,omitempty"` + + // price includes excise + PriceIncludesExcise bool `json:"priceIncludesExcise,omitempty"` + + // price ranges + PriceRanges []*ProductsResponseValuesItems0PriceRangesItems0 `json:"priceRanges"` + + // pricing template Id + PricingTemplateID string `json:"pricingTemplateId,omitempty"` + + // product sale type + ProductSaleType string `json:"productSaleType,omitempty"` + + // product type + ProductType string `json:"productType,omitempty"` + + // qb desktop item ref + QbDesktopItemRef string `json:"qbDesktopItemRef,omitempty"` + + // qb item ref + QbItemRef string `json:"qbItemRef,omitempty"` + + // quantities + Quantities []*ProductsResponseValuesItems0QuantitiesItems0 `json:"quantities"` + + // re order level + ReOrderLevel float64 `json:"reOrderLevel,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // show in widget + ShowInWidget bool `json:"showInWidget,omitempty"` + + // sku + Sku string `json:"sku,omitempty"` + + // tags + Tags []string `json:"tags"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax tables + TaxTables []string `json:"taxTables"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // thc + Thc float64 `json:"thc,omitempty"` + + // thca + Thca float64 `json:"thca,omitempty"` + + // unit price + UnitPrice float64 `json:"unitPrice,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vendor + Vendor string `json:"vendor,omitempty"` + + // vendor Id + VendorID string `json:"vendorId,omitempty"` + + // weight per unit + WeightPerUnit string `json:"weightPerUnit,omitempty"` +} + +// Validate validates this products response values items0 +func (m *ProductsResponseValuesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCategory(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriceRanges(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuantities(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductsResponseValuesItems0) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductsResponseValuesItems0) validateCategory(formats strfmt.Registry) error { + + if swag.IsZero(m.Category) { // not required + return nil + } + + if m.Category != nil { + if err := m.Category.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("category") + } + return err + } + } + + return nil +} + +func (m *ProductsResponseValuesItems0) validatePriceRanges(formats strfmt.Registry) error { + + if swag.IsZero(m.PriceRanges) { // not required + return nil + } + + for i := 0; i < len(m.PriceRanges); i++ { + if swag.IsZero(m.PriceRanges[i]) { // not required + continue + } + + if m.PriceRanges[i] != nil { + if err := m.PriceRanges[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("priceRanges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ProductsResponseValuesItems0) validateQuantities(formats strfmt.Registry) error { + + if swag.IsZero(m.Quantities) { // not required + return nil + } + + for i := 0; i < len(m.Quantities); i++ { + if swag.IsZero(m.Quantities[i]) { // not required + continue + } + + if m.Quantities[i] != nil { + if err := m.Quantities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("quantities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponseValuesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponseValuesItems0) UnmarshalBinary(b []byte) error { + var res ProductsResponseValuesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductsResponseValuesItems0AssetsItems0 products response values items0 assets items0 +// +// swagger:model ProductsResponseValuesItems0AssetsItems0 +type ProductsResponseValuesItems0AssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this products response values items0 assets items0 +func (m *ProductsResponseValuesItems0AssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponseValuesItems0AssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponseValuesItems0AssetsItems0) UnmarshalBinary(b []byte) error { + var res ProductsResponseValuesItems0AssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductsResponseValuesItems0Category products response values items0 category +// +// swagger:model ProductsResponseValuesItems0Category +type ProductsResponseValuesItems0Category struct { + + // active + Active bool `json:"active,omitempty"` + + // cannabis + Cannabis bool `json:"cannabis,omitempty"` + + // cannabis type + CannabisType string `json:"cannabisType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // low threshold + LowThreshold string `json:"lowThreshold,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // photo + Photo *ProductsResponseValuesItems0CategoryPhoto `json:"photo,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // unit type + UnitType string `json:"unitType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this products response values items0 category +func (m *ProductsResponseValuesItems0Category) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePhoto(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductsResponseValuesItems0Category) validatePhoto(formats strfmt.Registry) error { + + if swag.IsZero(m.Photo) { // not required + return nil + } + + if m.Photo != nil { + if err := m.Photo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("category" + "." + "photo") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponseValuesItems0Category) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponseValuesItems0Category) UnmarshalBinary(b []byte) error { + var res ProductsResponseValuesItems0Category + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductsResponseValuesItems0CategoryPhoto products response values items0 category photo +// +// swagger:model ProductsResponseValuesItems0CategoryPhoto +type ProductsResponseValuesItems0CategoryPhoto struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this products response values items0 category photo +func (m *ProductsResponseValuesItems0CategoryPhoto) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponseValuesItems0CategoryPhoto) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponseValuesItems0CategoryPhoto) UnmarshalBinary(b []byte) error { + var res ProductsResponseValuesItems0CategoryPhoto + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductsResponseValuesItems0PriceRangesItems0 products response values items0 price ranges items0 +// +// swagger:model ProductsResponseValuesItems0PriceRangesItems0 +type ProductsResponseValuesItems0PriceRangesItems0 struct { + + // id + ID string `json:"id,omitempty"` + + // price + Price float64 `json:"price,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // weight tolerance + WeightTolerance *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance `json:"weightTolerance,omitempty"` + + // weight tolerance Id + WeightToleranceID string `json:"weightToleranceId,omitempty"` +} + +// Validate validates this products response values items0 price ranges items0 +func (m *ProductsResponseValuesItems0PriceRangesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWeightTolerance(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProductsResponseValuesItems0PriceRangesItems0) validateWeightTolerance(formats strfmt.Registry) error { + + if swag.IsZero(m.WeightTolerance) { // not required + return nil + } + + if m.WeightTolerance != nil { + if err := m.WeightTolerance.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weightTolerance") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponseValuesItems0PriceRangesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponseValuesItems0PriceRangesItems0) UnmarshalBinary(b []byte) error { + var res ProductsResponseValuesItems0PriceRangesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductsResponseValuesItems0PriceRangesItems0WeightTolerance products response values items0 price ranges items0 weight tolerance +// +// swagger:model ProductsResponseValuesItems0PriceRangesItems0WeightTolerance +type ProductsResponseValuesItems0PriceRangesItems0WeightTolerance struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this products response values items0 price ranges items0 weight tolerance +func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) UnmarshalBinary(b []byte) error { + var res ProductsResponseValuesItems0PriceRangesItems0WeightTolerance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ProductsResponseValuesItems0QuantitiesItems0 products response values items0 quantities items0 +// +// swagger:model ProductsResponseValuesItems0QuantitiesItems0 +type ProductsResponseValuesItems0QuantitiesItems0 struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // inventory Id + InventoryID string `json:"inventoryId,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this products response values items0 quantities items0 +func (m *ProductsResponseValuesItems0QuantitiesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductsResponseValuesItems0QuantitiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductsResponseValuesItems0QuantitiesItems0) UnmarshalBinary(b []byte) error { + var res ProductsResponseValuesItems0QuantitiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_models/purchase_order_list_response.go b/api/blaze/blaze_models/purchase_order_list_response.go new file mode 100644 index 0000000..4a295ce --- /dev/null +++ b/api/blaze/blaze_models/purchase_order_list_response.go @@ -0,0 +1,2322 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderListResponse purchase order list response +// +// swagger:model PurchaseOrderListResponse +type PurchaseOrderListResponse struct { + + // after date + AfterDate float64 `json:"afterDate,omitempty"` + + // before date + BeforeDate int64 `json:"beforeDate,omitempty"` + + // limit + Limit float64 `json:"limit,omitempty"` + + // skip + Skip float64 `json:"skip,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // values + Values []*PurchaseOrderListResponseValuesItems0 `json:"values"` +} + +// Validate validates this purchase order list response +func (m *PurchaseOrderListResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValues(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponse) validateValues(formats strfmt.Registry) error { + + if swag.IsZero(m.Values) { // not required + return nil + } + + for i := 0; i < len(m.Values); i++ { + if swag.IsZero(m.Values[i]) { // not required + continue + } + + if m.Values[i] != nil { + if err := m.Values[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("values" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponse) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0 purchase order list response values items0 +// +// swagger:model PurchaseOrderListResponseValuesItems0 +type PurchaseOrderListResponseValuesItems0 struct { + + // amount paid + AmountPaid float64 `json:"amountPaid,omitempty"` + + // approved by + ApprovedBy string `json:"approvedBy,omitempty"` + + // approved by member + ApprovedByMember *PurchaseOrderListResponseValuesItems0ApprovedByMember `json:"approvedByMember,omitempty"` + + // approved date + ApprovedDate int64 `json:"approvedDate,omitempty"` + + // approved signature + ApprovedSignature string `json:"approvedSignature,omitempty"` + + // archive + Archive bool `json:"archive,omitempty"` + + // archive date + ArchiveDate string `json:"archiveDate,omitempty"` + + // company asset list + CompanyAssetList []string `json:"companyAssetList"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // company logo + CompanyLogo string `json:"companyLogo,omitempty"` + + // completed by employee Id + CompletedByEmployeeID string `json:"completedByEmployeeId,omitempty"` + + // completed date + CompletedDate int64 `json:"completedDate,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // created by employee Id + CreatedByEmployeeID string `json:"createdByEmployeeId,omitempty"` + + // custom term date + CustomTermDate int64 `json:"customTermDate,omitempty"` + + // customer type + CustomerType string `json:"customerType,omitempty"` + + // decline date + DeclineDate string `json:"declineDate,omitempty"` + + // decline reason + DeclineReason string `json:"declineReason,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // delivered by + DeliveredBy string `json:"deliveredBy,omitempty"` + + // delivery address + DeliveryAddress string `json:"deliveryAddress,omitempty"` + + // delivery charge + DeliveryCharge float64 `json:"deliveryCharge,omitempty"` + + // delivery date + DeliveryDate float64 `json:"deliveryDate,omitempty"` + + // delivery time + DeliveryTime string `json:"deliveryTime,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // discount + Discount float64 `json:"discount,omitempty"` + + // due date + DueDate float64 `json:"dueDate,omitempty"` + + // enable delivery charge + EnableDeliveryCharge bool `json:"enableDeliveryCharge,omitempty"` + + // fees + Fees float64 `json:"fees,omitempty"` + + // flower source type + FlowerSourceType string `json:"flowerSourceType,omitempty"` + + // grand total + GrandTotal float64 `json:"grandTotal,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // license Id + LicenseID string `json:"licenseId,omitempty"` + + // manager receive signature + ManagerReceiveSignature string `json:"managerReceiveSignature,omitempty"` + + // manual close + ManualClose bool `json:"manualClose,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // notes + Notes string `json:"notes,omitempty"` + + // parent p o Id + ParentPOID string `json:"parentPOId,omitempty"` + + // parent p o number + ParentPONumber string `json:"parentPONumber,omitempty"` + + // po activity log + PoActivityLog []*PurchaseOrderListResponseValuesItems0PoActivityLogItems0 `json:"poActivityLog"` + + // po number + PoNumber string `json:"poNumber,omitempty"` + + // po payment options + PoPaymentOptions string `json:"poPaymentOptions,omitempty"` + + // po payment terms + PoPaymentTerms string `json:"poPaymentTerms,omitempty"` + + // po product request list + PoProductRequestList string `json:"poProductRequestList,omitempty"` + + // po product request result list + PoProductRequestResultList []*PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0 `json:"poProductRequestResultList"` + + // po qr code asset + PoQrCodeAsset *PurchaseOrderListResponseValuesItems0PoQrCodeAsset `json:"poQrCodeAsset,omitempty"` + + // po qr code Url + PoQrCodeURL string `json:"poQrCodeUrl,omitempty"` + + // po type + PoType string `json:"poType,omitempty"` + + // podue date + PodueDate int64 `json:"podueDate,omitempty"` + + // purchase order date + PurchaseOrderDate float64 `json:"purchaseOrderDate,omitempty"` + + // purchase order status + PurchaseOrderStatus string `json:"purchaseOrderStatus,omitempty"` + + // qb purchase order ref + QbPurchaseOrderRef string `json:"qbPurchaseOrderRef,omitempty"` + + // received by employee Id + ReceivedByEmployeeID string `json:"receivedByEmployeeId,omitempty"` + + // received date + ReceivedDate int64 `json:"receivedDate,omitempty"` + + // reference + Reference string `json:"reference,omitempty"` + + // shipment bill Id + ShipmentBillID string `json:"shipmentBillId,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // submit for approval date + SubmitForApprovalDate int64 `json:"submitForApprovalDate,omitempty"` + + // tax result + TaxResult *PurchaseOrderListResponseValuesItems0TaxResult `json:"taxResult,omitempty"` + + // terms and condition + TermsAndCondition string `json:"termsAndCondition,omitempty"` + + // total calc tax + TotalCalcTax float64 `json:"totalCalcTax,omitempty"` + + // total cost + TotalCost float64 `json:"totalCost,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // total tax + TotalTax float64 `json:"totalTax,omitempty"` + + // transaction type + TransactionType string `json:"transactionType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vendor + Vendor *PurchaseOrderListResponseValuesItems0Vendor `json:"vendor,omitempty"` + + // vendor Id + VendorID string `json:"vendorId,omitempty"` +} + +// Validate validates this purchase order list response values items0 +func (m *PurchaseOrderListResponseValuesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedByMember(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePoActivityLog(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePoProductRequestResultList(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePoQrCodeAsset(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxResult(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVendor(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0) validateApprovedByMember(formats strfmt.Registry) error { + + if swag.IsZero(m.ApprovedByMember) { // not required + return nil + } + + if m.ApprovedByMember != nil { + if err := m.ApprovedByMember.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("approvedByMember") + } + return err + } + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0) validatePoActivityLog(formats strfmt.Registry) error { + + if swag.IsZero(m.PoActivityLog) { // not required + return nil + } + + for i := 0; i < len(m.PoActivityLog); i++ { + if swag.IsZero(m.PoActivityLog[i]) { // not required + continue + } + + if m.PoActivityLog[i] != nil { + if err := m.PoActivityLog[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("poActivityLog" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0) validatePoProductRequestResultList(formats strfmt.Registry) error { + + if swag.IsZero(m.PoProductRequestResultList) { // not required + return nil + } + + for i := 0; i < len(m.PoProductRequestResultList); i++ { + if swag.IsZero(m.PoProductRequestResultList[i]) { // not required + continue + } + + if m.PoProductRequestResultList[i] != nil { + if err := m.PoProductRequestResultList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("poProductRequestResultList" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0) validatePoQrCodeAsset(formats strfmt.Registry) error { + + if swag.IsZero(m.PoQrCodeAsset) { // not required + return nil + } + + if m.PoQrCodeAsset != nil { + if err := m.PoQrCodeAsset.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("poQrCodeAsset") + } + return err + } + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0) validateTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxResult) { // not required + return nil + } + + if m.TaxResult != nil { + if err := m.TaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxResult") + } + return err + } + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0) validateVendor(formats strfmt.Registry) error { + + if swag.IsZero(m.Vendor) { // not required + return nil + } + + if m.Vendor != nil { + if err := m.Vendor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vendor") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0ApprovedByMember purchase order list response values items0 approved by member +// +// swagger:model PurchaseOrderListResponseValuesItems0ApprovedByMember +type PurchaseOrderListResponseValuesItems0ApprovedByMember struct { + + // address + Address *PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress `json:"address,omitempty"` + + // app access list + AppAccessList []string `json:"appAccessList"` + + // assigned inventory Id + AssignedInventoryID string `json:"assignedInventoryId,omitempty"` + + // assigned terminal Id + AssignedTerminalID string `json:"assignedTerminalId,omitempty"` + + // can apply custom discount + CanApplyCustomDiscount bool `json:"canApplyCustomDiscount,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` + + // dl expiration date + DlExpirationDate string `json:"dlExpirationDate,omitempty"` + + // drivers license + DriversLicense string `json:"driversLicense,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // employee on fleet info list + EmployeeOnFleetInfoList string `json:"employeeOnFleetInfoList,omitempty"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // insurance company name + InsuranceCompanyName string `json:"insuranceCompanyName,omitempty"` + + // insurance expire date + InsuranceExpireDate float64 `json:"insuranceExpireDate,omitempty"` + + // last logged in shop Id + LastLoggedInShopID string `json:"lastLoggedInShopId,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // notes + Notes []string `json:"notes"` + + // password + Password string `json:"password,omitempty"` + + // phone number + PhoneNumber string `json:"phoneNumber,omitempty"` + + // pin + Pin string `json:"pin,omitempty"` + + // policy number + PolicyNumber string `json:"policyNumber,omitempty"` + + // recent location + RecentLocation string `json:"recentLocation,omitempty"` + + // registration expire date + RegistrationExpireDate float64 `json:"registrationExpireDate,omitempty"` + + // role + Role string `json:"role,omitempty"` + + // role Id + RoleID string `json:"roleId,omitempty"` + + // shops + Shops []string `json:"shops"` + + // time card + TimeCard string `json:"timeCard,omitempty"` + + // timecard Id + TimecardID string `json:"timecardId,omitempty"` + + // tookan info list + TookanInfoList string `json:"tookanInfoList,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vehicle license plate + VehicleLicensePlate string `json:"vehicleLicensePlate,omitempty"` + + // vehicle make + VehicleMake string `json:"vehicleMake,omitempty"` + + // vehicle model + VehicleModel string `json:"vehicleModel,omitempty"` + + // vehicle pin + VehiclePin string `json:"vehiclePin,omitempty"` + + // vin no + VinNo string `json:"vinNo,omitempty"` +} + +// Validate validates this purchase order list response values items0 approved by member +func (m *PurchaseOrderListResponseValuesItems0ApprovedByMember) 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 *PurchaseOrderListResponseValuesItems0ApprovedByMember) 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("approvedByMember" + "." + "address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0ApprovedByMember) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0ApprovedByMember) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0ApprovedByMember + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress purchase order list response values items0 approved by member address +// +// swagger:model PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress +type PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress struct { + + // address + Address string `json:"address,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this purchase order list response values items0 approved by member address +func (m *PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0ApprovedByMemberAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoActivityLogItems0 purchase order list response values items0 po activity log items0 +// +// swagger:model PurchaseOrderListResponseValuesItems0PoActivityLogItems0 +type PurchaseOrderListResponseValuesItems0PoActivityLogItems0 struct { + + // activity type + ActivityType string `json:"activityType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // employee Id + EmployeeID string `json:"employeeId,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // log + Log string `json:"log,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // purchase order Id + PurchaseOrderID string `json:"purchaseOrderId,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 po activity log items0 +func (m *PurchaseOrderListResponseValuesItems0PoActivityLogItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoActivityLogItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoActivityLogItems0) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoActivityLogItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0 purchase order list response values items0 po product request result list items0 +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0 +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0 struct { + + // batch add details + BatchAddDetails string `json:"batchAddDetails,omitempty"` + + // batch quantity map + BatchQuantityMap string `json:"batchQuantityMap,omitempty"` + + // cannabis + Cannabis bool `json:"cannabis,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // decline reason + DeclineReason string `json:"declineReason,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // excise tax + ExciseTax float64 `json:"exciseTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // notes + Notes string `json:"notes,omitempty"` + + // product + Product *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product `json:"product,omitempty"` + + // product Id + ProductID string `json:"productId,omitempty"` + + // product name + ProductName string `json:"productName,omitempty"` + + // receive batch status + ReceiveBatchStatus string `json:"receiveBatchStatus,omitempty"` + + // received quantity + ReceivedQuantity float64 `json:"receivedQuantity,omitempty"` + + // request quantity + RequestQuantity float64 `json:"requestQuantity,omitempty"` + + // request status + RequestStatus string `json:"requestStatus,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // total cost + TotalCost float64 `json:"totalCost,omitempty"` + + // total cultivation tax + TotalCultivationTax float64 `json:"totalCultivationTax,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // track trace system + TrackTraceSystem string `json:"trackTraceSystem,omitempty"` + + // tracking packages list + TrackingPackagesList []string `json:"trackingPackagesList"` + + // unit price + UnitPrice float64 `json:"unitPrice,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProduct(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0) validateProduct(formats strfmt.Registry) error { + + if swag.IsZero(m.Product) { // not required + return nil + } + + if m.Product != nil { + if err := m.Product.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("product") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product purchase order list response values items0 po product request result list items0 product +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product struct { + + // active + Active bool `json:"active,omitempty"` + + // assets + Assets []*PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0 `json:"assets"` + + // automatic re order + AutomaticReOrder bool `json:"automaticReOrder,omitempty"` + + // brand + Brand string `json:"brand,omitempty"` + + // brand Id + BrandID string `json:"brandId,omitempty"` + + // bundle items + BundleItems []string `json:"bundleItems"` + + // by gram + ByGram bool `json:"byGram,omitempty"` + + // by prepackage + ByPrepackage bool `json:"byPrepackage,omitempty"` + + // cannabis type + CannabisType string `json:"cannabisType,omitempty"` + + // category + Category *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory `json:"category,omitempty"` + + // category Id + CategoryID string `json:"categoryId,omitempty"` + + // cbd + Cbd float64 `json:"cbd,omitempty"` + + // cbda + Cbda float64 `json:"cbda,omitempty"` + + // cbn + Cbn float64 `json:"cbn,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // company link Id + CompanyLinkID string `json:"companyLinkId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // custom gram type + CustomGramType string `json:"customGramType,omitempty"` + + // custom tax info + CustomTaxInfo string `json:"customTaxInfo,omitempty"` + + // custom weight + CustomWeight float64 `json:"customWeight,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // discountable + Discountable bool `json:"discountable,omitempty"` + + // enable excise tax + EnableExciseTax bool `json:"enableExciseTax,omitempty"` + + // enable mix match + EnableMixMatch bool `json:"enableMixMatch,omitempty"` + + // enable weedmap + EnableWeedmap bool `json:"enableWeedmap,omitempty"` + + // flower type + FlowerType string `json:"flowerType,omitempty"` + + // genetics + Genetics string `json:"genetics,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // import src + ImportSrc string `json:"importSrc,omitempty"` + + // low inventory notification + LowInventoryNotification bool `json:"lowInventoryNotification,omitempty"` + + // low threshold + LowThreshold float64 `json:"lowThreshold,omitempty"` + + // medical conditions + MedicalConditions []string `json:"medicalConditions"` + + // medicinal + Medicinal bool `json:"medicinal,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // notes + Notes []string `json:"notes"` + + // potency + Potency bool `json:"potency,omitempty"` + + // potency amount + PotencyAmount string `json:"potencyAmount,omitempty"` + + // price breaks + PriceBreaks []string `json:"priceBreaks"` + + // price includes a l excise + PriceIncludesALExcise bool `json:"priceIncludesALExcise,omitempty"` + + // price includes excise + PriceIncludesExcise bool `json:"priceIncludesExcise,omitempty"` + + // price ranges + PriceRanges []*PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0 `json:"priceRanges"` + + // pricing template Id + PricingTemplateID string `json:"pricingTemplateId,omitempty"` + + // product sale type + ProductSaleType string `json:"productSaleType,omitempty"` + + // product type + ProductType string `json:"productType,omitempty"` + + // qb desktop item ref + QbDesktopItemRef string `json:"qbDesktopItemRef,omitempty"` + + // qb item ref + QbItemRef string `json:"qbItemRef,omitempty"` + + // quantities + Quantities []*PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0 `json:"quantities"` + + // re order level + ReOrderLevel float64 `json:"reOrderLevel,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // show in widget + ShowInWidget bool `json:"showInWidget,omitempty"` + + // sku + Sku string `json:"sku,omitempty"` + + // tags + Tags []string `json:"tags"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax tables + TaxTables []string `json:"taxTables"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // thc + Thc float64 `json:"thc,omitempty"` + + // thca + Thca float64 `json:"thca,omitempty"` + + // unit price + UnitPrice float64 `json:"unitPrice,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vendor + Vendor string `json:"vendor,omitempty"` + + // vendor Id + VendorID string `json:"vendorId,omitempty"` + + // weight per unit + WeightPerUnit string `json:"weightPerUnit,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 product +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCategory(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriceRanges(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuantities(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("product" + "." + "assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product) validateCategory(formats strfmt.Registry) error { + + if swag.IsZero(m.Category) { // not required + return nil + } + + if m.Category != nil { + if err := m.Category.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("product" + "." + "category") + } + return err + } + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product) validatePriceRanges(formats strfmt.Registry) error { + + if swag.IsZero(m.PriceRanges) { // not required + return nil + } + + for i := 0; i < len(m.PriceRanges); i++ { + if swag.IsZero(m.PriceRanges[i]) { // not required + continue + } + + if m.PriceRanges[i] != nil { + if err := m.PriceRanges[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("product" + "." + "priceRanges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product) validateQuantities(formats strfmt.Registry) error { + + if swag.IsZero(m.Quantities) { // not required + return nil + } + + for i := 0; i < len(m.Quantities); i++ { + if swag.IsZero(m.Quantities[i]) { // not required + continue + } + + if m.Quantities[i] != nil { + if err := m.Quantities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("product" + "." + "quantities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0Product + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0 purchase order list response values items0 po product request result list items0 product assets items0 +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0 +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 product assets items0 +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductAssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory purchase order list response values items0 po product request result list items0 product category +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory struct { + + // active + Active bool `json:"active,omitempty"` + + // cannabis + Cannabis bool `json:"cannabis,omitempty"` + + // cannabis type + CannabisType string `json:"cannabisType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // low threshold + LowThreshold string `json:"lowThreshold,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // photo + Photo *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto `json:"photo,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // unit type + UnitType string `json:"unitType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 product category +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePhoto(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory) validatePhoto(formats strfmt.Registry) error { + + if swag.IsZero(m.Photo) { // not required + return nil + } + + if m.Photo != nil { + if err := m.Photo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("product" + "." + "category" + "." + "photo") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto purchase order list response values items0 po product request result list items0 product category photo +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 product category photo +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductCategoryPhoto + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0 purchase order list response values items0 po product request result list items0 product price ranges items0 +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0 +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0 struct { + + // id + ID string `json:"id,omitempty"` + + // price + Price float64 `json:"price,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // weight tolerance + WeightTolerance *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance `json:"weightTolerance,omitempty"` + + // weight tolerance Id + WeightToleranceID string `json:"weightToleranceId,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 product price ranges items0 +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWeightTolerance(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0) validateWeightTolerance(formats strfmt.Registry) error { + + if swag.IsZero(m.WeightTolerance) { // not required + return nil + } + + if m.WeightTolerance != nil { + if err := m.WeightTolerance.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weightTolerance") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance purchase order list response values items0 po product request result list items0 product price ranges items0 weight tolerance +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 product price ranges items0 weight tolerance +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductPriceRangesItems0WeightTolerance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0 purchase order list response values items0 po product request result list items0 product quantities items0 +// +// swagger:model PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0 +type PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0 struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // inventory Id + InventoryID string `json:"inventoryId,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 po product request result list items0 product quantities items0 +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoProductRequestResultListItems0ProductQuantitiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0PoQrCodeAsset purchase order list response values items0 po qr code asset +// +// swagger:model PurchaseOrderListResponseValuesItems0PoQrCodeAsset +type PurchaseOrderListResponseValuesItems0PoQrCodeAsset struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 po qr code asset +func (m *PurchaseOrderListResponseValuesItems0PoQrCodeAsset) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoQrCodeAsset) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0PoQrCodeAsset) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0PoQrCodeAsset + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0TaxResult purchase order list response values items0 tax result +// +// swagger:model PurchaseOrderListResponseValuesItems0TaxResult +type PurchaseOrderListResponseValuesItems0TaxResult struct { + + // created + Created int64 `json:"created,omitempty"` + + // cultivation tax result + CultivationTaxResult *PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult `json:"cultivationTaxResult,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // total a l excise tax + TotalALExciseTax float64 `json:"totalALExciseTax,omitempty"` + + // total a l post excise tax + TotalALPostExciseTax float64 `json:"totalALPostExciseTax,omitempty"` + + // total city pre tax + TotalCityPreTax float64 `json:"totalCityPreTax,omitempty"` + + // total city tax + TotalCityTax float64 `json:"totalCityTax,omitempty"` + + // total county pre tax + TotalCountyPreTax float64 `json:"totalCountyPreTax,omitempty"` + + // total county tax + TotalCountyTax float64 `json:"totalCountyTax,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // total fed pre tax + TotalFedPreTax float64 `json:"totalFedPreTax,omitempty"` + + // total fed tax + TotalFedTax float64 `json:"totalFedTax,omitempty"` + + // total n a l pre excise tax + TotalNALPreExciseTax float64 `json:"totalNALPreExciseTax,omitempty"` + + // total post calc tax + TotalPostCalcTax float64 `json:"totalPostCalcTax,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // total state pre tax + TotalStatePreTax float64 `json:"totalStatePreTax,omitempty"` + + // total state tax + TotalStateTax float64 `json:"totalStateTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 tax result +func (m *PurchaseOrderListResponseValuesItems0TaxResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCultivationTaxResult(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0TaxResult) validateCultivationTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.CultivationTaxResult) { // not required + return nil + } + + if m.CultivationTaxResult != nil { + if err := m.CultivationTaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxResult" + "." + "cultivationTaxResult") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0TaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0TaxResult) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0TaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult purchase order list response values items0 tax result cultivation tax result +// +// swagger:model PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult +type PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult struct { + + // flower tax oz + FlowerTaxOz float64 `json:"flowerTaxOz,omitempty"` + + // leaf tax oz + LeafTaxOz float64 `json:"leafTaxOz,omitempty"` + + // total cultivation tax + TotalCultivationTax float64 `json:"totalCultivationTax,omitempty"` + + // total flower oz + TotalFlowerOz float64 `json:"totalFlowerOz,omitempty"` + + // total flower tax + TotalFlowerTax float64 `json:"totalFlowerTax,omitempty"` + + // total leaf oz + TotalLeafOz float64 `json:"totalLeafOz,omitempty"` + + // total leaf tax + TotalLeafTax float64 `json:"totalLeafTax,omitempty"` +} + +// Validate validates this purchase order list response values items0 tax result cultivation tax result +func (m *PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0TaxResultCultivationTaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0Vendor purchase order list response values items0 vendor +// +// swagger:model PurchaseOrderListResponseValuesItems0Vendor +type PurchaseOrderListResponseValuesItems0Vendor struct { + + // active + Active bool `json:"active,omitempty"` + + // additional address list + AdditionalAddressList []string `json:"additionalAddressList"` + + // address + Address *PurchaseOrderListResponseValuesItems0VendorAddress `json:"address,omitempty"` + + // arms length type + ArmsLengthType string `json:"armsLengthType,omitempty"` + + // assets + Assets []*PurchaseOrderListResponseValuesItems0VendorAssetsItems0 `json:"assets"` + + // back order enabled + BackOrderEnabled bool `json:"backOrderEnabled,omitempty"` + + // brands + Brands []string `json:"brands"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // company licenses + CompanyLicenses []string `json:"companyLicenses"` + + // company type + CompanyType string `json:"companyType,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // credits + Credits float64 `json:"credits,omitempty"` + + // dba name + DbaName string `json:"dbaName,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // fax + Fax string `json:"fax,omitempty"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // licence type + LicenceType string `json:"licenceType,omitempty"` + + // license expiration date + LicenseExpirationDate float64 `json:"licenseExpirationDate,omitempty"` + + // license number + LicenseNumber string `json:"licenseNumber,omitempty"` + + // mobile number + MobileNumber string `json:"mobileNumber,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // notes + Notes []string `json:"notes"` + + // phone + Phone string `json:"phone,omitempty"` + + // qb desktop ref + QbDesktopRef string `json:"qbDesktopRef,omitempty"` + + // qb vendor ref + QbVendorRef []string `json:"qbVendorRef"` + + // related entity + RelatedEntity bool `json:"relatedEntity,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vendor key + VendorKey string `json:"vendorKey,omitempty"` + + // vendor type + VendorType string `json:"vendorType,omitempty"` + + // website + Website string `json:"website,omitempty"` +} + +// Validate validates this purchase order list response values items0 vendor +func (m *PurchaseOrderListResponseValuesItems0Vendor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0Vendor) 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("vendor" + "." + "address") + } + return err + } + } + + return nil +} + +func (m *PurchaseOrderListResponseValuesItems0Vendor) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vendor" + "." + "assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0Vendor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0Vendor) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0Vendor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0VendorAddress purchase order list response values items0 vendor address +// +// swagger:model PurchaseOrderListResponseValuesItems0VendorAddress +type PurchaseOrderListResponseValuesItems0VendorAddress struct { + + // address + Address string `json:"address,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this purchase order list response values items0 vendor address +func (m *PurchaseOrderListResponseValuesItems0VendorAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0VendorAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0VendorAddress) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0VendorAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PurchaseOrderListResponseValuesItems0VendorAssetsItems0 purchase order list response values items0 vendor assets items0 +// +// swagger:model PurchaseOrderListResponseValuesItems0VendorAssetsItems0 +type PurchaseOrderListResponseValuesItems0VendorAssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this purchase order list response values items0 vendor assets items0 +func (m *PurchaseOrderListResponseValuesItems0VendorAssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0VendorAssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderListResponseValuesItems0VendorAssetsItems0) UnmarshalBinary(b []byte) error { + var res PurchaseOrderListResponseValuesItems0VendorAssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_models/shop_response.go b/api/blaze/blaze_models/shop_response.go new file mode 100644 index 0000000..b5b5685 --- /dev/null +++ b/api/blaze/blaze_models/shop_response.go @@ -0,0 +1,2533 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ShopResponse shop response +// +// swagger:model ShopResponse +type ShopResponse struct { + + // company logo URL + CompanyLogoURL string `json:"companyLogoURL,omitempty"` + + // shop + Shop *ShopResponseShop `json:"shop,omitempty"` + + // tolerance map + ToleranceMap *ShopResponseToleranceMap `json:"toleranceMap,omitempty"` +} + +// Validate validates this shop response +func (m *ShopResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateShop(formats); err != nil { + res = append(res, err) + } + + if err := m.validateToleranceMap(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShopResponse) validateShop(formats strfmt.Registry) error { + + if swag.IsZero(m.Shop) { // not required + return nil + } + + if m.Shop != nil { + if err := m.Shop.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop") + } + return err + } + } + + return nil +} + +func (m *ShopResponse) validateToleranceMap(formats strfmt.Registry) error { + + if swag.IsZero(m.ToleranceMap) { // not required + return nil + } + + if m.ToleranceMap != nil { + if err := m.ToleranceMap.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponse) UnmarshalBinary(b []byte) error { + var res ShopResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShop shop response shop +// +// swagger:model ShopResponseShop +type ShopResponseShop struct { + + // active + Active bool `json:"active,omitempty"` + + // address + Address *ShopResponseShopAddress `json:"address,omitempty"` + + // age limit + AgeLimit float64 `json:"ageLimit,omitempty"` + + // al excise on zero price + AlExciseOnZeroPrice bool `json:"alExciseOnZeroPrice,omitempty"` + + // allow anonymous orders + AllowAnonymousOrders bool `json:"allowAnonymousOrders,omitempty"` + + // app target + AppTarget string `json:"appTarget,omitempty"` + + // assets + Assets []*ShopResponseShopAssetsItems0 `json:"assets"` + + // auto cash drawer + AutoCashDrawer bool `json:"autoCashDrawer,omitempty"` + + // bcc email address + BccEmailAddress string `json:"bccEmailAddress,omitempty"` + + // cart minimums + CartMinimums *ShopResponseShopCartMinimums `json:"cartMinimums,omitempty"` + + // checkout type + CheckoutType string `json:"checkoutType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // credit fefund type + CreditFefundType string `json:"creditFefundType,omitempty"` + + // default country + DefaultCountry string `json:"defaultCountry,omitempty"` + + // default pin timeout + DefaultPinTimeout float64 `json:"defaultPinTimeout,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // delivery fee + DeliveryFee float64 `json:"deliveryFee,omitempty"` + + // delivery refund type + DeliveryRefundType string `json:"deliveryRefundType,omitempty"` + + // email adress + EmailAdress string `json:"emailAdress,omitempty"` + + // email message + EmailMessage string `json:"emailMessage,omitempty"` + + // enable age limit + EnableAgeLimit bool `json:"enableAgeLimit,omitempty"` + + // enable b c c receipt + EnableBCCReceipt bool `json:"enableBCCReceipt,omitempty"` + + // enable cannabis limit + EnableCannabisLimit bool `json:"enableCannabisLimit,omitempty"` + + // enable cash in out + EnableCashInOut bool `json:"enableCashInOut,omitempty"` + + // enable daily summary email + EnableDailySummaryEmail bool `json:"enableDailySummaryEmail,omitempty"` + + // enable delivery fee + EnableDeliveryFee bool `json:"enableDeliveryFee,omitempty"` + + // enable delivery signature + EnableDeliverySignature bool `json:"enableDeliverySignature,omitempty"` + + // enable excise tax + EnableExciseTax bool `json:"enableExciseTax,omitempty"` + + // enable g p s tracking + EnableGPSTracking bool `json:"enableGPSTracking,omitempty"` + + // enable harvest tax + EnableHarvestTax bool `json:"enableHarvestTax,omitempty"` + + // enable low inventory email + EnableLowInventoryEmail bool `json:"enableLowInventoryEmail,omitempty"` + + // enable medicinal age + EnableMedicinalAge bool `json:"enableMedicinalAge,omitempty"` + + // enable on fleet + EnableOnFleet bool `json:"enableOnFleet,omitempty"` + + // enable pin for cash drawer + EnablePinForCashDrawer bool `json:"enablePinForCashDrawer,omitempty"` + + // enable sale logout + EnableSaleLogout bool `json:"enableSaleLogout,omitempty"` + + // enable spring big + EnableSpringBig bool `json:"enableSpringBig,omitempty"` + + // enable tookan + EnableTookan bool `json:"enableTookan,omitempty"` + + // enable woo commerce + EnableWooCommerce bool `json:"enableWooCommerce,omitempty"` + + // enforce cash drawers + EnforceCashDrawers bool `json:"enforceCashDrawers,omitempty"` + + // excise tax type + ExciseTaxType string `json:"exciseTaxType,omitempty"` + + // hub Id + HubID string `json:"hubId,omitempty"` + + // hub name + HubName string `json:"hubName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // invoice note + InvoiceNote string `json:"invoiceNote,omitempty"` + + // invoice term condition + InvoiceTermCondition string `json:"invoiceTermCondition,omitempty"` + + // latitude + Latitude float64 `json:"latitude,omitempty"` + + // legal language + LegalLanguage string `json:"legalLanguage,omitempty"` + + // license + License string `json:"license,omitempty"` + + // logo + Logo *ShopResponseShopLogo `json:"logo,omitempty"` + + // longitude + Longitude float64 `json:"longitude,omitempty"` + + // marketing sources + MarketingSources []string `json:"marketingSources"` + + // medicinal age + MedicinalAge float64 `json:"medicinalAge,omitempty"` + + // members count sync date + MembersCountSyncDate float64 `json:"membersCountSyncDate,omitempty"` + + // members tag + MembersTag []string `json:"membersTag"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // nal excise from retail cost + NalExciseFromRetailCost bool `json:"nalExciseFromRetailCost,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // next snapshot time + NextSnapshotTime int64 `json:"nextSnapshotTime,omitempty"` + + // num allow active trans + NumAllowActiveTrans float64 `json:"numAllowActiveTrans,omitempty"` + + // on fleet Api key + OnFleetAPIKey string `json:"onFleetApiKey,omitempty"` + + // on fleet organization Id + OnFleetOrganizationID string `json:"onFleetOrganizationId,omitempty"` + + // on fleet organization name + OnFleetOrganizationName string `json:"onFleetOrganizationName,omitempty"` + + // online store info + OnlineStoreInfo *ShopResponseShopOnlineStoreInfo `json:"onlineStoreInfo,omitempty"` + + // order tags + OrderTags []string `json:"orderTags"` + + // phone number + PhoneNumber string `json:"phoneNumber,omitempty"` + + // po note + PoNote string `json:"poNote,omitempty"` + + // po term condition + PoTermCondition string `json:"poTermCondition,omitempty"` + + // product price include excise tax + ProductPriceIncludeExciseTax bool `json:"productPriceIncludeExciseTax,omitempty"` + + // products tag + ProductsTag []string `json:"productsTag"` + + // receipt info + ReceiptInfo []*ShopResponseShopReceiptInfoItems0 `json:"receiptInfo"` + + // receiving inventory Id + ReceivingInventoryID string `json:"receivingInventoryId,omitempty"` + + // require valid rec date + RequireValidRecDate bool `json:"requireValidRecDate,omitempty"` + + // restrict incoming order notifications + RestrictIncomingOrderNotifications bool `json:"restrictIncomingOrderNotifications,omitempty"` + + // restricted notification terminals + RestrictedNotificationTerminals []string `json:"restrictedNotificationTerminals"` + + // restricted views + RestrictedViews bool `json:"restrictedViews,omitempty"` + + // round off type + RoundOffType string `json:"roundOffType,omitempty"` + + // round up message + RoundUpMessage string `json:"roundUpMessage,omitempty"` + + // shop type + ShopType string `json:"shopType,omitempty"` + + // short identifier + ShortIdentifier string `json:"shortIdentifier,omitempty"` + + // show delivery queue + ShowDeliveryQueue bool `json:"showDeliveryQueue,omitempty"` + + // show online queue + ShowOnlineQueue bool `json:"showOnlineQueue,omitempty"` + + // show product by available quantity + ShowProductByAvailableQuantity bool `json:"showProductByAvailableQuantity,omitempty"` + + // show special queue + ShowSpecialQueue bool `json:"showSpecialQueue,omitempty"` + + // show walk in queue + ShowWalkInQueue bool `json:"showWalkInQueue,omitempty"` + + // snapshop time + SnapshopTime int64 `json:"snapshopTime,omitempty"` + + // tax info + TaxInfo *ShopResponseShopTaxInfo `json:"taxInfo,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax round off type + TaxRoundOffType string `json:"taxRoundOffType,omitempty"` + + // tax tables + TaxTables []*ShopResponseShopTaxTablesItems0 `json:"taxTables"` + + // time zone + TimeZone string `json:"timeZone,omitempty"` + + // timezone offset in minutes + TimezoneOffsetInMinutes float64 `json:"timezoneOffsetInMinutes,omitempty"` + + // twilio number + TwilioNumber string `json:"twilioNumber,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // use assigned employee + UseAssignedEmployee bool `json:"useAssignedEmployee,omitempty"` + + // use complex tax + UseComplexTax bool `json:"useComplexTax,omitempty"` +} + +// Validate validates this shop response shop +func (m *ShopResponseShop) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCartMinimums(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLogo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOnlineStoreInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceiptInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTables(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShopResponseShop) 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("shop" + "." + "address") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShop) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ShopResponseShop) validateCartMinimums(formats strfmt.Registry) error { + + if swag.IsZero(m.CartMinimums) { // not required + return nil + } + + if m.CartMinimums != nil { + if err := m.CartMinimums.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "cartMinimums") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShop) validateLogo(formats strfmt.Registry) error { + + if swag.IsZero(m.Logo) { // not required + return nil + } + + if m.Logo != nil { + if err := m.Logo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "logo") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShop) validateOnlineStoreInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.OnlineStoreInfo) { // not required + return nil + } + + if m.OnlineStoreInfo != nil { + if err := m.OnlineStoreInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "onlineStoreInfo") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShop) validateReceiptInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.ReceiptInfo) { // not required + return nil + } + + for i := 0; i < len(m.ReceiptInfo); i++ { + if swag.IsZero(m.ReceiptInfo[i]) { // not required + continue + } + + if m.ReceiptInfo[i] != nil { + if err := m.ReceiptInfo[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "receiptInfo" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ShopResponseShop) validateTaxInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxInfo) { // not required + return nil + } + + if m.TaxInfo != nil { + if err := m.TaxInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "taxInfo") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShop) validateTaxTables(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTables) { // not required + return nil + } + + for i := 0; i < len(m.TaxTables); i++ { + if swag.IsZero(m.TaxTables[i]) { // not required + continue + } + + if m.TaxTables[i] != nil { + if err := m.TaxTables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "taxTables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShop) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShop) UnmarshalBinary(b []byte) error { + var res ShopResponseShop + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopAddress shop response shop address +// +// swagger:model ShopResponseShopAddress +type ShopResponseShopAddress struct { + + // address + Address string `json:"address,omitempty"` + + // address line1 + AddressLine1 string `json:"addressLine1,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this shop response shop address +func (m *ShopResponseShopAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopAddress) UnmarshalBinary(b []byte) error { + var res ShopResponseShopAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopAssetsItems0 shop response shop assets items0 +// +// swagger:model ShopResponseShopAssetsItems0 +type ShopResponseShopAssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop assets items0 +func (m *ShopResponseShopAssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopAssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopAssetsItems0) UnmarshalBinary(b []byte) error { + var res ShopResponseShopAssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopCartMinimums shop response shop cart minimums +// +// swagger:model ShopResponseShopCartMinimums +type ShopResponseShopCartMinimums struct { + + // cart minimum details + CartMinimumDetails []*ShopResponseShopCartMinimumsCartMinimumDetailsItems0 `json:"cartMinimumDetails"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // minimums type + MinimumsType string `json:"minimumsType,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop cart minimums +func (m *ShopResponseShopCartMinimums) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCartMinimumDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShopResponseShopCartMinimums) validateCartMinimumDetails(formats strfmt.Registry) error { + + if swag.IsZero(m.CartMinimumDetails) { // not required + return nil + } + + for i := 0; i < len(m.CartMinimumDetails); i++ { + if swag.IsZero(m.CartMinimumDetails[i]) { // not required + continue + } + + if m.CartMinimumDetails[i] != nil { + if err := m.CartMinimumDetails[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shop" + "." + "cartMinimums" + "." + "cartMinimumDetails" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopCartMinimums) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopCartMinimums) UnmarshalBinary(b []byte) error { + var res ShopResponseShopCartMinimums + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopCartMinimumsCartMinimumDetailsItems0 shop response shop cart minimums cart minimum details items0 +// +// swagger:model ShopResponseShopCartMinimumsCartMinimumDetailsItems0 +type ShopResponseShopCartMinimumsCartMinimumDetailsItems0 struct { + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // minimum + Minimum float64 `json:"minimum,omitempty"` +} + +// Validate validates this shop response shop cart minimums cart minimum details items0 +func (m *ShopResponseShopCartMinimumsCartMinimumDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopCartMinimumsCartMinimumDetailsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopCartMinimumsCartMinimumDetailsItems0) UnmarshalBinary(b []byte) error { + var res ShopResponseShopCartMinimumsCartMinimumDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopLogo shop response shop logo +// +// swagger:model ShopResponseShopLogo +type ShopResponseShopLogo struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop logo +func (m *ShopResponseShopLogo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopLogo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopLogo) UnmarshalBinary(b []byte) error { + var res ShopResponseShopLogo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopOnlineStoreInfo shop response shop online store info +// +// swagger:model ShopResponseShopOnlineStoreInfo +type ShopResponseShopOnlineStoreInfo struct { + + // active inventory Id + ActiveInventoryID string `json:"activeInventoryId,omitempty"` + + // cart min type + CartMinType string `json:"cartMinType,omitempty"` + + // cart minimum + CartMinimum float64 `json:"cartMinimum,omitempty"` + + // color theme + ColorTheme string `json:"colorTheme,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // custom message e t a + CustomMessageETA string `json:"customMessageETA,omitempty"` + + // default e t a + DefaultETA float64 `json:"defaultETA,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // enable delivery + EnableDelivery bool `json:"enableDelivery,omitempty"` + + // enable delivery area restrictions + EnableDeliveryAreaRestrictions bool `json:"enableDeliveryAreaRestrictions,omitempty"` + + // enable Html text + EnableHTMLText bool `json:"enableHtmlText,omitempty"` + + // enable inventory + EnableInventory bool `json:"enableInventory,omitempty"` + + // enable inventory type + EnableInventoryType string `json:"enableInventoryType,omitempty"` + + // enable online p o s + EnableOnlinePOS bool `json:"enableOnlinePOS,omitempty"` + + // enable online shipment + EnableOnlineShipment bool `json:"enableOnlineShipment,omitempty"` + + // enable other marketing source + EnableOtherMarketingSource bool `json:"enableOtherMarketingSource,omitempty"` + + // enable product reviews + EnableProductReviews bool `json:"enableProductReviews,omitempty"` + + // enable store pickup + EnableStorePickup bool `json:"enableStorePickup,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // html text + HTMLText string `json:"htmlText,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // page one message body + PageOneMessageBody string `json:"pageOneMessageBody,omitempty"` + + // page one message title + PageOneMessageTitle string `json:"pageOneMessageTitle,omitempty"` + + // restricted zip codes + RestrictedZipCodes []string `json:"restrictedZipCodes"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // store hex color + StoreHexColor string `json:"storeHexColor,omitempty"` + + // submission message + SubmissionMessage string `json:"submissionMessage,omitempty"` + + // support email + SupportEmail string `json:"supportEmail,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // use custom e t a + UseCustomETA bool `json:"useCustomETA,omitempty"` + + // view type + ViewType string `json:"viewType,omitempty"` + + // website origins + WebsiteOrigins string `json:"websiteOrigins,omitempty"` + + // website Url + WebsiteURL string `json:"websiteUrl,omitempty"` +} + +// Validate validates this shop response shop online store info +func (m *ShopResponseShopOnlineStoreInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopOnlineStoreInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopOnlineStoreInfo) UnmarshalBinary(b []byte) error { + var res ShopResponseShopOnlineStoreInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopReceiptInfoItems0 shop response shop receipt info items0 +// +// swagger:model ShopResponseShopReceiptInfoItems0 +type ShopResponseShopReceiptInfoItems0 struct { + + // above free text + AboveFreeText string `json:"aboveFreeText,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // enable brand + EnableBrand bool `json:"enableBrand,omitempty"` + + // enable employee name + EnableEmployeeName bool `json:"enableEmployeeName,omitempty"` + + // enable excise tax as item + EnableExciseTaxAsItem bool `json:"enableExciseTaxAsItem,omitempty"` + + // enable include item in s k u + EnableIncludeItemInSKU bool `json:"enableIncludeItemInSKU,omitempty"` + + // enable member address + EnableMemberAddress bool `json:"enableMemberAddress,omitempty"` + + // enable member Id + EnableMemberID bool `json:"enableMemberId,omitempty"` + + // enable member loyalty points + EnableMemberLoyaltyPoints bool `json:"enableMemberLoyaltyPoints,omitempty"` + + // enable member name + EnableMemberName bool `json:"enableMemberName,omitempty"` + + // enable notes + EnableNotes bool `json:"enableNotes,omitempty"` + + // enable shop address + EnableShopAddress bool `json:"enableShopAddress,omitempty"` + + // enable shop phone no + EnableShopPhoneNo bool `json:"enableShopPhoneNo,omitempty"` + + // enabled bottom free text + EnabledBottomFreeText bool `json:"enabledBottomFreeText,omitempty"` + + // enabled free text + EnabledFreeText bool `json:"enabledFreeText,omitempty"` + + // free text + FreeText string `json:"freeText,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // receipt type + ReceiptType string `json:"receiptType,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop receipt info items0 +func (m *ShopResponseShopReceiptInfoItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopReceiptInfoItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopReceiptInfoItems0) UnmarshalBinary(b []byte) error { + var res ShopResponseShopReceiptInfoItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopTaxInfo shop response shop tax info +// +// swagger:model ShopResponseShopTaxInfo +type ShopResponseShopTaxInfo struct { + + // city tax + CityTax float64 `json:"cityTax,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // federal tax + FederalTax float64 `json:"federalTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state tax + StateTax float64 `json:"stateTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop tax info +func (m *ShopResponseShopTaxInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopTaxInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopTaxInfo) UnmarshalBinary(b []byte) error { + var res ShopResponseShopTaxInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopTaxTablesItems0 shop response shop tax tables items0 +// +// swagger:model ShopResponseShopTaxTablesItems0 +type ShopResponseShopTaxTablesItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // city tax + CityTax *ShopResponseShopTaxTablesItems0CityTax `json:"cityTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // county tax + CountyTax *ShopResponseShopTaxTablesItems0CountyTax `json:"countyTax,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // federal tax + FederalTax *ShopResponseShopTaxTablesItems0FederalTax `json:"federalTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // state tax + StateTax *ShopResponseShopTaxTablesItems0StateTax `json:"stateTax,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop tax tables items0 +func (m *ShopResponseShopTaxTablesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCityTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountyTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFederalTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStateTax(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShopResponseShopTaxTablesItems0) validateCityTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CityTax) { // not required + return nil + } + + if m.CityTax != nil { + if err := m.CityTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cityTax") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShopTaxTablesItems0) validateCountyTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CountyTax) { // not required + return nil + } + + if m.CountyTax != nil { + if err := m.CountyTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("countyTax") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShopTaxTablesItems0) validateFederalTax(formats strfmt.Registry) error { + + if swag.IsZero(m.FederalTax) { // not required + return nil + } + + if m.FederalTax != nil { + if err := m.FederalTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("federalTax") + } + return err + } + } + + return nil +} + +func (m *ShopResponseShopTaxTablesItems0) validateStateTax(formats strfmt.Registry) error { + + if swag.IsZero(m.StateTax) { // not required + return nil + } + + if m.StateTax != nil { + if err := m.StateTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("stateTax") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0) UnmarshalBinary(b []byte) error { + var res ShopResponseShopTaxTablesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopTaxTablesItems0CityTax shop response shop tax tables items0 city tax +// +// swagger:model ShopResponseShopTaxTablesItems0CityTax +type ShopResponseShopTaxTablesItems0CityTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop tax tables items0 city tax +func (m *ShopResponseShopTaxTablesItems0CityTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0CityTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0CityTax) UnmarshalBinary(b []byte) error { + var res ShopResponseShopTaxTablesItems0CityTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopTaxTablesItems0CountyTax shop response shop tax tables items0 county tax +// +// swagger:model ShopResponseShopTaxTablesItems0CountyTax +type ShopResponseShopTaxTablesItems0CountyTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop tax tables items0 county tax +func (m *ShopResponseShopTaxTablesItems0CountyTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0CountyTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0CountyTax) UnmarshalBinary(b []byte) error { + var res ShopResponseShopTaxTablesItems0CountyTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopTaxTablesItems0FederalTax shop response shop tax tables items0 federal tax +// +// swagger:model ShopResponseShopTaxTablesItems0FederalTax +type ShopResponseShopTaxTablesItems0FederalTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop tax tables items0 federal tax +func (m *ShopResponseShopTaxTablesItems0FederalTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0FederalTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0FederalTax) UnmarshalBinary(b []byte) error { + var res ShopResponseShopTaxTablesItems0FederalTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseShopTaxTablesItems0StateTax shop response shop tax tables items0 state tax +// +// swagger:model ShopResponseShopTaxTablesItems0StateTax +type ShopResponseShopTaxTablesItems0StateTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this shop response shop tax tables items0 state tax +func (m *ShopResponseShopTaxTablesItems0StateTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0StateTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseShopTaxTablesItems0StateTax) UnmarshalBinary(b []byte) error { + var res ShopResponseShopTaxTablesItems0StateTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMap shop response tolerance map +// +// swagger:model ShopResponseToleranceMap +type ShopResponseToleranceMap struct { + + // g RAM + GRAM *ShopResponseToleranceMapGRAM `json:"GRAM,omitempty"` + + // h a l f + HALF *ShopResponseToleranceMapHALF `json:"HALF,omitempty"` + + // h a l f g RAM + HALFGRAM *ShopResponseToleranceMapHALFGRAM `json:"HALF_GRAM,omitempty"` + + // o n e e i g h t t h + ONEEIGHTTH *ShopResponseToleranceMapONEEIGHTTH `json:"ONE_EIGHTTH,omitempty"` + + // o u n c e + OUNCE *ShopResponseToleranceMapOUNCE `json:"OUNCE,omitempty"` + + // q u a r t e r + QUARTER *ShopResponseToleranceMapQUARTER `json:"QUARTER,omitempty"` + + // t h r e e g RAM s + THREEGRAMS *ShopResponseToleranceMapTHREEGRAMS `json:"THREE_GRAMS,omitempty"` + + // t w o g RAM s + TWOGRAMS *ShopResponseToleranceMapTWOGRAMS `json:"TWO_GRAMS,omitempty"` +} + +// Validate validates this shop response tolerance map +func (m *ShopResponseToleranceMap) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGRAM(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHALF(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHALFGRAM(formats); err != nil { + res = append(res, err) + } + + if err := m.validateONEEIGHTTH(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOUNCE(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQUARTER(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTHREEGRAMS(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTWOGRAMS(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShopResponseToleranceMap) validateGRAM(formats strfmt.Registry) error { + + if swag.IsZero(m.GRAM) { // not required + return nil + } + + if m.GRAM != nil { + if err := m.GRAM.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "GRAM") + } + return err + } + } + + return nil +} + +func (m *ShopResponseToleranceMap) validateHALF(formats strfmt.Registry) error { + + if swag.IsZero(m.HALF) { // not required + return nil + } + + if m.HALF != nil { + if err := m.HALF.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "HALF") + } + return err + } + } + + return nil +} + +func (m *ShopResponseToleranceMap) validateHALFGRAM(formats strfmt.Registry) error { + + if swag.IsZero(m.HALFGRAM) { // not required + return nil + } + + if m.HALFGRAM != nil { + if err := m.HALFGRAM.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "HALF_GRAM") + } + return err + } + } + + return nil +} + +func (m *ShopResponseToleranceMap) validateONEEIGHTTH(formats strfmt.Registry) error { + + if swag.IsZero(m.ONEEIGHTTH) { // not required + return nil + } + + if m.ONEEIGHTTH != nil { + if err := m.ONEEIGHTTH.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "ONE_EIGHTTH") + } + return err + } + } + + return nil +} + +func (m *ShopResponseToleranceMap) validateOUNCE(formats strfmt.Registry) error { + + if swag.IsZero(m.OUNCE) { // not required + return nil + } + + if m.OUNCE != nil { + if err := m.OUNCE.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "OUNCE") + } + return err + } + } + + return nil +} + +func (m *ShopResponseToleranceMap) validateQUARTER(formats strfmt.Registry) error { + + if swag.IsZero(m.QUARTER) { // not required + return nil + } + + if m.QUARTER != nil { + if err := m.QUARTER.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "QUARTER") + } + return err + } + } + + return nil +} + +func (m *ShopResponseToleranceMap) validateTHREEGRAMS(formats strfmt.Registry) error { + + if swag.IsZero(m.THREEGRAMS) { // not required + return nil + } + + if m.THREEGRAMS != nil { + if err := m.THREEGRAMS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "THREE_GRAMS") + } + return err + } + } + + return nil +} + +func (m *ShopResponseToleranceMap) validateTWOGRAMS(formats strfmt.Registry) error { + + if swag.IsZero(m.TWOGRAMS) { // not required + return nil + } + + if m.TWOGRAMS != nil { + if err := m.TWOGRAMS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("toleranceMap" + "." + "TWO_GRAMS") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMap) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMap) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMap + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapGRAM shop response tolerance map g RAM +// +// swagger:model ShopResponseToleranceMapGRAM +type ShopResponseToleranceMapGRAM struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map g RAM +func (m *ShopResponseToleranceMapGRAM) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapGRAM) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapGRAM) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapGRAM + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapHALF shop response tolerance map h a l f +// +// swagger:model ShopResponseToleranceMapHALF +type ShopResponseToleranceMapHALF struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map h a l f +func (m *ShopResponseToleranceMapHALF) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapHALF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapHALF) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapHALF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapHALFGRAM shop response tolerance map h a l f g RAM +// +// swagger:model ShopResponseToleranceMapHALFGRAM +type ShopResponseToleranceMapHALFGRAM struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map h a l f g RAM +func (m *ShopResponseToleranceMapHALFGRAM) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapHALFGRAM) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapHALFGRAM) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapHALFGRAM + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapONEEIGHTTH shop response tolerance map o n e e i g h t t h +// +// swagger:model ShopResponseToleranceMapONEEIGHTTH +type ShopResponseToleranceMapONEEIGHTTH struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map o n e e i g h t t h +func (m *ShopResponseToleranceMapONEEIGHTTH) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapONEEIGHTTH) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapONEEIGHTTH) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapONEEIGHTTH + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapOUNCE shop response tolerance map o u n c e +// +// swagger:model ShopResponseToleranceMapOUNCE +type ShopResponseToleranceMapOUNCE struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map o u n c e +func (m *ShopResponseToleranceMapOUNCE) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapOUNCE) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapOUNCE) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapOUNCE + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapQUARTER shop response tolerance map q u a r t e r +// +// swagger:model ShopResponseToleranceMapQUARTER +type ShopResponseToleranceMapQUARTER struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map q u a r t e r +func (m *ShopResponseToleranceMapQUARTER) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapQUARTER) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapQUARTER) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapQUARTER + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapTHREEGRAMS shop response tolerance map t h r e e g RAM s +// +// swagger:model ShopResponseToleranceMapTHREEGRAMS +type ShopResponseToleranceMapTHREEGRAMS struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map t h r e e g RAM s +func (m *ShopResponseToleranceMapTHREEGRAMS) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapTHREEGRAMS) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapTHREEGRAMS) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapTHREEGRAMS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ShopResponseToleranceMapTWOGRAMS shop response tolerance map t w o g RAM s +// +// swagger:model ShopResponseToleranceMapTWOGRAMS +type ShopResponseToleranceMapTWOGRAMS struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // end weight + EndWeight float64 `json:"endWeight,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // start weight + StartWeight float64 `json:"startWeight,omitempty"` + + // unit value + UnitValue float64 `json:"unitValue,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` + + // weight value + WeightValue float64 `json:"weightValue,omitempty"` +} + +// Validate validates this shop response tolerance map t w o g RAM s +func (m *ShopResponseToleranceMapTWOGRAMS) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShopResponseToleranceMapTWOGRAMS) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShopResponseToleranceMapTWOGRAMS) UnmarshalBinary(b []byte) error { + var res ShopResponseToleranceMapTWOGRAMS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_models/transaction_by_id_response.go b/api/blaze/blaze_models/transaction_by_id_response.go new file mode 100644 index 0000000..cc8433b --- /dev/null +++ b/api/blaze/blaze_models/transaction_by_id_response.go @@ -0,0 +1,2525 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransactionByIDResponse transaction by Id response +// +// swagger:model TransactionByIdResponse +type TransactionByIDResponse struct { + + // active + Active bool `json:"active,omitempty"` + + // address update + AddressUpdate bool `json:"addressUpdate,omitempty"` + + // assigned + Assigned bool `json:"assigned,omitempty"` + + // assigned employee Id + AssignedEmployeeID string `json:"assignedEmployeeId,omitempty"` + + // cart + Cart *TransactionByIDResponseCart `json:"cart,omitempty"` + + // checkin time + CheckinTime int64 `json:"checkinTime,omitempty"` + + // checkout type + CheckoutType string `json:"checkoutType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // complete after + CompleteAfter int64 `json:"completeAfter,omitempty"` + + // completed time + CompletedTime int64 `json:"completedTime,omitempty"` + + // create onfleet task + CreateOnfleetTask bool `json:"createOnfleetTask,omitempty"` + + // create tookan task + CreateTookanTask bool `json:"createTookanTask,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // created by Id + CreatedByID string `json:"createdById,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // delivery address + DeliveryAddress *TransactionByIDResponseDeliveryAddress `json:"deliveryAddress,omitempty"` + + // delivery date + DeliveryDate int64 `json:"deliveryDate,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // end route date + EndRouteDate int64 `json:"endRouteDate,omitempty"` + + // end time + EndTime int64 `json:"endTime,omitempty"` + + // eta + Eta float64 `json:"eta,omitempty"` + + // fulfilling fulfillment + FulfillingFulfillment bool `json:"fulfillingFulfillment,omitempty"` + + // fulfillment step + FulfillmentStep string `json:"fulfillmentStep,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // loc + Loc []float64 `json:"loc"` + + // locked + Locked bool `json:"locked,omitempty"` + + // member Id + MemberID string `json:"memberId,omitempty"` + + // member signature + MemberSignature *TransactionByIDResponseMemberSignature `json:"memberSignature,omitempty"` + + // memo + Memo string `json:"memo,omitempty"` + + // metrc delivery submit status + MetrcDeliverySubmitStatus string `json:"metrcDeliverySubmitStatus,omitempty"` + + // metrc delivery submit time + MetrcDeliverySubmitTime int64 `json:"metrcDeliverySubmitTime,omitempty"` + + // metrc Id + MetrcID float64 `json:"metrcId,omitempty"` + + // metrc sale time + MetrcSaleTime string `json:"metrcSaleTime,omitempty"` + + // metrc submission complete time + MetrcSubmissionCompleteTime int64 `json:"metrcSubmissionCompleteTime,omitempty"` + + // metrc submission delete time + MetrcSubmissionDeleteTime int64 `json:"metrcSubmissionDeleteTime,omitempty"` + + // mileage + Mileage float64 `json:"mileage,omitempty"` + + // mileage calculated + MileageCalculated bool `json:"mileageCalculated,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // on fleet error + OnFleetError string `json:"onFleetError,omitempty"` + + // on fleet task Id + OnFleetTaskID string `json:"onFleetTaskId,omitempty"` + + // order tags + OrderTags []string `json:"orderTags"` + + // override inventory Id + OverrideInventoryID string `json:"overrideInventoryId,omitempty"` + + // packed by + PackedBy string `json:"packedBy,omitempty"` + + // packed date + PackedDate float64 `json:"packedDate,omitempty"` + + // paid + Paid bool `json:"paid,omitempty"` + + // paying with payment card + PayingWithPaymentCard bool `json:"payingWithPaymentCard,omitempty"` + + // payment edited time + PaymentEditedTime int64 `json:"paymentEditedTime,omitempty"` + + // points earned + PointsEarned float64 `json:"pointsEarned,omitempty"` + + // prepared by + PreparedBy string `json:"preparedBy,omitempty"` + + // preparing fulfillment + PreparingFulfillment bool `json:"preparingFulfillment,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // processed time + ProcessedTime int64 `json:"processedTime,omitempty"` + + // queue type + QueueType string `json:"queueType,omitempty"` + + // refund payment options + RefundPaymentOptions []string `json:"refundPaymentOptions"` + + // routing + Routing bool `json:"routing,omitempty"` + + // seller Id + SellerID string `json:"sellerId,omitempty"` + + // seller terminal Id + SellerTerminalID string `json:"sellerTerminalId,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // short Id + ShortID string `json:"shortId,omitempty"` + + // start route date + StartRouteDate float64 `json:"startRouteDate,omitempty"` + + // start time + StartTime int64 `json:"startTime,omitempty"` + + // state + State float64 `json:"state,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // terminal Id + TerminalID string `json:"terminalId,omitempty"` + + // time zone + TimeZone string `json:"timeZone,omitempty"` + + // trace submit status + TraceSubmitStatus string `json:"traceSubmitStatus,omitempty"` + + // tracking status + TrackingStatus string `json:"trackingStatus,omitempty"` + + // trans no + TransNo string `json:"transNo,omitempty"` + + // trans type + TransType string `json:"transType,omitempty"` + + // transaction refund status + TransactionRefundStatus string `json:"transactionRefundStatus,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by Id response +func (m *TransactionByIDResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMemberSignature(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionByIDResponse) validateCart(formats strfmt.Registry) error { + + if swag.IsZero(m.Cart) { // not required + return nil + } + + if m.Cart != nil { + if err := m.Cart.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponse) validateDeliveryAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.DeliveryAddress) { // not required + return nil + } + + if m.DeliveryAddress != nil { + if err := m.DeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddress") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponse) validateMemberSignature(formats strfmt.Registry) error { + + if swag.IsZero(m.MemberSignature) { // not required + return nil + } + + if m.MemberSignature != nil { + if err := m.MemberSignature.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memberSignature") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponse) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCart transaction by ID response cart +// +// swagger:model TransactionByIDResponseCart +type TransactionByIDResponseCart struct { + + // adjustment amount + AdjustmentAmount float64 `json:"adjustmentAmount,omitempty"` + + // after tax discount + AfterTaxDiscount float64 `json:"afterTaxDiscount,omitempty"` + + // after tax discount notes + AfterTaxDiscountNotes string `json:"afterTaxDiscountNotes,omitempty"` + + // applied after tax discount + AppliedAfterTaxDiscount float64 `json:"appliedAfterTaxDiscount,omitempty"` + + // balance due + BalanceDue float64 `json:"balanceDue,omitempty"` + + // calc cart discount + CalcCartDiscount float64 `json:"calcCartDiscount,omitempty"` + + // cart discount notes + CartDiscountNotes string `json:"cartDiscountNotes,omitempty"` + + // cash received + CashReceived float64 `json:"cashReceived,omitempty"` + + // change due + ChangeDue float64 `json:"changeDue,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // credit card fee + CreditCardFee float64 `json:"creditCardFee,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // delivery discount + DeliveryDiscount float64 `json:"deliveryDiscount,omitempty"` + + // delivery discount type + DeliveryDiscountType string `json:"deliveryDiscountType,omitempty"` + + // delivery fee + DeliveryFee float64 `json:"deliveryFee,omitempty"` + + // discount + Discount float64 `json:"discount,omitempty"` + + // discount type + DiscountType string `json:"discountType,omitempty"` + + // enable credit card fee + EnableCreditCardFee bool `json:"enableCreditCardFee,omitempty"` + + // enable delivery fee + EnableDeliveryFee bool `json:"enableDeliveryFee,omitempty"` + + // final refund amt + FinalRefundAmt float64 `json:"finalRefundAmt,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // items + Items []*TransactionByIDResponseCartItemsItems0 `json:"items"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // payment option + PaymentOption string `json:"paymentOption,omitempty"` + + // payment type + PaymentType string `json:"paymentType,omitempty"` + + // point spent + PointSpent float64 `json:"pointSpent,omitempty"` + + // promo code + PromoCode string `json:"promoCode,omitempty"` + + // promotion req logs + PromotionReqLogs []*TransactionByIDResponseCartPromotionReqLogsItems0 `json:"promotionReqLogs"` + + // promotion reqs + PromotionReqs []*TransactionByIDResponseCartPromotionReqsItems0 `json:"promotionReqs"` + + // refund amount + RefundAmount float64 `json:"refundAmount,omitempty"` + + // refund option + RefundOption string `json:"refundOption,omitempty"` + + // refund order item requests + RefundOrderItemRequests []string `json:"refundOrderItemRequests"` + + // request refund amt + RequestRefundAmt float64 `json:"requestRefundAmt,omitempty"` + + // round amt + RoundAmt float64 `json:"roundAmt,omitempty"` + + // storage location + StorageLocation string `json:"storageLocation,omitempty"` + + // sub total + SubTotal float64 `json:"subTotal,omitempty"` + + // sub total discount + SubTotalDiscount float64 `json:"subTotalDiscount,omitempty"` + + // tax + Tax float64 `json:"tax,omitempty"` + + // tax result + TaxResult *TransactionByIDResponseCartTaxResult `json:"taxResult,omitempty"` + + // tax round off type + TaxRoundOffType string `json:"taxRoundOffType,omitempty"` + + // tax table + TaxTable *TransactionByIDResponseCartTaxTable `json:"taxTable,omitempty"` + + // tip amount + TipAmount float64 `json:"tipAmount,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // total a l excise tax + TotalALExciseTax float64 `json:"totalALExciseTax,omitempty"` + + // total calc tax + TotalCalcTax float64 `json:"totalCalcTax,omitempty"` + + // total discount + TotalDiscount float64 `json:"totalDiscount,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart +func (m *TransactionByIDResponseCart) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePromotionReqLogs(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePromotionReqs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxResult(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTable(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionByIDResponseCart) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionByIDResponseCart) validatePromotionReqLogs(formats strfmt.Registry) error { + + if swag.IsZero(m.PromotionReqLogs) { // not required + return nil + } + + for i := 0; i < len(m.PromotionReqLogs); i++ { + if swag.IsZero(m.PromotionReqLogs[i]) { // not required + continue + } + + if m.PromotionReqLogs[i] != nil { + if err := m.PromotionReqLogs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "promotionReqLogs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionByIDResponseCart) validatePromotionReqs(formats strfmt.Registry) error { + + if swag.IsZero(m.PromotionReqs) { // not required + return nil + } + + for i := 0; i < len(m.PromotionReqs); i++ { + if swag.IsZero(m.PromotionReqs[i]) { // not required + continue + } + + if m.PromotionReqs[i] != nil { + if err := m.PromotionReqs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "promotionReqs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionByIDResponseCart) validateTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxResult) { // not required + return nil + } + + if m.TaxResult != nil { + if err := m.TaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxResult") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCart) validateTaxTable(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTable) { // not required + return nil + } + + if m.TaxTable != nil { + if err := m.TaxTable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCart) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCart) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCart + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0 transaction by ID response cart items items0 +// +// swagger:model TransactionByIDResponseCartItemsItems0 +type TransactionByIDResponseCartItemsItems0 struct { + + // available discount qty + AvailableDiscountQty float64 `json:"availableDiscountQty,omitempty"` + + // calc cultivation tax + CalcCultivationTax float64 `json:"calcCultivationTax,omitempty"` + + // calc discount + CalcDiscount float64 `json:"calcDiscount,omitempty"` + + // calc pre tax + CalcPreTax float64 `json:"calcPreTax,omitempty"` + + // calc tax + CalcTax float64 `json:"calcTax,omitempty"` + + // cogs + Cogs float64 `json:"cogs,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // cost + Cost float64 `json:"cost,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // discount + Discount float64 `json:"discount,omitempty"` + + // discount notes + DiscountNotes string `json:"discountNotes,omitempty"` + + // discount type + DiscountType string `json:"discountType,omitempty"` + + // discounted qty + DiscountedQty float64 `json:"discountedQty,omitempty"` + + // excise tax + ExciseTax float64 `json:"exciseTax,omitempty"` + + // final price + FinalPrice float64 `json:"finalPrice,omitempty"` + + // finalized + Finalized bool `json:"finalized,omitempty"` + + // fulfilled + Fulfilled bool `json:"fulfilled,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // ignore mix match + IgnoreMixMatch bool `json:"ignoreMixMatch,omitempty"` + + // mix matched + MixMatched bool `json:"mixMatched,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // order item Id + OrderItemID string `json:"orderItemId,omitempty"` + + // orig quantity + OrigQuantity float64 `json:"origQuantity,omitempty"` + + // override price + OverridePrice float64 `json:"overridePrice,omitempty"` + + // per unit refund amt + PerUnitRefundAmt float64 `json:"perUnitRefundAmt,omitempty"` + + // prepared qty + PreparedQty float64 `json:"preparedQty,omitempty"` + + // product Id + ProductID string `json:"productId,omitempty"` + + // promotion reqs + PromotionReqs []float64 `json:"promotionReqs"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` + + // quantity logs + QuantityLogs []*TransactionByIDResponseCartItemsItems0QuantityLogsItems0 `json:"quantityLogs"` + + // status + Status string `json:"status,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax result + TaxResult *TransactionByIDResponseCartItemsItems0TaxResult `json:"taxResult,omitempty"` + + // tax table + TaxTable *TransactionByIDResponseCartItemsItems0TaxTable `json:"taxTable,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // total refund amount + TotalRefundAmount float64 `json:"totalRefundAmount,omitempty"` + + // total refund qty + TotalRefundQty float64 `json:"totalRefundQty,omitempty"` + + // unit price + UnitPrice float64 `json:"unitPrice,omitempty"` + + // unit qty + UnitQty float64 `json:"unitQty,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // use unit qty + UseUnitQty bool `json:"useUnitQty,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 +func (m *TransactionByIDResponseCartItemsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateQuantityLogs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxResult(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTable(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0) validateQuantityLogs(formats strfmt.Registry) error { + + if swag.IsZero(m.QuantityLogs) { // not required + return nil + } + + for i := 0; i < len(m.QuantityLogs); i++ { + if swag.IsZero(m.QuantityLogs[i]) { // not required + continue + } + + if m.QuantityLogs[i] != nil { + if err := m.QuantityLogs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("quantityLogs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0) validateTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxResult) { // not required + return nil + } + + if m.TaxResult != nil { + if err := m.TaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxResult") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0) validateTaxTable(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTable) { // not required + return nil + } + + if m.TaxTable != nil { + if err := m.TaxTable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0QuantityLogsItems0 transaction by ID response cart items items0 quantity logs items0 +// +// swagger:model TransactionByIDResponseCartItemsItems0QuantityLogsItems0 +type TransactionByIDResponseCartItemsItems0QuantityLogsItems0 struct { + + // batch Id + BatchID string `json:"batchId,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // inventory Id + InventoryID string `json:"inventoryId,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 quantity logs items0 +func (m *TransactionByIDResponseCartItemsItems0QuantityLogsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0QuantityLogsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0QuantityLogsItems0) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0QuantityLogsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0TaxResult transaction by ID response cart items items0 tax result +// +// swagger:model TransactionByIDResponseCartItemsItems0TaxResult +type TransactionByIDResponseCartItemsItems0TaxResult struct { + + // created + Created int64 `json:"created,omitempty"` + + // cultivation tax result + CultivationTaxResult *TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult `json:"cultivationTaxResult,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // total a l excise tax + TotalALExciseTax float64 `json:"totalALExciseTax,omitempty"` + + // total a l post excise tax + TotalALPostExciseTax float64 `json:"totalALPostExciseTax,omitempty"` + + // total city pre tax + TotalCityPreTax float64 `json:"totalCityPreTax,omitempty"` + + // total city tax + TotalCityTax float64 `json:"totalCityTax,omitempty"` + + // total county pre tax + TotalCountyPreTax float64 `json:"totalCountyPreTax,omitempty"` + + // total county tax + TotalCountyTax float64 `json:"totalCountyTax,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // total fed pre tax + TotalFedPreTax float64 `json:"totalFedPreTax,omitempty"` + + // total fed tax + TotalFedTax float64 `json:"totalFedTax,omitempty"` + + // total n a l pre excise tax + TotalNALPreExciseTax float64 `json:"totalNALPreExciseTax,omitempty"` + + // total post calc tax + TotalPostCalcTax float64 `json:"totalPostCalcTax,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // total state pre tax + TotalStatePreTax float64 `json:"totalStatePreTax,omitempty"` + + // total state tax + TotalStateTax float64 `json:"totalStateTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 tax result +func (m *TransactionByIDResponseCartItemsItems0TaxResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCultivationTaxResult(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0TaxResult) validateCultivationTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.CultivationTaxResult) { // not required + return nil + } + + if m.CultivationTaxResult != nil { + if err := m.CultivationTaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxResult" + "." + "cultivationTaxResult") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxResult) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0TaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult transaction by ID response cart items items0 tax result cultivation tax result +// +// swagger:model TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult +type TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult struct { + + // flower tax oz + FlowerTaxOz float64 `json:"flowerTaxOz,omitempty"` + + // leaf tax oz + LeafTaxOz float64 `json:"leafTaxOz,omitempty"` + + // total cultivation tax + TotalCultivationTax float64 `json:"totalCultivationTax,omitempty"` + + // total flower oz + TotalFlowerOz float64 `json:"totalFlowerOz,omitempty"` + + // total flower tax + TotalFlowerTax float64 `json:"totalFlowerTax,omitempty"` + + // total leaf oz + TotalLeafOz float64 `json:"totalLeafOz,omitempty"` + + // total leaf tax + TotalLeafTax float64 `json:"totalLeafTax,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 tax result cultivation tax result +func (m *TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0TaxResultCultivationTaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0TaxTable transaction by ID response cart items items0 tax table +// +// swagger:model TransactionByIDResponseCartItemsItems0TaxTable +type TransactionByIDResponseCartItemsItems0TaxTable struct { + + // active + Active bool `json:"active,omitempty"` + + // city tax + CityTax *TransactionByIDResponseCartItemsItems0TaxTableCityTax `json:"cityTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // county tax + CountyTax *TransactionByIDResponseCartItemsItems0TaxTableCountyTax `json:"countyTax,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // federal tax + FederalTax *TransactionByIDResponseCartItemsItems0TaxTableFederalTax `json:"federalTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // state tax + StateTax *TransactionByIDResponseCartItemsItems0TaxTableStateTax `json:"stateTax,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 tax table +func (m *TransactionByIDResponseCartItemsItems0TaxTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCityTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountyTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFederalTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStateTax(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0TaxTable) validateCityTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CityTax) { // not required + return nil + } + + if m.CityTax != nil { + if err := m.CityTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "cityTax") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0TaxTable) validateCountyTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CountyTax) { // not required + return nil + } + + if m.CountyTax != nil { + if err := m.CountyTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "countyTax") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0TaxTable) validateFederalTax(formats strfmt.Registry) error { + + if swag.IsZero(m.FederalTax) { // not required + return nil + } + + if m.FederalTax != nil { + if err := m.FederalTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "federalTax") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartItemsItems0TaxTable) validateStateTax(formats strfmt.Registry) error { + + if swag.IsZero(m.StateTax) { // not required + return nil + } + + if m.StateTax != nil { + if err := m.StateTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "stateTax") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTable) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0TaxTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0TaxTableCityTax transaction by ID response cart items items0 tax table city tax +// +// swagger:model TransactionByIDResponseCartItemsItems0TaxTableCityTax +type TransactionByIDResponseCartItemsItems0TaxTableCityTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 tax table city tax +func (m *TransactionByIDResponseCartItemsItems0TaxTableCityTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableCityTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableCityTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0TaxTableCityTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0TaxTableCountyTax transaction by ID response cart items items0 tax table county tax +// +// swagger:model TransactionByIDResponseCartItemsItems0TaxTableCountyTax +type TransactionByIDResponseCartItemsItems0TaxTableCountyTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 tax table county tax +func (m *TransactionByIDResponseCartItemsItems0TaxTableCountyTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableCountyTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableCountyTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0TaxTableCountyTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0TaxTableFederalTax transaction by ID response cart items items0 tax table federal tax +// +// swagger:model TransactionByIDResponseCartItemsItems0TaxTableFederalTax +type TransactionByIDResponseCartItemsItems0TaxTableFederalTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 tax table federal tax +func (m *TransactionByIDResponseCartItemsItems0TaxTableFederalTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableFederalTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableFederalTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0TaxTableFederalTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartItemsItems0TaxTableStateTax transaction by ID response cart items items0 tax table state tax +// +// swagger:model TransactionByIDResponseCartItemsItems0TaxTableStateTax +type TransactionByIDResponseCartItemsItems0TaxTableStateTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart items items0 tax table state tax +func (m *TransactionByIDResponseCartItemsItems0TaxTableStateTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableStateTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartItemsItems0TaxTableStateTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartItemsItems0TaxTableStateTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartPromotionReqLogsItems0 transaction by ID response cart promotion req logs items0 +// +// swagger:model TransactionByIDResponseCartPromotionReqLogsItems0 +type TransactionByIDResponseCartPromotionReqLogsItems0 struct { + + // amount + Amount float64 `json:"amount,omitempty"` + + // assigned + Assigned bool `json:"assigned,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // promotion Id + PromotionID string `json:"promotionId,omitempty"` + + // promotion type + PromotionType string `json:"promotionType,omitempty"` + + // stackable + Stackable bool `json:"stackable,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart promotion req logs items0 +func (m *TransactionByIDResponseCartPromotionReqLogsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartPromotionReqLogsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartPromotionReqLogsItems0) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartPromotionReqLogsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartPromotionReqsItems0 transaction by ID response cart promotion reqs items0 +// +// swagger:model TransactionByIDResponseCartPromotionReqsItems0 +type TransactionByIDResponseCartPromotionReqsItems0 struct { + + // assigned + Assigned bool `json:"assigned,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // promotion Id + PromotionID string `json:"promotionId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart promotion reqs items0 +func (m *TransactionByIDResponseCartPromotionReqsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartPromotionReqsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartPromotionReqsItems0) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartPromotionReqsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxResult transaction by ID response cart tax result +// +// swagger:model TransactionByIDResponseCartTaxResult +type TransactionByIDResponseCartTaxResult struct { + + // created + Created int64 `json:"created,omitempty"` + + // cultivation tax result + CultivationTaxResult *TransactionByIDResponseCartTaxResultCultivationTaxResult `json:"cultivationTaxResult,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // tax mapping info + TaxMappingInfo *TransactionByIDResponseCartTaxResultTaxMappingInfo `json:"taxMappingInfo,omitempty"` + + // total a l excise tax + TotalALExciseTax float64 `json:"totalALExciseTax,omitempty"` + + // total a l post excise tax + TotalALPostExciseTax float64 `json:"totalALPostExciseTax,omitempty"` + + // total city pre tax + TotalCityPreTax float64 `json:"totalCityPreTax,omitempty"` + + // total city tax + TotalCityTax float64 `json:"totalCityTax,omitempty"` + + // total county pre tax + TotalCountyPreTax float64 `json:"totalCountyPreTax,omitempty"` + + // total county tax + TotalCountyTax float64 `json:"totalCountyTax,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // total fed pre tax + TotalFedPreTax float64 `json:"totalFedPreTax,omitempty"` + + // total fed tax + TotalFedTax float64 `json:"totalFedTax,omitempty"` + + // total n a l pre excise tax + TotalNALPreExciseTax float64 `json:"totalNALPreExciseTax,omitempty"` + + // total post calc tax + TotalPostCalcTax float64 `json:"totalPostCalcTax,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // total state pre tax + TotalStatePreTax float64 `json:"totalStatePreTax,omitempty"` + + // total state tax + TotalStateTax float64 `json:"totalStateTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart tax result +func (m *TransactionByIDResponseCartTaxResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCultivationTaxResult(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxMappingInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionByIDResponseCartTaxResult) validateCultivationTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.CultivationTaxResult) { // not required + return nil + } + + if m.CultivationTaxResult != nil { + if err := m.CultivationTaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxResult" + "." + "cultivationTaxResult") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartTaxResult) validateTaxMappingInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxMappingInfo) { // not required + return nil + } + + if m.TaxMappingInfo != nil { + if err := m.TaxMappingInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxResult" + "." + "taxMappingInfo") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxResult) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxResultCultivationTaxResult transaction by ID response cart tax result cultivation tax result +// +// swagger:model TransactionByIDResponseCartTaxResultCultivationTaxResult +type TransactionByIDResponseCartTaxResultCultivationTaxResult struct { + + // flower tax oz + FlowerTaxOz float64 `json:"flowerTaxOz,omitempty"` + + // leaf tax oz + LeafTaxOz float64 `json:"leafTaxOz,omitempty"` + + // plant tax oz + PlantTaxOz float64 `json:"plantTaxOz,omitempty"` + + // total cultivation tax + TotalCultivationTax float64 `json:"totalCultivationTax,omitempty"` + + // total flower oz + TotalFlowerOz float64 `json:"totalFlowerOz,omitempty"` + + // total flower tax + TotalFlowerTax float64 `json:"totalFlowerTax,omitempty"` + + // total leaf oz + TotalLeafOz float64 `json:"totalLeafOz,omitempty"` + + // total leaf tax + TotalLeafTax float64 `json:"totalLeafTax,omitempty"` + + // total plant oz + TotalPlantOz float64 `json:"totalPlantOz,omitempty"` + + // total plant tax + TotalPlantTax float64 `json:"totalPlantTax,omitempty"` +} + +// Validate validates this transaction by ID response cart tax result cultivation tax result +func (m *TransactionByIDResponseCartTaxResultCultivationTaxResult) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxResultCultivationTaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxResultCultivationTaxResult) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxResultCultivationTaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxResultTaxMappingInfo transaction by ID response cart tax result tax mapping info +// +// swagger:model TransactionByIDResponseCartTaxResultTaxMappingInfo +type TransactionByIDResponseCartTaxResultTaxMappingInfo struct { + + // city + City string `json:"City,omitempty"` + + // county + County string `json:"County,omitempty"` + + // federal + Federal string `json:"Federal,omitempty"` + + // state + State string `json:"State,omitempty"` +} + +// Validate validates this transaction by ID response cart tax result tax mapping info +func (m *TransactionByIDResponseCartTaxResultTaxMappingInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxResultTaxMappingInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxResultTaxMappingInfo) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxResultTaxMappingInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxTable transaction by ID response cart tax table +// +// swagger:model TransactionByIDResponseCartTaxTable +type TransactionByIDResponseCartTaxTable struct { + + // active + Active bool `json:"active,omitempty"` + + // city tax + CityTax *TransactionByIDResponseCartTaxTableCityTax `json:"cityTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // county tax + CountyTax *TransactionByIDResponseCartTaxTableCountyTax `json:"countyTax,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // federal tax + FederalTax *TransactionByIDResponseCartTaxTableFederalTax `json:"federalTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // state tax + StateTax *TransactionByIDResponseCartTaxTableStateTax `json:"stateTax,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart tax table +func (m *TransactionByIDResponseCartTaxTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCityTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountyTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFederalTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStateTax(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionByIDResponseCartTaxTable) validateCityTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CityTax) { // not required + return nil + } + + if m.CityTax != nil { + if err := m.CityTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "cityTax") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartTaxTable) validateCountyTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CountyTax) { // not required + return nil + } + + if m.CountyTax != nil { + if err := m.CountyTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "countyTax") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartTaxTable) validateFederalTax(formats strfmt.Registry) error { + + if swag.IsZero(m.FederalTax) { // not required + return nil + } + + if m.FederalTax != nil { + if err := m.FederalTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "federalTax") + } + return err + } + } + + return nil +} + +func (m *TransactionByIDResponseCartTaxTable) validateStateTax(formats strfmt.Registry) error { + + if swag.IsZero(m.StateTax) { // not required + return nil + } + + if m.StateTax != nil { + if err := m.StateTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "stateTax") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTable) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxTableCityTax transaction by ID response cart tax table city tax +// +// swagger:model TransactionByIDResponseCartTaxTableCityTax +type TransactionByIDResponseCartTaxTableCityTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart tax table city tax +func (m *TransactionByIDResponseCartTaxTableCityTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableCityTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableCityTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxTableCityTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxTableCountyTax transaction by ID response cart tax table county tax +// +// swagger:model TransactionByIDResponseCartTaxTableCountyTax +type TransactionByIDResponseCartTaxTableCountyTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart tax table county tax +func (m *TransactionByIDResponseCartTaxTableCountyTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableCountyTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableCountyTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxTableCountyTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxTableFederalTax transaction by ID response cart tax table federal tax +// +// swagger:model TransactionByIDResponseCartTaxTableFederalTax +type TransactionByIDResponseCartTaxTableFederalTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart tax table federal tax +func (m *TransactionByIDResponseCartTaxTableFederalTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableFederalTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableFederalTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxTableFederalTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseCartTaxTableStateTax transaction by ID response cart tax table state tax +// +// swagger:model TransactionByIDResponseCartTaxTableStateTax +type TransactionByIDResponseCartTaxTableStateTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // display name + DisplayName string `json:"displayName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response cart tax table state tax +func (m *TransactionByIDResponseCartTaxTableStateTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableStateTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseCartTaxTableStateTax) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseCartTaxTableStateTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseDeliveryAddress transaction by ID response delivery address +// +// swagger:model TransactionByIDResponseDeliveryAddress +type TransactionByIDResponseDeliveryAddress struct { + + // address + Address string `json:"address,omitempty"` + + // address line2 + AddressLine2 string `json:"addressLine2,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this transaction by ID response delivery address +func (m *TransactionByIDResponseDeliveryAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseDeliveryAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseDeliveryAddress) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseDeliveryAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionByIDResponseMemberSignature transaction by ID response member signature +// +// swagger:model TransactionByIDResponseMemberSignature +type TransactionByIDResponseMemberSignature struct { + + // active + Active bool `json:"active,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transaction by ID response member signature +func (m *TransactionByIDResponseMemberSignature) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionByIDResponseMemberSignature) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionByIDResponseMemberSignature) UnmarshalBinary(b []byte) error { + var res TransactionByIDResponseMemberSignature + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_models/transactions_response.go b/api/blaze/blaze_models/transactions_response.go new file mode 100644 index 0000000..6ed56e4 --- /dev/null +++ b/api/blaze/blaze_models/transactions_response.go @@ -0,0 +1,4091 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransactionsResponse transactions response +// +// swagger:model TransactionsResponse +type TransactionsResponse struct { + + // limit + Limit float64 `json:"limit,omitempty"` + + // skip + Skip float64 `json:"skip,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // values + Values []*TransactionsResponseValuesItems0 `json:"values"` +} + +// Validate validates this transactions response +func (m *TransactionsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValues(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponse) validateValues(formats strfmt.Registry) error { + + if swag.IsZero(m.Values) { // not required + return nil + } + + for i := 0; i < len(m.Values); i++ { + if swag.IsZero(m.Values[i]) { // not required + continue + } + + if m.Values[i] != nil { + if err := m.Values[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("values" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponse) UnmarshalBinary(b []byte) error { + var res TransactionsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0 transactions response values items0 +// +// swagger:model TransactionsResponseValuesItems0 +type TransactionsResponseValuesItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // assigned employee Id + AssignedEmployeeID string `json:"assignedEmployeeId,omitempty"` + + // cart + Cart *TransactionsResponseValuesItems0Cart `json:"cart,omitempty"` + + // checkin time + CheckinTime int64 `json:"checkinTime,omitempty"` + + // checkout type + CheckoutType string `json:"checkoutType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // completed time + CompletedTime int64 `json:"completedTime,omitempty"` + + // consumer cart Id + ConsumerCartID string `json:"consumerCartId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // created by Id + CreatedByID string `json:"createdById,omitempty"` + + // delete note + DeleteNote *TransactionsResponseValuesItems0DeleteNote `json:"deleteNote,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // delivery address + DeliveryAddress *TransactionsResponseValuesItems0DeliveryAddress `json:"deliveryAddress,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // end route date + EndRouteDate float64 `json:"endRouteDate,omitempty"` + + // end route location + EndRouteLocation []float64 `json:"endRouteLocation"` + + // end time + EndTime int64 `json:"endTime,omitempty"` + + // eta + Eta float64 `json:"eta,omitempty"` + + // fulfillment step + FulfillmentStep string `json:"fulfillmentStep,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // loc + Loc []float64 `json:"loc"` + + // locked + Locked bool `json:"locked,omitempty"` + + // member + Member *TransactionsResponseValuesItems0Member `json:"member,omitempty"` + + // member Id + MemberID string `json:"memberId,omitempty"` + + // member signature + MemberSignature *TransactionsResponseValuesItems0MemberSignature `json:"memberSignature,omitempty"` + + // memo + Memo string `json:"memo,omitempty"` + + // metrc Id + MetrcID int64 `json:"metrcId,omitempty"` + + // metrc sale time + MetrcSaleTime string `json:"metrcSaleTime,omitempty"` + + // mileage + Mileage float64 `json:"mileage,omitempty"` + + // mileage calculated + MileageCalculated bool `json:"mileageCalculated,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // note + Note *TransactionsResponseValuesItems0Note `json:"note,omitempty"` + + // override inventory Id + OverrideInventoryID string `json:"overrideInventoryId,omitempty"` + + // paid + Paid bool `json:"paid,omitempty"` + + // paid time + PaidTime int64 `json:"paidTime,omitempty"` + + // parentitem number + ParentitemNumber string `json:"parentitemNumber,omitempty"` + + // payment card payments + PaymentCardPayments []*TransactionsResponseValuesItems0PaymentCardPaymentsItems0 `json:"paymentCardPayments"` + + // points earned + PointsEarned float64 `json:"pointsEarned,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // processed time + ProcessedTime int64 `json:"processedTime,omitempty"` + + // queue type + QueueType string `json:"queueType,omitempty"` + + // routing + Routing bool `json:"routing,omitempty"` + + // seller + Seller *TransactionsResponseValuesItems0Seller `json:"seller,omitempty"` + + // seller Id + SellerID string `json:"sellerId,omitempty"` + + // seller terminal Id + SellerTerminalID string `json:"sellerTerminalId,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // source + Source string `json:"source,omitempty"` + + // start route date + StartRouteDate float64 `json:"startRouteDate,omitempty"` + + // start route location + StartRouteLocation []float64 `json:"startRouteLocation"` + + // start time + StartTime int64 `json:"startTime,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // terminal Id + TerminalID string `json:"terminalId,omitempty"` + + // time zone + TimeZone string `json:"timeZone,omitempty"` + + // trace message + TraceMessage string `json:"traceMessage,omitempty"` + + // trace submit status + TraceSubmitStatus string `json:"traceSubmitStatus,omitempty"` + + // tracking status + TrackingStatus string `json:"trackingStatus,omitempty"` + + // trans no + TransNo string `json:"transNo,omitempty"` + + // trans type + TransType string `json:"transType,omitempty"` + + // transfer shop Id + TransferShopID string `json:"transferShopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 +func (m *TransactionsResponseValuesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeleteNote(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMember(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMemberSignature(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNote(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentCardPayments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeller(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0) validateCart(formats strfmt.Registry) error { + + if swag.IsZero(m.Cart) { // not required + return nil + } + + if m.Cart != nil { + if err := m.Cart.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0) validateDeleteNote(formats strfmt.Registry) error { + + if swag.IsZero(m.DeleteNote) { // not required + return nil + } + + if m.DeleteNote != nil { + if err := m.DeleteNote.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteNote") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0) validateDeliveryAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.DeliveryAddress) { // not required + return nil + } + + if m.DeliveryAddress != nil { + if err := m.DeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddress") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0) validateMember(formats strfmt.Registry) error { + + if swag.IsZero(m.Member) { // not required + return nil + } + + if m.Member != nil { + if err := m.Member.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("member") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0) validateMemberSignature(formats strfmt.Registry) error { + + if swag.IsZero(m.MemberSignature) { // not required + return nil + } + + if m.MemberSignature != nil { + if err := m.MemberSignature.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memberSignature") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0) validateNote(formats strfmt.Registry) error { + + if swag.IsZero(m.Note) { // not required + return nil + } + + if m.Note != nil { + if err := m.Note.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("note") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0) validatePaymentCardPayments(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentCardPayments) { // not required + return nil + } + + for i := 0; i < len(m.PaymentCardPayments); i++ { + if swag.IsZero(m.PaymentCardPayments[i]) { // not required + continue + } + + if m.PaymentCardPayments[i] != nil { + if err := m.PaymentCardPayments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentCardPayments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0) validateSeller(formats strfmt.Registry) error { + + if swag.IsZero(m.Seller) { // not required + return nil + } + + if m.Seller != nil { + if err := m.Seller.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("seller") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0Cart transactions response values items0 cart +// +// swagger:model TransactionsResponseValuesItems0Cart +type TransactionsResponseValuesItems0Cart struct { + + // adjustment amount + AdjustmentAmount float64 `json:"adjustmentAmount,omitempty"` + + // after tax discount + AfterTaxDiscount float64 `json:"afterTaxDiscount,omitempty"` + + // applied after tax discount + AppliedAfterTaxDiscount float64 `json:"appliedAfterTaxDiscount,omitempty"` + + // balance due + BalanceDue float64 `json:"balanceDue,omitempty"` + + // calc cart discount + CalcCartDiscount float64 `json:"calcCartDiscount,omitempty"` + + // cash received + CashReceived float64 `json:"cashReceived,omitempty"` + + // change due + ChangeDue float64 `json:"changeDue,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // credit card fee + CreditCardFee float64 `json:"creditCardFee,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // delivery discount + DeliveryDiscount float64 `json:"deliveryDiscount,omitempty"` + + // delivery discount type + DeliveryDiscountType string `json:"deliveryDiscountType,omitempty"` + + // delivery fee + DeliveryFee float64 `json:"deliveryFee,omitempty"` + + // delivery promotion Id + DeliveryPromotionID string `json:"deliveryPromotionId,omitempty"` + + // discount + Discount float64 `json:"discount,omitempty"` + + // discount type + DiscountType string `json:"discountType,omitempty"` + + // enable credit card fee + EnableCreditCardFee bool `json:"enableCreditCardFee,omitempty"` + + // enable delivery fee + EnableDeliveryFee bool `json:"enableDeliveryFee,omitempty"` + + // final refund amt + FinalRefundAmt float64 `json:"finalRefundAmt,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // items + Items []*TransactionsResponseValuesItems0CartItemsItems0 `json:"items"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // payment option + PaymentOption string `json:"paymentOption,omitempty"` + + // payment type + PaymentType string `json:"paymentType,omitempty"` + + // point spent + PointSpent float64 `json:"pointSpent,omitempty"` + + // promo code + PromoCode string `json:"promoCode,omitempty"` + + // promotion req logs + PromotionReqLogs []*TransactionsResponseValuesItems0CartPromotionReqLogsItems0 `json:"promotionReqLogs"` + + // promotion reqs + PromotionReqs []*TransactionsResponseValuesItems0CartPromotionReqsItems0 `json:"promotionReqs"` + + // refund amount + RefundAmount float64 `json:"refundAmount,omitempty"` + + // refund option + RefundOption string `json:"refundOption,omitempty"` + + // refund order item requests + RefundOrderItemRequests []*TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0 `json:"refundOrderItemRequests"` + + // request refund amt + RequestRefundAmt float64 `json:"requestRefundAmt,omitempty"` + + // round amt + RoundAmt float64 `json:"roundAmt,omitempty"` + + // storage location + StorageLocation string `json:"storageLocation,omitempty"` + + // sub total + SubTotal float64 `json:"subTotal,omitempty"` + + // sub total discount + SubTotalDiscount float64 `json:"subTotalDiscount,omitempty"` + + // tax + Tax float64 `json:"tax,omitempty"` + + // tax result + TaxResult *TransactionsResponseValuesItems0CartTaxResult `json:"taxResult,omitempty"` + + // tax table + TaxTable *TransactionsResponseValuesItems0CartTaxTable `json:"taxTable,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // total a l excise tax + TotalALExciseTax float64 `json:"totalALExciseTax,omitempty"` + + // total calc tax + TotalCalcTax float64 `json:"totalCalcTax,omitempty"` + + // total discount + TotalDiscount float64 `json:"totalDiscount,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart +func (m *TransactionsResponseValuesItems0Cart) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePromotionReqLogs(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePromotionReqs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRefundOrderItemRequests(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxResult(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTable(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0Cart) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Cart) validatePromotionReqLogs(formats strfmt.Registry) error { + + if swag.IsZero(m.PromotionReqLogs) { // not required + return nil + } + + for i := 0; i < len(m.PromotionReqLogs); i++ { + if swag.IsZero(m.PromotionReqLogs[i]) { // not required + continue + } + + if m.PromotionReqLogs[i] != nil { + if err := m.PromotionReqLogs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "promotionReqLogs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Cart) validatePromotionReqs(formats strfmt.Registry) error { + + if swag.IsZero(m.PromotionReqs) { // not required + return nil + } + + for i := 0; i < len(m.PromotionReqs); i++ { + if swag.IsZero(m.PromotionReqs[i]) { // not required + continue + } + + if m.PromotionReqs[i] != nil { + if err := m.PromotionReqs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "promotionReqs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Cart) validateRefundOrderItemRequests(formats strfmt.Registry) error { + + if swag.IsZero(m.RefundOrderItemRequests) { // not required + return nil + } + + for i := 0; i < len(m.RefundOrderItemRequests); i++ { + if swag.IsZero(m.RefundOrderItemRequests[i]) { // not required + continue + } + + if m.RefundOrderItemRequests[i] != nil { + if err := m.RefundOrderItemRequests[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "refundOrderItemRequests" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Cart) validateTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxResult) { // not required + return nil + } + + if m.TaxResult != nil { + if err := m.TaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxResult") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Cart) validateTaxTable(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTable) { // not required + return nil + } + + if m.TaxTable != nil { + if err := m.TaxTable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Cart) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Cart) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0Cart + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0 transactions response values items0 cart items items0 +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0 +type TransactionsResponseValuesItems0CartItemsItems0 struct { + + // available discount qty + AvailableDiscountQty float64 `json:"availableDiscountQty,omitempty"` + + // batch Id + BatchID string `json:"batchId,omitempty"` + + // batch sku + BatchSku float64 `json:"batchSku,omitempty"` + + // calc cultivation tax + CalcCultivationTax float64 `json:"calcCultivationTax,omitempty"` + + // calc discount + CalcDiscount float64 `json:"calcDiscount,omitempty"` + + // calc pre tax + CalcPreTax float64 `json:"calcPreTax,omitempty"` + + // calc tax + CalcTax float64 `json:"calcTax,omitempty"` + + // cogs + Cogs float64 `json:"cogs,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // cost + Cost float64 `json:"cost,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // discount + Discount float64 `json:"discount,omitempty"` + + // discount type + DiscountType string `json:"discountType,omitempty"` + + // discounted qty + DiscountedQty float64 `json:"discountedQty,omitempty"` + + // exchange amount + ExchangeAmount float64 `json:"exchangeAmount,omitempty"` + + // exchange qty + ExchangeQty float64 `json:"exchangeQty,omitempty"` + + // excise tax + ExciseTax float64 `json:"exciseTax,omitempty"` + + // final price + FinalPrice float64 `json:"finalPrice,omitempty"` + + // finalized + Finalized bool `json:"finalized,omitempty"` + + // fulfilled + Fulfilled bool `json:"fulfilled,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // ignore mix match + IgnoreMixMatch bool `json:"ignoreMixMatch,omitempty"` + + // mix matched + MixMatched bool `json:"mixMatched,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // order item Id + OrderItemID string `json:"orderItemId,omitempty"` + + // orig quantity + OrigQuantity float64 `json:"origQuantity,omitempty"` + + // override price + OverridePrice float64 `json:"overridePrice,omitempty"` + + // per unit refund amt + PerUnitRefundAmt float64 `json:"perUnitRefundAmt,omitempty"` + + // prepackage + Prepackage string `json:"prepackage,omitempty"` + + // prepackage Id + PrepackageID string `json:"prepackageId,omitempty"` + + // prepackage item Id + PrepackageItemID string `json:"prepackageItemId,omitempty"` + + // prepackage product item + PrepackageProductItem string `json:"prepackageProductItem,omitempty"` + + // prepared qty + PreparedQty float64 `json:"preparedQty,omitempty"` + + // product + Product float64 `json:"product,omitempty"` + + // product Id + ProductID string `json:"productId,omitempty"` + + // promotion reqs + PromotionReqs []*TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0 `json:"promotionReqs"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` + + // quantity logs + QuantityLogs []*TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0 `json:"quantityLogs"` + + // status + Status string `json:"status,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax result + TaxResult *TransactionsResponseValuesItems0CartItemsItems0TaxResult `json:"taxResult,omitempty"` + + // tax table + TaxTable *TransactionsResponseValuesItems0CartItemsItems0TaxTable `json:"taxTable,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // total refund amount + TotalRefundAmount float64 `json:"totalRefundAmount,omitempty"` + + // total refund qty + TotalRefundQty float64 `json:"totalRefundQty,omitempty"` + + // txn line ID + TxnLineID float64 `json:"txnLineID,omitempty"` + + // unit price + UnitPrice float64 `json:"unitPrice,omitempty"` + + // unit qty + UnitQty float64 `json:"unitQty,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // use unit qty + UseUnitQty bool `json:"useUnitQty,omitempty"` + + // weight key + WeightKey string `json:"weightKey,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 +func (m *TransactionsResponseValuesItems0CartItemsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePromotionReqs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuantityLogs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxResult(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTable(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0) validatePromotionReqs(formats strfmt.Registry) error { + + if swag.IsZero(m.PromotionReqs) { // not required + return nil + } + + for i := 0; i < len(m.PromotionReqs); i++ { + if swag.IsZero(m.PromotionReqs[i]) { // not required + continue + } + + if m.PromotionReqs[i] != nil { + if err := m.PromotionReqs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("promotionReqs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0) validateQuantityLogs(formats strfmt.Registry) error { + + if swag.IsZero(m.QuantityLogs) { // not required + return nil + } + + for i := 0; i < len(m.QuantityLogs); i++ { + if swag.IsZero(m.QuantityLogs[i]) { // not required + continue + } + + if m.QuantityLogs[i] != nil { + if err := m.QuantityLogs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("quantityLogs" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0) validateTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxResult) { // not required + return nil + } + + if m.TaxResult != nil { + if err := m.TaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxResult") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0) validateTaxTable(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTable) { // not required + return nil + } + + if m.TaxTable != nil { + if err := m.TaxTable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0 transactions response values items0 cart items items0 promotion reqs items0 +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0 +type TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0 struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // promotion Id + PromotionID string `json:"promotionId,omitempty"` + + // reward Id + RewardID string `json:"rewardId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 promotion reqs items0 +func (m *TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0PromotionReqsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0 transactions response values items0 cart items items0 quantity logs items0 +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0 +type TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0 struct { + + // batch Id + BatchID string `json:"batchId,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // inventory Id + InventoryID string `json:"inventoryId,omitempty"` + + // prepackage item Id + PrepackageItemID string `json:"prepackageItemId,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 quantity logs items0 +func (m *TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0QuantityLogsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0TaxResult transactions response values items0 cart items items0 tax result +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0TaxResult +type TransactionsResponseValuesItems0CartItemsItems0TaxResult struct { + + // created + Created int64 `json:"created,omitempty"` + + // cultivation tax result + CultivationTaxResult *TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult `json:"cultivationTaxResult,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // total a l excise tax + TotalALExciseTax float64 `json:"totalALExciseTax,omitempty"` + + // total a l post excise tax + TotalALPostExciseTax float64 `json:"totalALPostExciseTax,omitempty"` + + // total city pre tax + TotalCityPreTax float64 `json:"totalCityPreTax,omitempty"` + + // total city tax + TotalCityTax float64 `json:"totalCityTax,omitempty"` + + // total county pre tax + TotalCountyPreTax float64 `json:"totalCountyPreTax,omitempty"` + + // total county tax + TotalCountyTax float64 `json:"totalCountyTax,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // total fed pre tax + TotalFedPreTax float64 `json:"totalFedPreTax,omitempty"` + + // total fed tax + TotalFedTax float64 `json:"totalFedTax,omitempty"` + + // total n a l pre excise tax + TotalNALPreExciseTax float64 `json:"totalNALPreExciseTax,omitempty"` + + // total post calc tax + TotalPostCalcTax float64 `json:"totalPostCalcTax,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // total state pre tax + TotalStatePreTax float64 `json:"totalStatePreTax,omitempty"` + + // total state tax + TotalStateTax float64 `json:"totalStateTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 tax result +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCultivationTaxResult(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxResult) validateCultivationTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.CultivationTaxResult) { // not required + return nil + } + + if m.CultivationTaxResult != nil { + if err := m.CultivationTaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxResult" + "." + "cultivationTaxResult") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxResult) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0TaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult transactions response values items0 cart items items0 tax result cultivation tax result +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult +type TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult struct { + + // flower tax oz + FlowerTaxOz float64 `json:"flowerTaxOz,omitempty"` + + // leaf tax oz + LeafTaxOz float64 `json:"leafTaxOz,omitempty"` + + // total cultivation tax + TotalCultivationTax float64 `json:"totalCultivationTax,omitempty"` + + // total flower oz + TotalFlowerOz float64 `json:"totalFlowerOz,omitempty"` + + // total flower tax + TotalFlowerTax float64 `json:"totalFlowerTax,omitempty"` + + // total leaf oz + TotalLeafOz float64 `json:"totalLeafOz,omitempty"` + + // total leaf tax + TotalLeafTax float64 `json:"totalLeafTax,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 tax result cultivation tax result +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0TaxResultCultivationTaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0TaxTable transactions response values items0 cart items items0 tax table +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0TaxTable +type TransactionsResponseValuesItems0CartItemsItems0TaxTable struct { + + // active + Active bool `json:"active,omitempty"` + + // city tax + CityTax *TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax `json:"cityTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // county tax + CountyTax *TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax `json:"countyTax,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // federal tax + FederalTax *TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax `json:"federalTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // state tax + StateTax *TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax `json:"stateTax,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 tax table +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCityTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountyTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFederalTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStateTax(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTable) validateCityTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CityTax) { // not required + return nil + } + + if m.CityTax != nil { + if err := m.CityTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "cityTax") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTable) validateCountyTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CountyTax) { // not required + return nil + } + + if m.CountyTax != nil { + if err := m.CountyTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "countyTax") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTable) validateFederalTax(formats strfmt.Registry) error { + + if swag.IsZero(m.FederalTax) { // not required + return nil + } + + if m.FederalTax != nil { + if err := m.FederalTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "federalTax") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTable) validateStateTax(formats strfmt.Registry) error { + + if swag.IsZero(m.StateTax) { // not required + return nil + } + + if m.StateTax != nil { + if err := m.StateTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxTable" + "." + "stateTax") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTable) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0TaxTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax transactions response values items0 cart items items0 tax table city tax +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax +type TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 tax table city tax +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0TaxTableCityTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax transactions response values items0 cart items items0 tax table county tax +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax +type TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 tax table county tax +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0TaxTableCountyTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax transactions response values items0 cart items items0 tax table federal tax +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax +type TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 tax table federal tax +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0TaxTableFederalTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax transactions response values items0 cart items items0 tax table state tax +// +// swagger:model TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax +type TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart items items0 tax table state tax +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartItemsItems0TaxTableStateTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartPromotionReqLogsItems0 transactions response values items0 cart promotion req logs items0 +// +// swagger:model TransactionsResponseValuesItems0CartPromotionReqLogsItems0 +type TransactionsResponseValuesItems0CartPromotionReqLogsItems0 struct { + + // amount + Amount float64 `json:"amount,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // promotion Id + PromotionID string `json:"promotionId,omitempty"` + + // promotion type + PromotionType string `json:"promotionType,omitempty"` + + // reward Id + RewardID string `json:"rewardId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart promotion req logs items0 +func (m *TransactionsResponseValuesItems0CartPromotionReqLogsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartPromotionReqLogsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartPromotionReqLogsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartPromotionReqLogsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartPromotionReqsItems0 transactions response values items0 cart promotion reqs items0 +// +// swagger:model TransactionsResponseValuesItems0CartPromotionReqsItems0 +type TransactionsResponseValuesItems0CartPromotionReqsItems0 struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // promotion Id + PromotionID string `json:"promotionId,omitempty"` + + // reward Id + RewardID string `json:"rewardId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart promotion reqs items0 +func (m *TransactionsResponseValuesItems0CartPromotionReqsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartPromotionReqsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartPromotionReqsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartPromotionReqsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0 transactions response values items0 cart refund order item requests items0 +// +// swagger:model TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0 +type TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0 struct { + + // order item Id + OrderItemID string `json:"orderItemId,omitempty"` + + // quantity + Quantity float64 `json:"quantity,omitempty"` + + // refund amt + RefundAmt float64 `json:"refundAmt,omitempty"` +} + +// Validate validates this transactions response values items0 cart refund order item requests items0 +func (m *TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartRefundOrderItemRequestsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartTaxResult transactions response values items0 cart tax result +// +// swagger:model TransactionsResponseValuesItems0CartTaxResult +type TransactionsResponseValuesItems0CartTaxResult struct { + + // created + Created int64 `json:"created,omitempty"` + + // cultivation tax result + CultivationTaxResult *TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult `json:"cultivationTaxResult,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // total a l excise tax + TotalALExciseTax float64 `json:"totalALExciseTax,omitempty"` + + // total a l post excise tax + TotalALPostExciseTax float64 `json:"totalALPostExciseTax,omitempty"` + + // total city pre tax + TotalCityPreTax float64 `json:"totalCityPreTax,omitempty"` + + // total city tax + TotalCityTax float64 `json:"totalCityTax,omitempty"` + + // total county pre tax + TotalCountyPreTax float64 `json:"totalCountyPreTax,omitempty"` + + // total county tax + TotalCountyTax float64 `json:"totalCountyTax,omitempty"` + + // total excise tax + TotalExciseTax float64 `json:"totalExciseTax,omitempty"` + + // total fed pre tax + TotalFedPreTax float64 `json:"totalFedPreTax,omitempty"` + + // total fed tax + TotalFedTax float64 `json:"totalFedTax,omitempty"` + + // total n a l pre excise tax + TotalNALPreExciseTax float64 `json:"totalNALPreExciseTax,omitempty"` + + // total post calc tax + TotalPostCalcTax float64 `json:"totalPostCalcTax,omitempty"` + + // total pre calc tax + TotalPreCalcTax float64 `json:"totalPreCalcTax,omitempty"` + + // total state pre tax + TotalStatePreTax float64 `json:"totalStatePreTax,omitempty"` + + // total state tax + TotalStateTax float64 `json:"totalStateTax,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart tax result +func (m *TransactionsResponseValuesItems0CartTaxResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCultivationTaxResult(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0CartTaxResult) validateCultivationTaxResult(formats strfmt.Registry) error { + + if swag.IsZero(m.CultivationTaxResult) { // not required + return nil + } + + if m.CultivationTaxResult != nil { + if err := m.CultivationTaxResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxResult" + "." + "cultivationTaxResult") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxResult) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartTaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult transactions response values items0 cart tax result cultivation tax result +// +// swagger:model TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult +type TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult struct { + + // flower tax oz + FlowerTaxOz float64 `json:"flowerTaxOz,omitempty"` + + // leaf tax oz + LeafTaxOz float64 `json:"leafTaxOz,omitempty"` + + // total cultivation tax + TotalCultivationTax float64 `json:"totalCultivationTax,omitempty"` + + // total flower oz + TotalFlowerOz float64 `json:"totalFlowerOz,omitempty"` + + // total flower tax + TotalFlowerTax float64 `json:"totalFlowerTax,omitempty"` + + // total leaf oz + TotalLeafOz float64 `json:"totalLeafOz,omitempty"` + + // total leaf tax + TotalLeafTax float64 `json:"totalLeafTax,omitempty"` +} + +// Validate validates this transactions response values items0 cart tax result cultivation tax result +func (m *TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartTaxResultCultivationTaxResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartTaxTable transactions response values items0 cart tax table +// +// swagger:model TransactionsResponseValuesItems0CartTaxTable +type TransactionsResponseValuesItems0CartTaxTable struct { + + // active + Active bool `json:"active,omitempty"` + + // city tax + CityTax *TransactionsResponseValuesItems0CartTaxTableCityTax `json:"cityTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // county tax + CountyTax *TransactionsResponseValuesItems0CartTaxTableCountyTax `json:"countyTax,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // federal tax + FederalTax *TransactionsResponseValuesItems0CartTaxTableFederalTax `json:"federalTax,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // state tax + StateTax *TransactionsResponseValuesItems0CartTaxTableStateTax `json:"stateTax,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax type + TaxType string `json:"taxType,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart tax table +func (m *TransactionsResponseValuesItems0CartTaxTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCityTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountyTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFederalTax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStateTax(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0CartTaxTable) validateCityTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CityTax) { // not required + return nil + } + + if m.CityTax != nil { + if err := m.CityTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "cityTax") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartTaxTable) validateCountyTax(formats strfmt.Registry) error { + + if swag.IsZero(m.CountyTax) { // not required + return nil + } + + if m.CountyTax != nil { + if err := m.CountyTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "countyTax") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartTaxTable) validateFederalTax(formats strfmt.Registry) error { + + if swag.IsZero(m.FederalTax) { // not required + return nil + } + + if m.FederalTax != nil { + if err := m.FederalTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "federalTax") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0CartTaxTable) validateStateTax(formats strfmt.Registry) error { + + if swag.IsZero(m.StateTax) { // not required + return nil + } + + if m.StateTax != nil { + if err := m.StateTax.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cart" + "." + "taxTable" + "." + "stateTax") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTable) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartTaxTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartTaxTableCityTax transactions response values items0 cart tax table city tax +// +// swagger:model TransactionsResponseValuesItems0CartTaxTableCityTax +type TransactionsResponseValuesItems0CartTaxTableCityTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart tax table city tax +func (m *TransactionsResponseValuesItems0CartTaxTableCityTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableCityTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableCityTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartTaxTableCityTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartTaxTableCountyTax transactions response values items0 cart tax table county tax +// +// swagger:model TransactionsResponseValuesItems0CartTaxTableCountyTax +type TransactionsResponseValuesItems0CartTaxTableCountyTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart tax table county tax +func (m *TransactionsResponseValuesItems0CartTaxTableCountyTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableCountyTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableCountyTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartTaxTableCountyTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartTaxTableFederalTax transactions response values items0 cart tax table federal tax +// +// swagger:model TransactionsResponseValuesItems0CartTaxTableFederalTax +type TransactionsResponseValuesItems0CartTaxTableFederalTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart tax table federal tax +func (m *TransactionsResponseValuesItems0CartTaxTableFederalTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableFederalTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableFederalTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartTaxTableFederalTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0CartTaxTableStateTax transactions response values items0 cart tax table state tax +// +// swagger:model TransactionsResponseValuesItems0CartTaxTableStateTax +type TransactionsResponseValuesItems0CartTaxTableStateTax struct { + + // active + Active bool `json:"active,omitempty"` + + // active excise tax + ActiveExciseTax bool `json:"activeExciseTax,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // compound + Compound bool `json:"compound,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // tax order + TaxOrder string `json:"taxOrder,omitempty"` + + // tax rate + TaxRate float64 `json:"taxRate,omitempty"` + + // territory + Territory string `json:"territory,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 cart tax table state tax +func (m *TransactionsResponseValuesItems0CartTaxTableStateTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableStateTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0CartTaxTableStateTax) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0CartTaxTableStateTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0DeleteNote transactions response values items0 delete note +// +// swagger:model TransactionsResponseValuesItems0DeleteNote +type TransactionsResponseValuesItems0DeleteNote struct { + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enable on fleet + EnableOnFleet bool `json:"enableOnFleet,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // writer Id + WriterID string `json:"writerId,omitempty"` + + // writer name + WriterName string `json:"writerName,omitempty"` +} + +// Validate validates this transactions response values items0 delete note +func (m *TransactionsResponseValuesItems0DeleteNote) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0DeleteNote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0DeleteNote) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0DeleteNote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0DeliveryAddress transactions response values items0 delivery address +// +// swagger:model TransactionsResponseValuesItems0DeliveryAddress +type TransactionsResponseValuesItems0DeliveryAddress struct { + + // address + Address string `json:"address,omitempty"` + + // address line1 + AddressLine1 string `json:"addressLine1,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this transactions response values items0 delivery address +func (m *TransactionsResponseValuesItems0DeliveryAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0DeliveryAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0DeliveryAddress) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0DeliveryAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0Member transactions response values items0 member +// +// swagger:model TransactionsResponseValuesItems0Member +type TransactionsResponseValuesItems0Member struct { + + // address + Address *TransactionsResponseValuesItems0MemberAddress `json:"address,omitempty"` + + // agreement expired + AgreementExpired bool `json:"agreementExpired,omitempty"` + + // anonymous + Anonymous bool `json:"anonymous,omitempty"` + + // ban patient + BanPatient bool `json:"banPatient,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // consumer type + ConsumerType string `json:"consumerType,omitempty"` + + // consumer user Id + ConsumerUserID string `json:"consumerUserId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // dl expired + DlExpired bool `json:"dlExpired,omitempty"` + + // dob + Dob float64 `json:"dob,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // email opt in + EmailOptIn bool `json:"emailOptIn,omitempty"` + + // email verified + EmailVerified bool `json:"emailVerified,omitempty"` + + // enable loyalty + EnableLoyalty bool `json:"enableLoyalty,omitempty"` + + // enabled care giver + EnabledCareGiver bool `json:"enabledCareGiver,omitempty"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // identifications + Identifications []*TransactionsResponseValuesItems0MemberIdentificationsItems0 `json:"identifications"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // last visit date + LastVisitDate float64 `json:"lastVisitDate,omitempty"` + + // lifetime points + LifetimePoints float64 `json:"lifetimePoints,omitempty"` + + // loyalty points + LoyaltyPoints float64 `json:"loyaltyPoints,omitempty"` + + // marketing source + MarketingSource string `json:"marketingSource,omitempty"` + + // medical + Medical bool `json:"medical,omitempty"` + + // member group + MemberGroup *TransactionsResponseValuesItems0MemberMemberGroup `json:"memberGroup,omitempty"` + + // member group Id + MemberGroupID string `json:"memberGroupId,omitempty"` + + // middle name + MiddleName string `json:"middleName,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // primary phone + PrimaryPhone string `json:"primaryPhone,omitempty"` + + // qb mapping + QbMapping string `json:"qbMapping,omitempty"` + + // recommendation expired + RecommendationExpired bool `json:"recommendationExpired,omitempty"` + + // recommendation expiry left + RecommendationExpiryLeft float64 `json:"recommendationExpiryLeft,omitempty"` + + // recommendations + Recommendations []*TransactionsResponseValuesItems0MemberRecommendationsItems0 `json:"recommendations"` + + // region Id + RegionID string `json:"regionId,omitempty"` + + // search text + SearchText string `json:"searchText,omitempty"` + + // sex + Sex float64 `json:"sex,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // start date + StartDate float64 `json:"startDate,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // text opt in + TextOptIn bool `json:"textOptIn,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 member +func (m *TransactionsResponseValuesItems0Member) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIdentifications(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMemberGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecommendations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0Member) 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("member" + "." + "address") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Member) validateIdentifications(formats strfmt.Registry) error { + + if swag.IsZero(m.Identifications) { // not required + return nil + } + + for i := 0; i < len(m.Identifications); i++ { + if swag.IsZero(m.Identifications[i]) { // not required + continue + } + + if m.Identifications[i] != nil { + if err := m.Identifications[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("member" + "." + "identifications" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Member) validateMemberGroup(formats strfmt.Registry) error { + + if swag.IsZero(m.MemberGroup) { // not required + return nil + } + + if m.MemberGroup != nil { + if err := m.MemberGroup.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("member" + "." + "memberGroup") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Member) validateRecommendations(formats strfmt.Registry) error { + + if swag.IsZero(m.Recommendations) { // not required + return nil + } + + for i := 0; i < len(m.Recommendations); i++ { + if swag.IsZero(m.Recommendations[i]) { // not required + continue + } + + if m.Recommendations[i] != nil { + if err := m.Recommendations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("member" + "." + "recommendations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Member) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Member) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0Member + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0MemberAddress transactions response values items0 member address +// +// swagger:model TransactionsResponseValuesItems0MemberAddress +type TransactionsResponseValuesItems0MemberAddress struct { + + // address + Address string `json:"address,omitempty"` + + // address line1 + AddressLine1 string `json:"addressLine1,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this transactions response values items0 member address +func (m *TransactionsResponseValuesItems0MemberAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberAddress) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0MemberAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0MemberIdentificationsItems0 transactions response values items0 member identifications items0 +// +// swagger:model TransactionsResponseValuesItems0MemberIdentificationsItems0 +type TransactionsResponseValuesItems0MemberIdentificationsItems0 struct { + + // assets + Assets []*TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0 `json:"assets"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // expiration date + ExpirationDate float64 `json:"expirationDate,omitempty"` + + // front photo + FrontPhoto *TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto `json:"frontPhoto,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // license number + LicenseNumber string `json:"licenseNumber,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // verified + Verified bool `json:"verified,omitempty"` +} + +// Validate validates this transactions response values items0 member identifications items0 +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFrontPhoto(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0) validateFrontPhoto(formats strfmt.Registry) error { + + if swag.IsZero(m.FrontPhoto) { // not required + return nil + } + + if m.FrontPhoto != nil { + if err := m.FrontPhoto.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("frontPhoto") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0MemberIdentificationsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0 transactions response values items0 member identifications items0 assets items0 +// +// swagger:model TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0 +type TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 member identifications items0 assets items0 +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0MemberIdentificationsItems0AssetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto transactions response values items0 member identifications items0 front photo +// +// swagger:model TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto +type TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // orig URL + OrigURL string `json:"origURL,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 member identifications items0 front photo +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0MemberIdentificationsItems0FrontPhoto + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0MemberMemberGroup transactions response values items0 member member group +// +// swagger:model TransactionsResponseValuesItems0MemberMemberGroup +type TransactionsResponseValuesItems0MemberMemberGroup struct { + + // active + Active bool `json:"active,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // default group + DefaultGroup bool `json:"defaultGroup,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // discount + Discount float64 `json:"discount,omitempty"` + + // discount type + DiscountType string `json:"discountType,omitempty"` + + // enable promotion + EnablePromotion bool `json:"enablePromotion,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // member count + MemberCount float64 `json:"memberCount,omitempty"` + + // member count email opt in + MemberCountEmailOptIn float64 `json:"memberCountEmailOptIn,omitempty"` + + // member count text opt in + MemberCountTextOptIn float64 `json:"memberCountTextOptIn,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // promotion Id + PromotionID string `json:"promotionId,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 member member group +func (m *TransactionsResponseValuesItems0MemberMemberGroup) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberMemberGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberMemberGroup) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0MemberMemberGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0MemberRecommendationsItems0 transactions response values items0 member recommendations items0 +// +// swagger:model TransactionsResponseValuesItems0MemberRecommendationsItems0 +type TransactionsResponseValuesItems0MemberRecommendationsItems0 struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // verify method + VerifyMethod string `json:"verifyMethod,omitempty"` +} + +// Validate validates this transactions response values items0 member recommendations items0 +func (m *TransactionsResponseValuesItems0MemberRecommendationsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberRecommendationsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberRecommendationsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0MemberRecommendationsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0MemberSignature transactions response values items0 member signature +// +// swagger:model TransactionsResponseValuesItems0MemberSignature +type TransactionsResponseValuesItems0MemberSignature struct { + + // active + Active bool `json:"active,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // public URL + PublicURL string `json:"publicURL,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 member signature +func (m *TransactionsResponseValuesItems0MemberSignature) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberSignature) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0MemberSignature) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0MemberSignature + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0Note transactions response values items0 note +// +// swagger:model TransactionsResponseValuesItems0Note +type TransactionsResponseValuesItems0Note struct { + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // enable on fleet + EnableOnFleet bool `json:"enableOnFleet,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // writer Id + WriterID string `json:"writerId,omitempty"` + + // writer name + WriterName string `json:"writerName,omitempty"` +} + +// Validate validates this transactions response values items0 note +func (m *TransactionsResponseValuesItems0Note) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Note) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Note) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0Note + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0PaymentCardPaymentsItems0 transactions response values items0 payment card payments items0 +// +// swagger:model TransactionsResponseValuesItems0PaymentCardPaymentsItems0 +type TransactionsResponseValuesItems0PaymentCardPaymentsItems0 struct { + + // amount + Amount float64 `json:"amount,omitempty"` + + // balance + Balance float64 `json:"balance,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // payment card number + PaymentCardNumber string `json:"paymentCardNumber,omitempty"` + + // processed time + ProcessedTime int64 `json:"processedTime,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // status message + StatusMessage string `json:"statusMessage,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 payment card payments items0 +func (m *TransactionsResponseValuesItems0PaymentCardPaymentsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0PaymentCardPaymentsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0PaymentCardPaymentsItems0) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0PaymentCardPaymentsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0Seller transactions response values items0 seller +// +// swagger:model TransactionsResponseValuesItems0Seller +type TransactionsResponseValuesItems0Seller struct { + + // address + Address *TransactionsResponseValuesItems0SellerAddress `json:"address,omitempty"` + + // assigned + Assigned bool `json:"assigned,omitempty"` + + // assigned employee + AssignedEmployee string `json:"assignedEmployee,omitempty"` + + // assigned terminal Id + AssignedTerminalID string `json:"assignedTerminalId,omitempty"` + + // can apply custom discount + CanApplyCustomDiscount bool `json:"canApplyCustomDiscount,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // create onfleet task + CreateOnfleetTask bool `json:"createOnfleetTask,omitempty"` + + // create tookan task + CreateTookanTask bool `json:"createTookanTask,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // delivery date + DeliveryDate float64 `json:"deliveryDate,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` + + // dl expiration date + DlExpirationDate string `json:"dlExpirationDate,omitempty"` + + // drivers license + DriversLicense string `json:"driversLicense,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // error refund time + ErrorRefundTime int64 `json:"errorRefundTime,omitempty"` + + // error time + ErrorTime int64 `json:"errorTime,omitempty"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // fulfilling fulfillment + FulfillingFulfillment bool `json:"fulfillingFulfillment,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // insurance company name + InsuranceCompanyName string `json:"insuranceCompanyName,omitempty"` + + // insurance expire date + InsuranceExpireDate float64 `json:"insuranceExpireDate,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // on fleet task Id + OnFleetTaskID string `json:"onFleetTaskId,omitempty"` + + // on fleet task status + OnFleetTaskStatus string `json:"onFleetTaskStatus,omitempty"` + + // order tags + OrderTags []string `json:"orderTags"` + + // packed by + PackedBy string `json:"packedBy,omitempty"` + + // packed date + PackedDate float64 `json:"packedDate,omitempty"` + + // password + Password string `json:"password,omitempty"` + + // paying with payment card + PayingWithPaymentCard bool `json:"payingWithPaymentCard,omitempty"` + + // phone number + PhoneNumber string `json:"phoneNumber,omitempty"` + + // pick up date + PickUpDate float64 `json:"pickUpDate,omitempty"` + + // pin + Pin string `json:"pin,omitempty"` + + // prepared by + PreparedBy string `json:"preparedBy,omitempty"` + + // prepared date + PreparedDate float64 `json:"preparedDate,omitempty"` + + // preparing fulfillment + PreparingFulfillment bool `json:"preparingFulfillment,omitempty"` + + // qb desktop journal entry ref + QbDesktopJournalEntryRef string `json:"qbDesktopJournalEntryRef,omitempty"` + + // qb desktop refund receipt + QbDesktopRefundReceipt string `json:"qbDesktopRefundReceipt,omitempty"` + + // qb desktop sales ref + QbDesktopSalesRef string `json:"qbDesktopSalesRef,omitempty"` + + // qb errored + QbErrored bool `json:"qbErrored,omitempty"` + + // qb journal entry ref + QbJournalEntryRef string `json:"qbJournalEntryRef,omitempty"` + + // qb refund errored + QbRefundErrored bool `json:"qbRefundErrored,omitempty"` + + // qb refund receipt + QbRefundReceipt string `json:"qbRefundReceipt,omitempty"` + + // qb sales receipt ref + QbSalesReceiptRef string `json:"qbSalesReceiptRef,omitempty"` + + // recent location + RecentLocation *TransactionsResponseValuesItems0SellerRecentLocation `json:"recentLocation,omitempty"` + + // refund payment options + RefundPaymentOptions []string `json:"refundPaymentOptions"` + + // refund version + RefundVersion string `json:"refundVersion,omitempty"` + + // registration expire date + RegistrationExpireDate float64 `json:"registrationExpireDate,omitempty"` + + // role Id + RoleID string `json:"roleId,omitempty"` + + // shops + Shops []string `json:"shops"` + + // short Id + ShortID string `json:"shortId,omitempty"` + + // state + State float64 `json:"state,omitempty"` + + // time card Id + TimeCardID string `json:"timeCardId,omitempty"` + + // tookan task Id + TookanTaskID string `json:"tookanTaskId,omitempty"` + + // transaction refund status + TransactionRefundStatus string `json:"transactionRefundStatus,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vehicle license plate + VehicleLicensePlate string `json:"vehicleLicensePlate,omitempty"` + + // vehicle make + VehicleMake string `json:"vehicleMake,omitempty"` + + // vehicle model + VehicleModel string `json:"vehicleModel,omitempty"` + + // vehicle pin + VehiclePin string `json:"vehiclePin,omitempty"` + + // vin no + VinNo string `json:"vinNo,omitempty"` +} + +// Validate validates this transactions response values items0 seller +func (m *TransactionsResponseValuesItems0Seller) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecentLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransactionsResponseValuesItems0Seller) 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("seller" + "." + "address") + } + return err + } + } + + return nil +} + +func (m *TransactionsResponseValuesItems0Seller) validateRecentLocation(formats strfmt.Registry) error { + + if swag.IsZero(m.RecentLocation) { // not required + return nil + } + + if m.RecentLocation != nil { + if err := m.RecentLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("seller" + "." + "recentLocation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Seller) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0Seller) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0Seller + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0SellerAddress transactions response values items0 seller address +// +// swagger:model TransactionsResponseValuesItems0SellerAddress +type TransactionsResponseValuesItems0SellerAddress struct { + + // address + Address string `json:"address,omitempty"` + + // address line1 + AddressLine1 string `json:"addressLine1,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this transactions response values items0 seller address +func (m *TransactionsResponseValuesItems0SellerAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0SellerAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0SellerAddress) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0SellerAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// TransactionsResponseValuesItems0SellerRecentLocation transactions response values items0 seller recent location +// +// swagger:model TransactionsResponseValuesItems0SellerRecentLocation +type TransactionsResponseValuesItems0SellerRecentLocation struct { + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // device Id + DeviceID string `json:"deviceId,omitempty"` + + // dirty + Dirty bool `json:"dirty,omitempty"` + + // employee Id + EmployeeID string `json:"employeeId,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // loc + Loc []float64 `json:"loc"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // shop Id + ShopID string `json:"shopId,omitempty"` + + // terminal Id + TerminalID string `json:"terminalId,omitempty"` + + // time card Id + TimeCardID string `json:"timeCardId,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this transactions response values items0 seller recent location +func (m *TransactionsResponseValuesItems0SellerRecentLocation) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0SellerRecentLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionsResponseValuesItems0SellerRecentLocation) UnmarshalBinary(b []byte) error { + var res TransactionsResponseValuesItems0SellerRecentLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/blaze/blaze_models/vendor_response.go b/api/blaze/blaze_models/vendor_response.go new file mode 100644 index 0000000..e7de880 --- /dev/null +++ b/api/blaze/blaze_models/vendor_response.go @@ -0,0 +1,356 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package blaze_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VendorResponse vendor response +// +// swagger:model VendorResponse +type VendorResponse struct { + + // active + Active bool `json:"active,omitempty"` + + // additional address list + AdditionalAddressList []string `json:"additionalAddressList"` + + // address + Address *VendorResponseAddress `json:"address,omitempty"` + + // arms length type + ArmsLengthType string `json:"armsLengthType,omitempty"` + + // assets + Assets []*VendorResponseAssetsItems0 `json:"assets"` + + // back order enabled + BackOrderEnabled bool `json:"backOrderEnabled,omitempty"` + + // brand list + BrandList []string `json:"brandList"` + + // brands + Brands []string `json:"brands"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // company licenses + CompanyLicenses []string `json:"companyLicenses"` + + // company type + CompanyType string `json:"companyType,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // credits + Credits float64 `json:"credits,omitempty"` + + // dba name + DbaName string `json:"dbaName,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // email + Email string `json:"email,omitempty"` + + // fax + Fax string `json:"fax,omitempty"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // import Id + ImportID string `json:"importId,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // licence type + LicenceType string `json:"licenceType,omitempty"` + + // license expiration date + LicenseExpirationDate float64 `json:"licenseExpirationDate,omitempty"` + + // license number + LicenseNumber string `json:"licenseNumber,omitempty"` + + // mobile number + MobileNumber string `json:"mobileNumber,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // notes + Notes []string `json:"notes"` + + // phone + Phone string `json:"phone,omitempty"` + + // qb desktop ref + QbDesktopRef string `json:"qbDesktopRef,omitempty"` + + // qb vendor ref + QbVendorRef []string `json:"qbVendorRef"` + + // related entity + RelatedEntity bool `json:"relatedEntity,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // vendor key + VendorKey string `json:"vendorKey,omitempty"` + + // vendor type + VendorType string `json:"vendorType,omitempty"` + + // website + Website string `json:"website,omitempty"` +} + +// Validate validates this vendor response +func (m *VendorResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VendorResponse) 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 *VendorResponse) validateAssets(formats strfmt.Registry) error { + + if swag.IsZero(m.Assets) { // not required + return nil + } + + for i := 0; i < len(m.Assets); i++ { + if swag.IsZero(m.Assets[i]) { // not required + continue + } + + if m.Assets[i] != nil { + if err := m.Assets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VendorResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VendorResponse) UnmarshalBinary(b []byte) error { + var res VendorResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// VendorResponseAddress vendor response address +// +// swagger:model VendorResponseAddress +type VendorResponseAddress struct { + + // address + Address string `json:"address,omitempty"` + + // city + City string `json:"city,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // country + Country string `json:"country,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // state + State string `json:"state,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` + + // zip code + ZipCode string `json:"zipCode,omitempty"` +} + +// Validate validates this vendor response address +func (m *VendorResponseAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VendorResponseAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VendorResponseAddress) UnmarshalBinary(b []byte) error { + var res VendorResponseAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// VendorResponseAssetsItems0 vendor response assets items0 +// +// swagger:model VendorResponseAssetsItems0 +type VendorResponseAssetsItems0 struct { + + // active + Active bool `json:"active,omitempty"` + + // asset type + AssetType string `json:"assetType,omitempty"` + + // company Id + CompanyID string `json:"companyId,omitempty"` + + // created + Created int64 `json:"created,omitempty"` + + // deleted + Deleted bool `json:"deleted,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // key + Key string `json:"key,omitempty"` + + // large URL + LargeURL string `json:"largeURL,omitempty"` + + // large x2 URL + LargeX2URL string `json:"largeX2URL,omitempty"` + + // medium URL + MediumURL string `json:"mediumURL,omitempty"` + + // modified + Modified int64 `json:"modified,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority float64 `json:"priority,omitempty"` + + // secured + Secured bool `json:"secured,omitempty"` + + // thumb URL + ThumbURL string `json:"thumbURL,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // updated + Updated bool `json:"updated,omitempty"` +} + +// Validate validates this vendor response assets items0 +func (m *VendorResponseAssetsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VendorResponseAssetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VendorResponseAssetsItems0) UnmarshalBinary(b []byte) error { + var res VendorResponseAssetsItems0 + 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..4bc39d4 --- /dev/null +++ b/api/crm/crm_client/accounts/accounts_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAccountOK, error) + + GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error) + + GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsObservableOK, error) + + PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error) + + PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter) (*PutAccountOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteAccount deletes an account + + Delete Taxnexus Account record +*/ +func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteAccountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteAccountParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 taxnexus accounts in an observable array + + A list of accounts in a simple JSON array +*/ +func (a *Client) GetAccountsObservable(params *GetAccountsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 taxnexus + + Account record to be added +*/ +func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAccountsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutAccountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutAccountParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..7a0dfcb --- /dev/null +++ b/api/crm/crm_client/accounts/delete_account_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewDeleteAccountParams() *DeleteAccountParams { + var () + return &DeleteAccountParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteAccountParamsWithTimeout creates a new DeleteAccountParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteAccountParamsWithTimeout(timeout time.Duration) *DeleteAccountParams { + var () + return &DeleteAccountParams{ + + timeout: timeout, + } +} + +// NewDeleteAccountParamsWithContext creates a new DeleteAccountParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteAccountParamsWithContext(ctx context.Context) *DeleteAccountParams { + var () + return &DeleteAccountParams{ + + Context: ctx, + } +} + +// NewDeleteAccountParamsWithHTTPClient creates a new DeleteAccountParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteAccountParamsWithHTTPClient(client *http.Client) *DeleteAccountParams { + var () + 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 + Taxnexus Record Id of an Account + + */ + AccountID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..27778ed --- /dev/null +++ b/api/crm/crm_client/accounts/delete_account_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewDeleteAccountOK creates a DeleteAccountOK with default headers values +func NewDeleteAccountOK() *DeleteAccountOK { + return &DeleteAccountOK{} +} + +/*DeleteAccountOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..31c4824 --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_observable_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetAccountsObservableParams() *GetAccountsObservableParams { + var () + return &GetAccountsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountsObservableParamsWithTimeout creates a new GetAccountsObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountsObservableParamsWithTimeout(timeout time.Duration) *GetAccountsObservableParams { + var () + return &GetAccountsObservableParams{ + + timeout: timeout, + } +} + +// NewGetAccountsObservableParamsWithContext creates a new GetAccountsObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountsObservableParamsWithContext(ctx context.Context) *GetAccountsObservableParams { + var () + return &GetAccountsObservableParams{ + + Context: ctx, + } +} + +// NewGetAccountsObservableParamsWithHTTPClient creates a new GetAccountsObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountsObservableParamsWithHTTPClient(client *http.Client) *GetAccountsObservableParams { + var () + 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 + Taxnexus 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 +} + +// 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..878925c --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetAccountsObservableOK creates a GetAccountsObservableOK with default headers values +func NewGetAccountsObservableOK() *GetAccountsObservableOK { + return &GetAccountsObservableOK{} +} + +/*GetAccountsObservableOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..640cccd --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetAccountsParams() *GetAccountsParams { + var () + return &GetAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountsParamsWithTimeout creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountsParamsWithTimeout(timeout time.Duration) *GetAccountsParams { + var () + return &GetAccountsParams{ + + timeout: timeout, + } +} + +// NewGetAccountsParamsWithContext creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams { + var () + return &GetAccountsParams{ + + Context: ctx, + } +} + +// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams { + var () + 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 + Taxnexus 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 + + */ + Limit *int64 + /*Name + The Name of this Object + + */ + Name *string + /*Offset + How many objects to skip? + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..2fd8730 --- /dev/null +++ b/api/crm/crm_client/accounts/get_accounts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetAccountsOK creates a GetAccountsOK with default headers values +func NewGetAccountsOK() *GetAccountsOK { + return &GetAccountsOK{} +} + +/*GetAccountsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..6fb38db --- /dev/null +++ b/api/crm/crm_client/accounts/post_accounts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/crm/crm_models" +) + +// NewPostAccountsParams creates a new PostAccountsParams object +// with the default values initialized. +func NewPostAccountsParams() *PostAccountsParams { + var () + return &PostAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAccountsParamsWithTimeout creates a new PostAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAccountsParamsWithTimeout(timeout time.Duration) *PostAccountsParams { + var () + return &PostAccountsParams{ + + timeout: timeout, + } +} + +// NewPostAccountsParamsWithContext creates a new PostAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAccountsParamsWithContext(ctx context.Context) *PostAccountsParams { + var () + return &PostAccountsParams{ + + Context: ctx, + } +} + +// NewPostAccountsParamsWithHTTPClient creates a new PostAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAccountsParamsWithHTTPClient(client *http.Client) *PostAccountsParams { + var () + 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 +} + +// 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..e54af16 --- /dev/null +++ b/api/crm/crm_client/accounts/post_accounts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostAccountsOK creates a PostAccountsOK with default headers values +func NewPostAccountsOK() *PostAccountsOK { + return &PostAccountsOK{} +} + +/*PostAccountsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..e828a83 --- /dev/null +++ b/api/crm/crm_client/accounts/put_account_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/crm/crm_models" +) + +// NewPutAccountParams creates a new PutAccountParams object +// with the default values initialized. +func NewPutAccountParams() *PutAccountParams { + var () + return &PutAccountParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutAccountParamsWithTimeout creates a new PutAccountParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutAccountParamsWithTimeout(timeout time.Duration) *PutAccountParams { + var () + return &PutAccountParams{ + + timeout: timeout, + } +} + +// NewPutAccountParamsWithContext creates a new PutAccountParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutAccountParamsWithContext(ctx context.Context) *PutAccountParams { + var () + return &PutAccountParams{ + + Context: ctx, + } +} + +// NewPutAccountParamsWithHTTPClient creates a new PutAccountParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutAccountParamsWithHTTPClient(client *http.Client) *PutAccountParams { + var () + 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 +} + +// 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..a7745e9 --- /dev/null +++ b/api/crm/crm_client/accounts/put_account_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutAccountOK creates a PutAccountOK with default headers values +func NewPutAccountOK() *PutAccountOK { + return &PutAccountOK{} +} + +/*PutAccountOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..c589a61 --- /dev/null +++ b/api/crm/crm_client/companies/companies_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesOK, error) + + GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesObservableOK, error) + + PostCompanies(params *PostCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetCompaniesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCompaniesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 taxnexus companies in an observable array + + A list of companies in a simple JSON array +*/ +func (a *Client) GetCompaniesObservable(params *GetCompaniesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCompaniesObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PostCompaniesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCompaniesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..fb5f538 --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_observable_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetCompaniesObservableParams() *GetCompaniesObservableParams { + var () + return &GetCompaniesObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCompaniesObservableParamsWithTimeout creates a new GetCompaniesObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCompaniesObservableParamsWithTimeout(timeout time.Duration) *GetCompaniesObservableParams { + var () + return &GetCompaniesObservableParams{ + + timeout: timeout, + } +} + +// NewGetCompaniesObservableParamsWithContext creates a new GetCompaniesObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCompaniesObservableParamsWithContext(ctx context.Context) *GetCompaniesObservableParams { + var () + return &GetCompaniesObservableParams{ + + Context: ctx, + } +} + +// NewGetCompaniesObservableParamsWithHTTPClient creates a new GetCompaniesObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCompaniesObservableParamsWithHTTPClient(client *http.Client) *GetCompaniesObservableParams { + var () + 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 + Taxnexus Company record ID + + */ + CompanyID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..a13dc68 --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetCompaniesObservableOK creates a GetCompaniesObservableOK with default headers values +func NewGetCompaniesObservableOK() *GetCompaniesObservableOK { + return &GetCompaniesObservableOK{} +} + +/*GetCompaniesObservableOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..cabaefa --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetCompaniesParams() *GetCompaniesParams { + var () + return &GetCompaniesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCompaniesParamsWithTimeout creates a new GetCompaniesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCompaniesParamsWithTimeout(timeout time.Duration) *GetCompaniesParams { + var () + return &GetCompaniesParams{ + + timeout: timeout, + } +} + +// NewGetCompaniesParamsWithContext creates a new GetCompaniesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCompaniesParamsWithContext(ctx context.Context) *GetCompaniesParams { + var () + return &GetCompaniesParams{ + + Context: ctx, + } +} + +// NewGetCompaniesParamsWithHTTPClient creates a new GetCompaniesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCompaniesParamsWithHTTPClient(client *http.Client) *GetCompaniesParams { + var () + 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 + Taxnexus Company record ID + + */ + CompanyID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..0942066 --- /dev/null +++ b/api/crm/crm_client/companies/get_companies_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetCompaniesOK creates a GetCompaniesOK with default headers values +func NewGetCompaniesOK() *GetCompaniesOK { + return &GetCompaniesOK{} +} + +/*GetCompaniesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..134d41c --- /dev/null +++ b/api/crm/crm_client/companies/post_companies_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/crm/crm_models" +) + +// NewPostCompaniesParams creates a new PostCompaniesParams object +// with the default values initialized. +func NewPostCompaniesParams() *PostCompaniesParams { + var () + return &PostCompaniesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCompaniesParamsWithTimeout creates a new PostCompaniesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCompaniesParamsWithTimeout(timeout time.Duration) *PostCompaniesParams { + var () + return &PostCompaniesParams{ + + timeout: timeout, + } +} + +// NewPostCompaniesParamsWithContext creates a new PostCompaniesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCompaniesParamsWithContext(ctx context.Context) *PostCompaniesParams { + var () + return &PostCompaniesParams{ + + Context: ctx, + } +} + +// NewPostCompaniesParamsWithHTTPClient creates a new PostCompaniesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCompaniesParamsWithHTTPClient(client *http.Client) *PostCompaniesParams { + var () + 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 +} + +// 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..2650027 --- /dev/null +++ b/api/crm/crm_client/companies/post_companies_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostCompaniesOK creates a PostCompaniesOK with default headers values +func NewPostCompaniesOK() *PostCompaniesOK { + return &PostCompaniesOK{} +} + +/*PostCompaniesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..90d2274 --- /dev/null +++ b/api/crm/crm_client/contacts/contacts_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error) + + GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsOK, error) + + GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsObservableOK, error) + + PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PostContactsOK, error) + + PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PutContactsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteContact deletes a contact + + Delete Taxnexus Contact record +*/ +func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteContactParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetContactsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 taxnexus contacts in an observable array + + A list of contacts in a simple JSON array +*/ +func (a *Client) GetContactsObservable(params *GetContactsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetContactsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PostContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostContactsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutContactsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..4a6346d --- /dev/null +++ b/api/crm/crm_client/contacts/delete_contact_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewDeleteContactParams() *DeleteContactParams { + var () + return &DeleteContactParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteContactParamsWithTimeout creates a new DeleteContactParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteContactParamsWithTimeout(timeout time.Duration) *DeleteContactParams { + var () + return &DeleteContactParams{ + + timeout: timeout, + } +} + +// NewDeleteContactParamsWithContext creates a new DeleteContactParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteContactParamsWithContext(ctx context.Context) *DeleteContactParams { + var () + return &DeleteContactParams{ + + Context: ctx, + } +} + +// NewDeleteContactParamsWithHTTPClient creates a new DeleteContactParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteContactParamsWithHTTPClient(client *http.Client) *DeleteContactParams { + var () + 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 + Taxnexus Contact record ID + + */ + ContactID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..0cfcf1a --- /dev/null +++ b/api/crm/crm_client/contacts/delete_contact_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewDeleteContactOK creates a DeleteContactOK with default headers values +func NewDeleteContactOK() *DeleteContactOK { + return &DeleteContactOK{} +} + +/*DeleteContactOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..2d95e7f --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_observable_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetContactsObservableParams() *GetContactsObservableParams { + var () + return &GetContactsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetContactsObservableParamsWithTimeout creates a new GetContactsObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetContactsObservableParamsWithTimeout(timeout time.Duration) *GetContactsObservableParams { + var () + return &GetContactsObservableParams{ + + timeout: timeout, + } +} + +// NewGetContactsObservableParamsWithContext creates a new GetContactsObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetContactsObservableParamsWithContext(ctx context.Context) *GetContactsObservableParams { + var () + return &GetContactsObservableParams{ + + Context: ctx, + } +} + +// NewGetContactsObservableParamsWithHTTPClient creates a new GetContactsObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetContactsObservableParamsWithHTTPClient(client *http.Client) *GetContactsObservableParams { + var () + 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 + Taxnexus 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 +} + +// 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..9cb6dd3 --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetContactsObservableOK creates a GetContactsObservableOK with default headers values +func NewGetContactsObservableOK() *GetContactsObservableOK { + return &GetContactsObservableOK{} +} + +/*GetContactsObservableOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..9d71a07 --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetContactsParams() *GetContactsParams { + var () + return &GetContactsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetContactsParamsWithTimeout creates a new GetContactsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetContactsParamsWithTimeout(timeout time.Duration) *GetContactsParams { + var () + return &GetContactsParams{ + + timeout: timeout, + } +} + +// NewGetContactsParamsWithContext creates a new GetContactsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetContactsParamsWithContext(ctx context.Context) *GetContactsParams { + var () + return &GetContactsParams{ + + Context: ctx, + } +} + +// NewGetContactsParamsWithHTTPClient creates a new GetContactsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetContactsParamsWithHTTPClient(client *http.Client) *GetContactsParams { + var () + 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 + Taxnexus Contact record ID + + */ + ContactID *string + /*Email + Email address used for identity lookup + + */ + Email *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Name + The Name of this Object + + */ + Name *string + /*Offset + How many objects to skip? + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..6f06301 --- /dev/null +++ b/api/crm/crm_client/contacts/get_contacts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetContactsOK creates a GetContactsOK with default headers values +func NewGetContactsOK() *GetContactsOK { + return &GetContactsOK{} +} + +/*GetContactsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..d7df6e3 --- /dev/null +++ b/api/crm/crm_client/contacts/post_contacts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/crm/crm_models" +) + +// NewPostContactsParams creates a new PostContactsParams object +// with the default values initialized. +func NewPostContactsParams() *PostContactsParams { + var () + return &PostContactsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostContactsParamsWithTimeout creates a new PostContactsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostContactsParamsWithTimeout(timeout time.Duration) *PostContactsParams { + var () + return &PostContactsParams{ + + timeout: timeout, + } +} + +// NewPostContactsParamsWithContext creates a new PostContactsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostContactsParamsWithContext(ctx context.Context) *PostContactsParams { + var () + return &PostContactsParams{ + + Context: ctx, + } +} + +// NewPostContactsParamsWithHTTPClient creates a new PostContactsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostContactsParamsWithHTTPClient(client *http.Client) *PostContactsParams { + var () + 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 +} + +// 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..6603594 --- /dev/null +++ b/api/crm/crm_client/contacts/post_contacts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostContactsOK creates a PostContactsOK with default headers values +func NewPostContactsOK() *PostContactsOK { + return &PostContactsOK{} +} + +/*PostContactsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..e008827 --- /dev/null +++ b/api/crm/crm_client/contacts/put_contacts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/crm/crm_models" +) + +// NewPutContactsParams creates a new PutContactsParams object +// with the default values initialized. +func NewPutContactsParams() *PutContactsParams { + var () + return &PutContactsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutContactsParamsWithTimeout creates a new PutContactsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutContactsParamsWithTimeout(timeout time.Duration) *PutContactsParams { + var () + return &PutContactsParams{ + + timeout: timeout, + } +} + +// NewPutContactsParamsWithContext creates a new PutContactsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutContactsParamsWithContext(ctx context.Context) *PutContactsParams { + var () + return &PutContactsParams{ + + Context: ctx, + } +} + +// NewPutContactsParamsWithHTTPClient creates a new PutContactsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutContactsParamsWithHTTPClient(client *http.Client) *PutContactsParams { + var () + 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 +} + +// 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..af5abfe --- /dev/null +++ b/api/crm/crm_client/contacts/put_contacts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutContactsOK creates a PutContactsOK with default headers values +func NewPutContactsOK() *PutContactsOK { + return &PutContactsOK{} +} + +/*PutContactsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..e442184 --- /dev/null +++ b/api/crm/crm_client/cors/account_options_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewAccountOptionsObservableParams() *AccountOptionsObservableParams { + + return &AccountOptionsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAccountOptionsObservableParamsWithTimeout creates a new AccountOptionsObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..4319591 --- /dev/null +++ b/api/crm/crm_client/cors/account_options_observable_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewAccountOptionsObservableOK creates a AccountOptionsObservableOK with default headers values +func NewAccountOptionsObservableOK() *AccountOptionsObservableOK { + return &AccountOptionsObservableOK{} +} + +/*AccountOptionsObservableOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..6f6c9df --- /dev/null +++ b/api/crm/crm_client/cors/account_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewAccountOptionsParams() *AccountOptionsParams { + + return &AccountOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAccountOptionsParamsWithTimeout creates a new AccountOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..8bfabd3 --- /dev/null +++ b/api/crm/crm_client/cors/account_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewAccountOptionsOK creates a AccountOptionsOK with default headers values +func NewAccountOptionsOK() *AccountOptionsOK { + return &AccountOptionsOK{} +} + +/*AccountOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..1984960 --- /dev/null +++ b/api/crm/crm_client/cors/company_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewCompanyObservableOptionsParams() *CompanyObservableOptionsParams { + + return &CompanyObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompanyObservableOptionsParamsWithTimeout creates a new CompanyObservableOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..dea5eae --- /dev/null +++ b/api/crm/crm_client/cors/company_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewCompanyObservableOptionsOK creates a CompanyObservableOptionsOK with default headers values +func NewCompanyObservableOptionsOK() *CompanyObservableOptionsOK { + return &CompanyObservableOptionsOK{} +} + +/*CompanyObservableOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..51f6a63 --- /dev/null +++ b/api/crm/crm_client/cors/company_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewCompanyOptionsParams() *CompanyOptionsParams { + + return &CompanyOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompanyOptionsParamsWithTimeout creates a new CompanyOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..2b8d7b0 --- /dev/null +++ b/api/crm/crm_client/cors/company_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewCompanyOptionsOK creates a CompanyOptionsOK with default headers values +func NewCompanyOptionsOK() *CompanyOptionsOK { + return &CompanyOptionsOK{} +} + +/*CompanyOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..5d350ec --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewContactOptionsObservableParams() *ContactOptionsObservableParams { + + return &ContactOptionsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewContactOptionsObservableParamsWithTimeout creates a new ContactOptionsObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..95d5386 --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_observable_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewContactOptionsObservableOK creates a ContactOptionsObservableOK with default headers values +func NewContactOptionsObservableOK() *ContactOptionsObservableOK { + return &ContactOptionsObservableOK{} +} + +/*ContactOptionsObservableOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..b07e0cd --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewContactOptionsParams() *ContactOptionsParams { + + return &ContactOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewContactOptionsParamsWithTimeout creates a new ContactOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..7d5ab7a --- /dev/null +++ b/api/crm/crm_client/cors/contact_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewContactOptionsOK creates a ContactOptionsOK with default headers values +func NewContactOptionsOK() *ContactOptionsOK { + return &ContactOptionsOK{} +} + +/*ContactOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..3f0d998 --- /dev/null +++ b/api/crm/crm_client/cors/cors_client.go @@ -0,0 +1,328 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error) + + AccountOptionsObservable(params *AccountOptionsObservableParams) (*AccountOptionsObservableOK, error) + + CompanyObservableOptions(params *CompanyObservableOptionsParams) (*CompanyObservableOptionsOK, error) + + CompanyOptions(params *CompanyOptionsParams) (*CompanyOptionsOK, error) + + ContactOptions(params *ContactOptionsParams) (*ContactOptionsOK, error) + + ContactOptionsObservable(params *ContactOptionsObservableParams) (*ContactOptionsObservableOK, error) + + LeadOptions(params *LeadOptionsParams) (*LeadOptionsOK, error) + + LeadOptionsObservable(params *LeadOptionsObservableParams) (*LeadOptionsObservableOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AccountOptions CORS support +*/ +func (a *Client) AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAccountOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*AccountOptionsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAccountOptionsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*CompanyObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompanyObservableOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*CompanyOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompanyOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*ContactOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewContactOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*ContactOptionsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewContactOptionsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*LeadOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLeadOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*LeadOptionsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLeadOptionsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..562f889 --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewLeadOptionsObservableParams() *LeadOptionsObservableParams { + + return &LeadOptionsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewLeadOptionsObservableParamsWithTimeout creates a new LeadOptionsObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..57f1e5f --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_observable_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewLeadOptionsObservableOK creates a LeadOptionsObservableOK with default headers values +func NewLeadOptionsObservableOK() *LeadOptionsObservableOK { + return &LeadOptionsObservableOK{} +} + +/*LeadOptionsObservableOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..bf2f295 --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewLeadOptionsParams() *LeadOptionsParams { + + return &LeadOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewLeadOptionsParamsWithTimeout creates a new LeadOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..a01a60b --- /dev/null +++ b/api/crm/crm_client/cors/lead_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewLeadOptionsOK creates a LeadOptionsOK with default headers values +func NewLeadOptionsOK() *LeadOptionsOK { + return &LeadOptionsOK{} +} + +/*LeadOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..f78ecd1 --- /dev/null +++ b/api/crm/crm_client/crm_client.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/crm/crm_client/accounts" + "github.com/taxnexus/go/lib/api/crm/crm_client/companies" + "github.com/taxnexus/go/lib/api/crm/crm_client/contacts" + "github.com/taxnexus/go/lib/api/crm/crm_client/cors" + "github.com/taxnexus/go/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.fabric.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..25e4ce1 --- /dev/null +++ b/api/crm/crm_client/leads/delete_lead_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewDeleteLeadParams() *DeleteLeadParams { + var () + return &DeleteLeadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteLeadParamsWithTimeout creates a new DeleteLeadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteLeadParamsWithTimeout(timeout time.Duration) *DeleteLeadParams { + var () + return &DeleteLeadParams{ + + timeout: timeout, + } +} + +// NewDeleteLeadParamsWithContext creates a new DeleteLeadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteLeadParamsWithContext(ctx context.Context) *DeleteLeadParams { + var () + return &DeleteLeadParams{ + + Context: ctx, + } +} + +// NewDeleteLeadParamsWithHTTPClient creates a new DeleteLeadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteLeadParamsWithHTTPClient(client *http.Client) *DeleteLeadParams { + var () + 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 + Taxnexus Lead record ID + + */ + LeadID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..3541cb8 --- /dev/null +++ b/api/crm/crm_client/leads/delete_lead_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewDeleteLeadOK creates a DeleteLeadOK with default headers values +func NewDeleteLeadOK() *DeleteLeadOK { + return &DeleteLeadOK{} +} + +/*DeleteLeadOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..687c5bc --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_observable_parameters.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetLeadsObservableParams() *GetLeadsObservableParams { + var () + return &GetLeadsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLeadsObservableParamsWithTimeout creates a new GetLeadsObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLeadsObservableParamsWithTimeout(timeout time.Duration) *GetLeadsObservableParams { + var () + return &GetLeadsObservableParams{ + + timeout: timeout, + } +} + +// NewGetLeadsObservableParamsWithContext creates a new GetLeadsObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLeadsObservableParamsWithContext(ctx context.Context) *GetLeadsObservableParams { + var () + return &GetLeadsObservableParams{ + + Context: ctx, + } +} + +// NewGetLeadsObservableParamsWithHTTPClient creates a new GetLeadsObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLeadsObservableParamsWithHTTPClient(client *http.Client) *GetLeadsObservableParams { + var () + 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 + Taxnexus Lead record ID + + */ + LeadID *string + /*Name + The Name of this Object + + */ + Name *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..6a4b3fa --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetLeadsObservableOK creates a GetLeadsObservableOK with default headers values +func NewGetLeadsObservableOK() *GetLeadsObservableOK { + return &GetLeadsObservableOK{} +} + +/*GetLeadsObservableOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..e45210c --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetLeadsParams() *GetLeadsParams { + var () + return &GetLeadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLeadsParamsWithTimeout creates a new GetLeadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLeadsParamsWithTimeout(timeout time.Duration) *GetLeadsParams { + var () + return &GetLeadsParams{ + + timeout: timeout, + } +} + +// NewGetLeadsParamsWithContext creates a new GetLeadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLeadsParamsWithContext(ctx context.Context) *GetLeadsParams { + var () + return &GetLeadsParams{ + + Context: ctx, + } +} + +// NewGetLeadsParamsWithHTTPClient creates a new GetLeadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLeadsParamsWithHTTPClient(client *http.Client) *GetLeadsParams { + var () + 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 + Taxnexus Lead record ID + + */ + LeadID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Name + The Name of this Object + + */ + Name *string + /*Offset + How many objects to skip? + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..4c9975c --- /dev/null +++ b/api/crm/crm_client/leads/get_leads_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetLeadsOK creates a GetLeadsOK with default headers values +func NewGetLeadsOK() *GetLeadsOK { + return &GetLeadsOK{} +} + +/*GetLeadsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..9038071 --- /dev/null +++ b/api/crm/crm_client/leads/leads_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteLeadOK, error) + + GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*GetLeadsOK, error) + + GetLeadsObservable(params *GetLeadsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetLeadsObservableOK, error) + + PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*PostLeadsOK, error) + + PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter) (*PutLeadsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteLead deletes a contact + + Delete Taxnexus Lead record +*/ +func (a *Client) DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteLeadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteLeadParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetLeadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLeadsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 taxnexus leads in an observable array + + A list of leads in a simple JSON array +*/ +func (a *Client) GetLeadsObservable(params *GetLeadsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetLeadsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLeadsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PostLeadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostLeadsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutLeadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutLeadsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..71d78da --- /dev/null +++ b/api/crm/crm_client/leads/post_leads_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/crm/crm_models" +) + +// NewPostLeadsParams creates a new PostLeadsParams object +// with the default values initialized. +func NewPostLeadsParams() *PostLeadsParams { + var () + return &PostLeadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostLeadsParamsWithTimeout creates a new PostLeadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostLeadsParamsWithTimeout(timeout time.Duration) *PostLeadsParams { + var () + return &PostLeadsParams{ + + timeout: timeout, + } +} + +// NewPostLeadsParamsWithContext creates a new PostLeadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostLeadsParamsWithContext(ctx context.Context) *PostLeadsParams { + var () + return &PostLeadsParams{ + + Context: ctx, + } +} + +// NewPostLeadsParamsWithHTTPClient creates a new PostLeadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostLeadsParamsWithHTTPClient(client *http.Client) *PostLeadsParams { + var () + 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 +} + +// 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..e867704 --- /dev/null +++ b/api/crm/crm_client/leads/post_leads_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostLeadsOK creates a PostLeadsOK with default headers values +func NewPostLeadsOK() *PostLeadsOK { + return &PostLeadsOK{} +} + +/*PostLeadsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..18a3865 --- /dev/null +++ b/api/crm/crm_client/leads/put_leads_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/crm/crm_models" +) + +// NewPutLeadsParams creates a new PutLeadsParams object +// with the default values initialized. +func NewPutLeadsParams() *PutLeadsParams { + var () + return &PutLeadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutLeadsParamsWithTimeout creates a new PutLeadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutLeadsParamsWithTimeout(timeout time.Duration) *PutLeadsParams { + var () + return &PutLeadsParams{ + + timeout: timeout, + } +} + +// NewPutLeadsParamsWithContext creates a new PutLeadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutLeadsParamsWithContext(ctx context.Context) *PutLeadsParams { + var () + return &PutLeadsParams{ + + Context: ctx, + } +} + +// NewPutLeadsParamsWithHTTPClient creates a new PutLeadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutLeadsParamsWithHTTPClient(client *http.Client) *PutLeadsParams { + var () + 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 +} + +// 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..8e1983e --- /dev/null +++ b/api/crm/crm_client/leads/put_leads_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutLeadsOK creates a PutLeadsOK with default headers values +func NewPutLeadsOK() *PutLeadsOK { + return &PutLeadsOK{} +} + +/*PutLeadsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..853fd6e --- /dev/null +++ b/api/crm/crm_models/account.go @@ -0,0 +1,402 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus 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 +} + +// 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..ccbce2d --- /dev/null +++ b/api/crm/crm_models/account_basic.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountBasic account basic +// +// swagger:model AccountBasic +type AccountBasic struct { + + // Taxnexus 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"` + + // Taxnexus 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 +} + +// 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..2cb6649 --- /dev/null +++ b/api/crm/crm_models/account_basic_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..c55bc4c --- /dev/null +++ b/api/crm/crm_models/account_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..c2b46dc --- /dev/null +++ b/api/crm/crm_models/account_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..d98c3dd --- /dev/null +++ b/api/crm/crm_models/address.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..9777b87 --- /dev/null +++ b/api/crm/crm_models/company.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Company company +// +// swagger:model Company +type Company struct { + + // Taxnexus 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"` + + // Taxnexus 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 +} + +// 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..2b2988b --- /dev/null +++ b/api/crm/crm_models/company_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..89455ba --- /dev/null +++ b/api/crm/crm_models/company_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..1c5947c --- /dev/null +++ b/api/crm/crm_models/contact.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus 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"` + + // Taxnexus 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 +} + +// 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..66013ea --- /dev/null +++ b/api/crm/crm_models/contact_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..2523c48 --- /dev/null +++ b/api/crm/crm_models/contact_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..0c31d26 --- /dev/null +++ b/api/crm/crm_models/delete_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..2c91a29 --- /dev/null +++ b/api/crm/crm_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..a66045c --- /dev/null +++ b/api/crm/crm_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..5f78804 --- /dev/null +++ b/api/crm/crm_models/lead.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus 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 +} + +// 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..51dd97a --- /dev/null +++ b/api/crm/crm_models/lead_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..3c93260 --- /dev/null +++ b/api/crm/crm_models/lead_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..17d286a --- /dev/null +++ b/api/crm/crm_models/message.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..d581cc4 --- /dev/null +++ b/api/crm/crm_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..5985615 --- /dev/null +++ b/api/crm/crm_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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..6faf4de --- /dev/null +++ b/api/crm/crm_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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..ec28cbc --- /dev/null +++ b/api/devops/devops_client/cluster/cluster_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCluster(params *GetClusterParams, authInfo runtime.ClientAuthInfoWriter) (*GetClusterOK, error) + + GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter) (*GetClustersOK, error) + + GetClustersObservable(params *GetClustersObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetClustersObservableOK, error) + + PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter) (*PostClustersOK, error) + + PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClustersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetClustersObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClustersObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter) (*PostClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostClustersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter) (*PutClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClustersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..4f3a0a6 --- /dev/null +++ b/api/devops/devops_client/cluster/get_cluster_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetClusterParams() *GetClusterParams { + var () + return &GetClusterParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterParamsWithTimeout creates a new GetClusterParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterParamsWithTimeout(timeout time.Duration) *GetClusterParams { + var () + return &GetClusterParams{ + + timeout: timeout, + } +} + +// NewGetClusterParamsWithContext creates a new GetClusterParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterParamsWithContext(ctx context.Context) *GetClusterParams { + var () + return &GetClusterParams{ + + Context: ctx, + } +} + +// NewGetClusterParamsWithHTTPClient creates a new GetClusterParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterParamsWithHTTPClient(client *http.Client) *GetClusterParams { + var () + 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 + Taxnexus Record Id of a Cluster + + */ + ClusterIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..d4e8160 --- /dev/null +++ b/api/devops/devops_client/cluster/get_cluster_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetClusterOK creates a GetClusterOK with default headers values +func NewGetClusterOK() *GetClusterOK { + return &GetClusterOK{} +} + +/*GetClusterOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..e3d81ac --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetClustersObservableParams() *GetClustersObservableParams { + + return &GetClustersObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClustersObservableParamsWithTimeout creates a new GetClustersObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..b18f02b --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetClustersObservableOK creates a GetClustersObservableOK with default headers values +func NewGetClustersObservableOK() *GetClustersObservableOK { + return &GetClustersObservableOK{} +} + +/*GetClustersObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..d3676b6 --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetClustersParams() *GetClustersParams { + var () + return &GetClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClustersParamsWithTimeout creates a new GetClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClustersParamsWithTimeout(timeout time.Duration) *GetClustersParams { + var () + return &GetClustersParams{ + + timeout: timeout, + } +} + +// NewGetClustersParamsWithContext creates a new GetClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClustersParamsWithContext(ctx context.Context) *GetClustersParams { + var () + return &GetClustersParams{ + + Context: ctx, + } +} + +// NewGetClustersParamsWithHTTPClient creates a new GetClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClustersParamsWithHTTPClient(client *http.Client) *GetClustersParams { + var () + 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 + Taxnexus Record Id of a Cluster + + */ + ClusterID *string + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..71b36c3 --- /dev/null +++ b/api/devops/devops_client/cluster/get_clusters_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetClustersOK creates a GetClustersOK with default headers values +func NewGetClustersOK() *GetClustersOK { + return &GetClustersOK{} +} + +/*GetClustersOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..b1ea605 --- /dev/null +++ b/api/devops/devops_client/cluster/post_clusters_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostClustersParams creates a new PostClustersParams object +// with the default values initialized. +func NewPostClustersParams() *PostClustersParams { + var () + return &PostClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostClustersParamsWithTimeout creates a new PostClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostClustersParamsWithTimeout(timeout time.Duration) *PostClustersParams { + var () + return &PostClustersParams{ + + timeout: timeout, + } +} + +// NewPostClustersParamsWithContext creates a new PostClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostClustersParamsWithContext(ctx context.Context) *PostClustersParams { + var () + return &PostClustersParams{ + + Context: ctx, + } +} + +// NewPostClustersParamsWithHTTPClient creates a new PostClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostClustersParamsWithHTTPClient(client *http.Client) *PostClustersParams { + var () + 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 +} + +// 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..f69f7bc --- /dev/null +++ b/api/devops/devops_client/cluster/post_clusters_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostClustersOK creates a PostClustersOK with default headers values +func NewPostClustersOK() *PostClustersOK { + return &PostClustersOK{} +} + +/*PostClustersOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..6a5a8bb --- /dev/null +++ b/api/devops/devops_client/cluster/put_clusters_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPutClustersParams creates a new PutClustersParams object +// with the default values initialized. +func NewPutClustersParams() *PutClustersParams { + var () + return &PutClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClustersParamsWithTimeout creates a new PutClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClustersParamsWithTimeout(timeout time.Duration) *PutClustersParams { + var () + return &PutClustersParams{ + + timeout: timeout, + } +} + +// NewPutClustersParamsWithContext creates a new PutClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClustersParamsWithContext(ctx context.Context) *PutClustersParams { + var () + return &PutClustersParams{ + + Context: ctx, + } +} + +// NewPutClustersParamsWithHTTPClient creates a new PutClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClustersParamsWithHTTPClient(client *http.Client) *PutClustersParams { + var () + 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 +} + +// 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..72dc28f --- /dev/null +++ b/api/devops/devops_client/cluster/put_clusters_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutClustersOK creates a PutClustersOK with default headers values +func NewPutClustersOK() *PutClustersOK { + return &PutClustersOK{} +} + +/*PutClustersOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..716c906 --- /dev/null +++ b/api/devops/devops_client/cors/cluster_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewClusterOptionsParams() *ClusterOptionsParams { + + return &ClusterOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewClusterOptionsParamsWithTimeout creates a new ClusterOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..8decd93 --- /dev/null +++ b/api/devops/devops_client/cors/cluster_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewClusterOptionsOK creates a ClusterOptionsOK with default headers values +func NewClusterOptionsOK() *ClusterOptionsOK { + return &ClusterOptionsOK{} +} + +/*ClusterOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..c15971d --- /dev/null +++ b/api/devops/devops_client/cors/clusters_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewClustersOptionsParams() *ClustersOptionsParams { + + return &ClustersOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewClustersOptionsParamsWithTimeout creates a new ClustersOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..a4bc29c --- /dev/null +++ b/api/devops/devops_client/cors/clusters_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewClustersOptionsOK creates a ClustersOptionsOK with default headers values +func NewClustersOptionsOK() *ClustersOptionsOK { + return &ClustersOptionsOK{} +} + +/*ClustersOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..bc17303 --- /dev/null +++ b/api/devops/devops_client/cors/cors_client.go @@ -0,0 +1,616 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + ClusterOptions(params *ClusterOptionsParams) (*ClusterOptionsOK, error) + + ClustersOptions(params *ClustersOptionsParams) (*ClustersOptionsOK, error) + + DatabaseOptions(params *DatabaseOptionsParams) (*DatabaseOptionsOK, error) + + DatabasesOptions(params *DatabasesOptionsParams) (*DatabasesOptionsOK, error) + + IngestOptions(params *IngestOptionsParams) (*IngestOptionsOK, error) + + IngestsOptions(params *IngestsOptionsParams) (*IngestsOptionsOK, error) + + JobOptions(params *JobOptionsParams) (*JobOptionsOK, error) + + JobsOptions(params *JobsOptionsParams) (*JobsOptionsOK, error) + + ServiceOptions(params *ServiceOptionsParams) (*ServiceOptionsOK, error) + + ServicesOptions(params *ServicesOptionsParams) (*ServicesOptionsOK, error) + + TemplateOptions(params *TemplateOptionsParams) (*TemplateOptionsOK, error) + + TemplatesOptions(params *TemplatesOptionsParams) (*TemplatesOptionsOK, error) + + TenantOptions(params *TenantOptionsParams) (*TenantOptionsOK, error) + + TenantsOptions(params *TenantsOptionsParams) (*TenantsOptionsOK, error) + + UserOptions(params *UserOptionsParams) (*UserOptionsOK, error) + + UsersOptions(params *UsersOptionsParams) (*UsersOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + ClusterOptions CORS support +*/ +func (a *Client) ClusterOptions(params *ClusterOptionsParams) (*ClusterOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewClusterOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*ClustersOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewClustersOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*DatabaseOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDatabaseOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*DatabasesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDatabasesOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*IngestOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*IngestsOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestsOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*JobOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*JobsOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobsOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*ServiceOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewServiceOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*ServicesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewServicesOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*TemplateOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTemplateOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*TemplatesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTemplatesOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*TenantOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenantOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*TenantsOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenantsOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*UserOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUserOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*UsersOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUsersOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..ba98a50 --- /dev/null +++ b/api/devops/devops_client/cors/database_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewDatabaseOptionsParams() *DatabaseOptionsParams { + + return &DatabaseOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDatabaseOptionsParamsWithTimeout creates a new DatabaseOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..4e3b58b --- /dev/null +++ b/api/devops/devops_client/cors/database_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewDatabaseOptionsOK creates a DatabaseOptionsOK with default headers values +func NewDatabaseOptionsOK() *DatabaseOptionsOK { + return &DatabaseOptionsOK{} +} + +/*DatabaseOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..359d41f --- /dev/null +++ b/api/devops/devops_client/cors/databases_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewDatabasesOptionsParams() *DatabasesOptionsParams { + + return &DatabasesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDatabasesOptionsParamsWithTimeout creates a new DatabasesOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..4744406 --- /dev/null +++ b/api/devops/devops_client/cors/databases_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewDatabasesOptionsOK creates a DatabasesOptionsOK with default headers values +func NewDatabasesOptionsOK() *DatabasesOptionsOK { + return &DatabasesOptionsOK{} +} + +/*DatabasesOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..9052205 --- /dev/null +++ b/api/devops/devops_client/cors/ingest_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewIngestOptionsParams() *IngestOptionsParams { + + return &IngestOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIngestOptionsParamsWithTimeout creates a new IngestOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..48a8490 --- /dev/null +++ b/api/devops/devops_client/cors/ingest_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewIngestOptionsOK creates a IngestOptionsOK with default headers values +func NewIngestOptionsOK() *IngestOptionsOK { + return &IngestOptionsOK{} +} + +/*IngestOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..382f380 --- /dev/null +++ b/api/devops/devops_client/cors/ingests_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewIngestsOptionsParams() *IngestsOptionsParams { + + return &IngestsOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIngestsOptionsParamsWithTimeout creates a new IngestsOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..be74085 --- /dev/null +++ b/api/devops/devops_client/cors/ingests_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewIngestsOptionsOK creates a IngestsOptionsOK with default headers values +func NewIngestsOptionsOK() *IngestsOptionsOK { + return &IngestsOptionsOK{} +} + +/*IngestsOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..1d8a10a --- /dev/null +++ b/api/devops/devops_client/cors/job_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewJobOptionsParams() *JobOptionsParams { + + return &JobOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewJobOptionsParamsWithTimeout creates a new JobOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..1ef2022 --- /dev/null +++ b/api/devops/devops_client/cors/job_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewJobOptionsOK creates a JobOptionsOK with default headers values +func NewJobOptionsOK() *JobOptionsOK { + return &JobOptionsOK{} +} + +/*JobOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..1cc883d --- /dev/null +++ b/api/devops/devops_client/cors/jobs_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewJobsOptionsParams() *JobsOptionsParams { + + return &JobsOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewJobsOptionsParamsWithTimeout creates a new JobsOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..d546fbd --- /dev/null +++ b/api/devops/devops_client/cors/jobs_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewJobsOptionsOK creates a JobsOptionsOK with default headers values +func NewJobsOptionsOK() *JobsOptionsOK { + return &JobsOptionsOK{} +} + +/*JobsOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..fce4c24 --- /dev/null +++ b/api/devops/devops_client/cors/service_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewServiceOptionsParams() *ServiceOptionsParams { + + return &ServiceOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewServiceOptionsParamsWithTimeout creates a new ServiceOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..92b0086 --- /dev/null +++ b/api/devops/devops_client/cors/service_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewServiceOptionsOK creates a ServiceOptionsOK with default headers values +func NewServiceOptionsOK() *ServiceOptionsOK { + return &ServiceOptionsOK{} +} + +/*ServiceOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..14a3167 --- /dev/null +++ b/api/devops/devops_client/cors/services_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewServicesOptionsParams() *ServicesOptionsParams { + + return &ServicesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewServicesOptionsParamsWithTimeout creates a new ServicesOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..69f9f80 --- /dev/null +++ b/api/devops/devops_client/cors/services_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewServicesOptionsOK creates a ServicesOptionsOK with default headers values +func NewServicesOptionsOK() *ServicesOptionsOK { + return &ServicesOptionsOK{} +} + +/*ServicesOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..f1b5627 --- /dev/null +++ b/api/devops/devops_client/cors/template_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewTemplateOptionsParams() *TemplateOptionsParams { + + return &TemplateOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTemplateOptionsParamsWithTimeout creates a new TemplateOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..61cec04 --- /dev/null +++ b/api/devops/devops_client/cors/template_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewTemplateOptionsOK creates a TemplateOptionsOK with default headers values +func NewTemplateOptionsOK() *TemplateOptionsOK { + return &TemplateOptionsOK{} +} + +/*TemplateOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..50d8457 --- /dev/null +++ b/api/devops/devops_client/cors/templates_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewTemplatesOptionsParams() *TemplatesOptionsParams { + + return &TemplatesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTemplatesOptionsParamsWithTimeout creates a new TemplatesOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..01f303f --- /dev/null +++ b/api/devops/devops_client/cors/templates_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewTemplatesOptionsOK creates a TemplatesOptionsOK with default headers values +func NewTemplatesOptionsOK() *TemplatesOptionsOK { + return &TemplatesOptionsOK{} +} + +/*TemplatesOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..a909dc4 --- /dev/null +++ b/api/devops/devops_client/cors/tenant_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewTenantOptionsParams() *TenantOptionsParams { + + return &TenantOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenantOptionsParamsWithTimeout creates a new TenantOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..7dabc9c --- /dev/null +++ b/api/devops/devops_client/cors/tenant_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewTenantOptionsOK creates a TenantOptionsOK with default headers values +func NewTenantOptionsOK() *TenantOptionsOK { + return &TenantOptionsOK{} +} + +/*TenantOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..9771c3b --- /dev/null +++ b/api/devops/devops_client/cors/tenants_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewTenantsOptionsParams() *TenantsOptionsParams { + + return &TenantsOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenantsOptionsParamsWithTimeout creates a new TenantsOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..8d8dc73 --- /dev/null +++ b/api/devops/devops_client/cors/tenants_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewTenantsOptionsOK creates a TenantsOptionsOK with default headers values +func NewTenantsOptionsOK() *TenantsOptionsOK { + return &TenantsOptionsOK{} +} + +/*TenantsOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..e17f8c3 --- /dev/null +++ b/api/devops/devops_client/cors/user_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewUserOptionsParams() *UserOptionsParams { + + return &UserOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUserOptionsParamsWithTimeout creates a new UserOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..fa79da3 --- /dev/null +++ b/api/devops/devops_client/cors/user_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewUserOptionsOK creates a UserOptionsOK with default headers values +func NewUserOptionsOK() *UserOptionsOK { + return &UserOptionsOK{} +} + +/*UserOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..f444b01 --- /dev/null +++ b/api/devops/devops_client/cors/users_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewUsersOptionsParams() *UsersOptionsParams { + + return &UsersOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewUsersOptionsParamsWithTimeout creates a new UsersOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..a3fb3c6 --- /dev/null +++ b/api/devops/devops_client/cors/users_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewUsersOptionsOK creates a UsersOptionsOK with default headers values +func NewUsersOptionsOK() *UsersOptionsOK { + return &UsersOptionsOK{} +} + +/*UsersOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..a75a0f8 --- /dev/null +++ b/api/devops/devops_client/database/database_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetDatabase(params *GetDatabaseParams, authInfo runtime.ClientAuthInfoWriter) (*GetDatabaseOK, error) + + GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*GetDatabasesOK, error) + + GetDatabasesObservable(params *GetDatabasesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetDatabasesObservableOK, error) + + PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*PostDatabasesOK, error) + + PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetDatabaseOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDatabaseParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDatabasesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetDatabasesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDatabasesObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*PostDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostDatabasesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*PutDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutDatabasesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..3cc5071 --- /dev/null +++ b/api/devops/devops_client/database/get_database_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetDatabaseParams() *GetDatabaseParams { + var () + return &GetDatabaseParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDatabaseParamsWithTimeout creates a new GetDatabaseParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDatabaseParamsWithTimeout(timeout time.Duration) *GetDatabaseParams { + var () + return &GetDatabaseParams{ + + timeout: timeout, + } +} + +// NewGetDatabaseParamsWithContext creates a new GetDatabaseParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDatabaseParamsWithContext(ctx context.Context) *GetDatabaseParams { + var () + return &GetDatabaseParams{ + + Context: ctx, + } +} + +// NewGetDatabaseParamsWithHTTPClient creates a new GetDatabaseParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDatabaseParamsWithHTTPClient(client *http.Client) *GetDatabaseParams { + var () + 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 + Taxnexus Record Id of a Database + + */ + DatabaseIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..29e1688 --- /dev/null +++ b/api/devops/devops_client/database/get_database_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetDatabaseOK creates a GetDatabaseOK with default headers values +func NewGetDatabaseOK() *GetDatabaseOK { + return &GetDatabaseOK{} +} + +/*GetDatabaseOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..f8fd2e7 --- /dev/null +++ b/api/devops/devops_client/database/get_databases_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetDatabasesObservableParams() *GetDatabasesObservableParams { + + return &GetDatabasesObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDatabasesObservableParamsWithTimeout creates a new GetDatabasesObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..d511dfa --- /dev/null +++ b/api/devops/devops_client/database/get_databases_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetDatabasesObservableOK creates a GetDatabasesObservableOK with default headers values +func NewGetDatabasesObservableOK() *GetDatabasesObservableOK { + return &GetDatabasesObservableOK{} +} + +/*GetDatabasesObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..91884c7 --- /dev/null +++ b/api/devops/devops_client/database/get_databases_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetDatabasesParams() *GetDatabasesParams { + var () + return &GetDatabasesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDatabasesParamsWithTimeout creates a new GetDatabasesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDatabasesParamsWithTimeout(timeout time.Duration) *GetDatabasesParams { + var () + return &GetDatabasesParams{ + + timeout: timeout, + } +} + +// NewGetDatabasesParamsWithContext creates a new GetDatabasesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDatabasesParamsWithContext(ctx context.Context) *GetDatabasesParams { + var () + return &GetDatabasesParams{ + + Context: ctx, + } +} + +// NewGetDatabasesParamsWithHTTPClient creates a new GetDatabasesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDatabasesParamsWithHTTPClient(client *http.Client) *GetDatabasesParams { + var () + 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 + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*DatabaseID + Taxnexus Record Id of a Database + + */ + DatabaseID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..66b84ae --- /dev/null +++ b/api/devops/devops_client/database/get_databases_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetDatabasesOK creates a GetDatabasesOK with default headers values +func NewGetDatabasesOK() *GetDatabasesOK { + return &GetDatabasesOK{} +} + +/*GetDatabasesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..e42b7db --- /dev/null +++ b/api/devops/devops_client/database/post_databases_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostDatabasesParams creates a new PostDatabasesParams object +// with the default values initialized. +func NewPostDatabasesParams() *PostDatabasesParams { + var () + return &PostDatabasesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostDatabasesParamsWithTimeout creates a new PostDatabasesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostDatabasesParamsWithTimeout(timeout time.Duration) *PostDatabasesParams { + var () + return &PostDatabasesParams{ + + timeout: timeout, + } +} + +// NewPostDatabasesParamsWithContext creates a new PostDatabasesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostDatabasesParamsWithContext(ctx context.Context) *PostDatabasesParams { + var () + return &PostDatabasesParams{ + + Context: ctx, + } +} + +// NewPostDatabasesParamsWithHTTPClient creates a new PostDatabasesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostDatabasesParamsWithHTTPClient(client *http.Client) *PostDatabasesParams { + var () + 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 +} + +// 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..6a87ad0 --- /dev/null +++ b/api/devops/devops_client/database/post_databases_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostDatabasesOK creates a PostDatabasesOK with default headers values +func NewPostDatabasesOK() *PostDatabasesOK { + return &PostDatabasesOK{} +} + +/*PostDatabasesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..7264a17 --- /dev/null +++ b/api/devops/devops_client/database/put_databases_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPutDatabasesParams creates a new PutDatabasesParams object +// with the default values initialized. +func NewPutDatabasesParams() *PutDatabasesParams { + var () + return &PutDatabasesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutDatabasesParamsWithTimeout creates a new PutDatabasesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutDatabasesParamsWithTimeout(timeout time.Duration) *PutDatabasesParams { + var () + return &PutDatabasesParams{ + + timeout: timeout, + } +} + +// NewPutDatabasesParamsWithContext creates a new PutDatabasesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutDatabasesParamsWithContext(ctx context.Context) *PutDatabasesParams { + var () + return &PutDatabasesParams{ + + Context: ctx, + } +} + +// NewPutDatabasesParamsWithHTTPClient creates a new PutDatabasesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutDatabasesParamsWithHTTPClient(client *http.Client) *PutDatabasesParams { + var () + 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 +} + +// 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..4b73407 --- /dev/null +++ b/api/devops/devops_client/database/put_databases_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutDatabasesOK creates a PutDatabasesOK with default headers values +func NewPutDatabasesOK() *PutDatabasesOK { + return &PutDatabasesOK{} +} + +/*PutDatabasesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..ac7f3b6 --- /dev/null +++ b/api/devops/devops_client/devops_client.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/devops/devops_client/cluster" + "github.com/taxnexus/go/lib/api/devops/devops_client/cors" + "github.com/taxnexus/go/lib/api/devops/devops_client/database" + "github.com/taxnexus/go/lib/api/devops/devops_client/ingest" + "github.com/taxnexus/go/lib/api/devops/devops_client/job" + "github.com/taxnexus/go/lib/api/devops/devops_client/service" + "github.com/taxnexus/go/lib/api/devops/devops_client/template" + "github.com/taxnexus/go/lib/api/devops/devops_client/tenant" + "github.com/taxnexus/go/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.fabric.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..b02c019 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingest_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetIngestParams() *GetIngestParams { + var () + return &GetIngestParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetIngestParamsWithTimeout creates a new GetIngestParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetIngestParamsWithTimeout(timeout time.Duration) *GetIngestParams { + var () + return &GetIngestParams{ + + timeout: timeout, + } +} + +// NewGetIngestParamsWithContext creates a new GetIngestParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetIngestParamsWithContext(ctx context.Context) *GetIngestParams { + var () + return &GetIngestParams{ + + Context: ctx, + } +} + +// NewGetIngestParamsWithHTTPClient creates a new GetIngestParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetIngestParamsWithHTTPClient(client *http.Client) *GetIngestParams { + var () + 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 + Taxnexus Record Id of a Ingest + + */ + IngestIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..52c0485 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingest_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetIngestOK creates a GetIngestOK with default headers values +func NewGetIngestOK() *GetIngestOK { + return &GetIngestOK{} +} + +/*GetIngestOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..3657077 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetIngestsObservableParams() *GetIngestsObservableParams { + + return &GetIngestsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetIngestsObservableParamsWithTimeout creates a new GetIngestsObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..6cd9491 --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetIngestsObservableOK creates a GetIngestsObservableOK with default headers values +func NewGetIngestsObservableOK() *GetIngestsObservableOK { + return &GetIngestsObservableOK{} +} + +/*GetIngestsObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..843ea8e --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetIngestsParams() *GetIngestsParams { + var () + return &GetIngestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetIngestsParamsWithTimeout creates a new GetIngestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetIngestsParamsWithTimeout(timeout time.Duration) *GetIngestsParams { + var () + return &GetIngestsParams{ + + timeout: timeout, + } +} + +// NewGetIngestsParamsWithContext creates a new GetIngestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetIngestsParamsWithContext(ctx context.Context) *GetIngestsParams { + var () + return &GetIngestsParams{ + + Context: ctx, + } +} + +// NewGetIngestsParamsWithHTTPClient creates a new GetIngestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetIngestsParamsWithHTTPClient(client *http.Client) *GetIngestsParams { + var () + 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 + Taxnexus Record Id of an Account + + */ + AccountID *string + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*IngestID + Taxnexus Record Id of an Ingest + + */ + IngestID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..d35b8ed --- /dev/null +++ b/api/devops/devops_client/ingest/get_ingests_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetIngestsOK creates a GetIngestsOK with default headers values +func NewGetIngestsOK() *GetIngestsOK { + return &GetIngestsOK{} +} + +/*GetIngestsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..465178b --- /dev/null +++ b/api/devops/devops_client/ingest/ingest_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetIngest(params *GetIngestParams, authInfo runtime.ClientAuthInfoWriter) (*GetIngestOK, error) + + GetIngests(params *GetIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetIngestsOK, error) + + GetIngestsObservable(params *GetIngestsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetIngestsObservableOK, error) + + PostIngests(params *PostIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*PostIngestsOK, error) + + PutIngests(params *PutIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetIngestOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIngestParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIngestsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetIngestsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIngestsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PostIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostIngestsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutIngestsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..2f5cd1e --- /dev/null +++ b/api/devops/devops_client/ingest/post_ingests_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostIngestsParams creates a new PostIngestsParams object +// with the default values initialized. +func NewPostIngestsParams() *PostIngestsParams { + var () + return &PostIngestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostIngestsParamsWithTimeout creates a new PostIngestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostIngestsParamsWithTimeout(timeout time.Duration) *PostIngestsParams { + var () + return &PostIngestsParams{ + + timeout: timeout, + } +} + +// NewPostIngestsParamsWithContext creates a new PostIngestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostIngestsParamsWithContext(ctx context.Context) *PostIngestsParams { + var () + return &PostIngestsParams{ + + Context: ctx, + } +} + +// NewPostIngestsParamsWithHTTPClient creates a new PostIngestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostIngestsParamsWithHTTPClient(client *http.Client) *PostIngestsParams { + var () + 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 +} + +// 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..ebf2a60 --- /dev/null +++ b/api/devops/devops_client/ingest/post_ingests_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostIngestsOK creates a PostIngestsOK with default headers values +func NewPostIngestsOK() *PostIngestsOK { + return &PostIngestsOK{} +} + +/*PostIngestsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..bf58e72 --- /dev/null +++ b/api/devops/devops_client/ingest/put_ingests_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPutIngestsParams creates a new PutIngestsParams object +// with the default values initialized. +func NewPutIngestsParams() *PutIngestsParams { + var () + return &PutIngestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutIngestsParamsWithTimeout creates a new PutIngestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutIngestsParamsWithTimeout(timeout time.Duration) *PutIngestsParams { + var () + return &PutIngestsParams{ + + timeout: timeout, + } +} + +// NewPutIngestsParamsWithContext creates a new PutIngestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutIngestsParamsWithContext(ctx context.Context) *PutIngestsParams { + var () + return &PutIngestsParams{ + + Context: ctx, + } +} + +// NewPutIngestsParamsWithHTTPClient creates a new PutIngestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutIngestsParamsWithHTTPClient(client *http.Client) *PutIngestsParams { + var () + 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 +} + +// 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..3978bd3 --- /dev/null +++ b/api/devops/devops_client/ingest/put_ingests_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutIngestsOK creates a PutIngestsOK with default headers values +func NewPutIngestsOK() *PutIngestsOK { + return &PutIngestsOK{} +} + +/*PutIngestsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..f6e8136 --- /dev/null +++ b/api/devops/devops_client/job/get_job_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetJobParams() *GetJobParams { + var () + return &GetJobParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobParamsWithTimeout creates a new GetJobParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetJobParamsWithTimeout(timeout time.Duration) *GetJobParams { + var () + return &GetJobParams{ + + timeout: timeout, + } +} + +// NewGetJobParamsWithContext creates a new GetJobParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetJobParamsWithContext(ctx context.Context) *GetJobParams { + var () + return &GetJobParams{ + + Context: ctx, + } +} + +// NewGetJobParamsWithHTTPClient creates a new GetJobParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetJobParamsWithHTTPClient(client *http.Client) *GetJobParams { + var () + 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 + Taxnexus Record Id of a Job + + */ + JobIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..c537901 --- /dev/null +++ b/api/devops/devops_client/job/get_job_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetJobOK creates a GetJobOK with default headers values +func NewGetJobOK() *GetJobOK { + return &GetJobOK{} +} + +/*GetJobOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..92d5929 --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetJobsObservableParams() *GetJobsObservableParams { + + return &GetJobsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobsObservableParamsWithTimeout creates a new GetJobsObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..3f50cec --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetJobsObservableOK creates a GetJobsObservableOK with default headers values +func NewGetJobsObservableOK() *GetJobsObservableOK { + return &GetJobsObservableOK{} +} + +/*GetJobsObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..d787e9d --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetJobsParams() *GetJobsParams { + var () + return &GetJobsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobsParamsWithTimeout creates a new GetJobsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetJobsParamsWithTimeout(timeout time.Duration) *GetJobsParams { + var () + return &GetJobsParams{ + + timeout: timeout, + } +} + +// NewGetJobsParamsWithContext creates a new GetJobsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetJobsParamsWithContext(ctx context.Context) *GetJobsParams { + var () + return &GetJobsParams{ + + Context: ctx, + } +} + +// NewGetJobsParamsWithHTTPClient creates a new GetJobsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetJobsParamsWithHTTPClient(client *http.Client) *GetJobsParams { + var () + 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 + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Active + Retrieve active records only? + + */ + Active *bool + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*JobID + Taxnexus Record Id of a Job + + */ + JobID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..2c7a03a --- /dev/null +++ b/api/devops/devops_client/job/get_jobs_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetJobsOK creates a GetJobsOK with default headers values +func NewGetJobsOK() *GetJobsOK { + return &GetJobsOK{} +} + +/*GetJobsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..03cfff1 --- /dev/null +++ b/api/devops/devops_client/job/job_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter) (*GetJobOK, error) + + GetJobs(params *GetJobsParams, authInfo runtime.ClientAuthInfoWriter) (*GetJobsOK, error) + + GetJobsObservable(params *GetJobsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetJobsObservableOK, error) + + PostJobs(params *PostJobsParams, authInfo runtime.ClientAuthInfoWriter) (*PostJobsOK, error) + + PutJobs(params *PutJobsParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetJobOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetJobsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PostJobs(params *PostJobsParams, authInfo runtime.ClientAuthInfoWriter) (*PostJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostJobsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutJobs(params *PutJobsParams, authInfo runtime.ClientAuthInfoWriter) (*PutJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutJobsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..b6b8df3 --- /dev/null +++ b/api/devops/devops_client/job/post_jobs_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostJobsParams creates a new PostJobsParams object +// with the default values initialized. +func NewPostJobsParams() *PostJobsParams { + var () + return &PostJobsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostJobsParamsWithTimeout creates a new PostJobsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostJobsParamsWithTimeout(timeout time.Duration) *PostJobsParams { + var () + return &PostJobsParams{ + + timeout: timeout, + } +} + +// NewPostJobsParamsWithContext creates a new PostJobsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostJobsParamsWithContext(ctx context.Context) *PostJobsParams { + var () + return &PostJobsParams{ + + Context: ctx, + } +} + +// NewPostJobsParamsWithHTTPClient creates a new PostJobsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostJobsParamsWithHTTPClient(client *http.Client) *PostJobsParams { + var () + 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 +} + +// 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..9346b95 --- /dev/null +++ b/api/devops/devops_client/job/post_jobs_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostJobsOK creates a PostJobsOK with default headers values +func NewPostJobsOK() *PostJobsOK { + return &PostJobsOK{} +} + +/*PostJobsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..0755a96 --- /dev/null +++ b/api/devops/devops_client/job/put_jobs_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPutJobsParams creates a new PutJobsParams object +// with the default values initialized. +func NewPutJobsParams() *PutJobsParams { + var () + return &PutJobsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutJobsParamsWithTimeout creates a new PutJobsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutJobsParamsWithTimeout(timeout time.Duration) *PutJobsParams { + var () + return &PutJobsParams{ + + timeout: timeout, + } +} + +// NewPutJobsParamsWithContext creates a new PutJobsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutJobsParamsWithContext(ctx context.Context) *PutJobsParams { + var () + return &PutJobsParams{ + + Context: ctx, + } +} + +// NewPutJobsParamsWithHTTPClient creates a new PutJobsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutJobsParamsWithHTTPClient(client *http.Client) *PutJobsParams { + var () + 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 +} + +// 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..6300108 --- /dev/null +++ b/api/devops/devops_client/job/put_jobs_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutJobsOK creates a PutJobsOK with default headers values +func NewPutJobsOK() *PutJobsOK { + return &PutJobsOK{} +} + +/*PutJobsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..793972e --- /dev/null +++ b/api/devops/devops_client/service/get_service_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetServiceParams() *GetServiceParams { + var () + return &GetServiceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetServiceParamsWithTimeout creates a new GetServiceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetServiceParamsWithTimeout(timeout time.Duration) *GetServiceParams { + var () + return &GetServiceParams{ + + timeout: timeout, + } +} + +// NewGetServiceParamsWithContext creates a new GetServiceParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetServiceParamsWithContext(ctx context.Context) *GetServiceParams { + var () + return &GetServiceParams{ + + Context: ctx, + } +} + +// NewGetServiceParamsWithHTTPClient creates a new GetServiceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetServiceParamsWithHTTPClient(client *http.Client) *GetServiceParams { + var () + 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 + Taxnexus Record Id of a Service + + */ + ServiceIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..024291d --- /dev/null +++ b/api/devops/devops_client/service/get_service_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetServiceOK creates a GetServiceOK with default headers values +func NewGetServiceOK() *GetServiceOK { + return &GetServiceOK{} +} + +/*GetServiceOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..4d3663a --- /dev/null +++ b/api/devops/devops_client/service/get_services_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetServicesObservableParams() *GetServicesObservableParams { + + return &GetServicesObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetServicesObservableParamsWithTimeout creates a new GetServicesObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..9419ba3 --- /dev/null +++ b/api/devops/devops_client/service/get_services_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetServicesObservableOK creates a GetServicesObservableOK with default headers values +func NewGetServicesObservableOK() *GetServicesObservableOK { + return &GetServicesObservableOK{} +} + +/*GetServicesObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..819a157 --- /dev/null +++ b/api/devops/devops_client/service/get_services_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetServicesParams() *GetServicesParams { + var () + return &GetServicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetServicesParamsWithTimeout creates a new GetServicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetServicesParamsWithTimeout(timeout time.Duration) *GetServicesParams { + var () + return &GetServicesParams{ + + timeout: timeout, + } +} + +// NewGetServicesParamsWithContext creates a new GetServicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetServicesParamsWithContext(ctx context.Context) *GetServicesParams { + var () + return &GetServicesParams{ + + Context: ctx, + } +} + +// NewGetServicesParamsWithHTTPClient creates a new GetServicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetServicesParamsWithHTTPClient(client *http.Client) *GetServicesParams { + var () + 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 + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*ServiceID + Service ID + + */ + ServiceID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..fac77ae --- /dev/null +++ b/api/devops/devops_client/service/get_services_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetServicesOK creates a GetServicesOK with default headers values +func NewGetServicesOK() *GetServicesOK { + return &GetServicesOK{} +} + +/*GetServicesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..466883e --- /dev/null +++ b/api/devops/devops_client/service/post_services_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostServicesParams creates a new PostServicesParams object +// with the default values initialized. +func NewPostServicesParams() *PostServicesParams { + var () + return &PostServicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostServicesParamsWithTimeout creates a new PostServicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostServicesParamsWithTimeout(timeout time.Duration) *PostServicesParams { + var () + return &PostServicesParams{ + + timeout: timeout, + } +} + +// NewPostServicesParamsWithContext creates a new PostServicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostServicesParamsWithContext(ctx context.Context) *PostServicesParams { + var () + return &PostServicesParams{ + + Context: ctx, + } +} + +// NewPostServicesParamsWithHTTPClient creates a new PostServicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostServicesParamsWithHTTPClient(client *http.Client) *PostServicesParams { + var () + 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 +} + +// 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..690c4ab --- /dev/null +++ b/api/devops/devops_client/service/post_services_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostServicesOK creates a PostServicesOK with default headers values +func NewPostServicesOK() *PostServicesOK { + return &PostServicesOK{} +} + +/*PostServicesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..0619a75 --- /dev/null +++ b/api/devops/devops_client/service/put_services_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPutServicesParams creates a new PutServicesParams object +// with the default values initialized. +func NewPutServicesParams() *PutServicesParams { + var () + return &PutServicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutServicesParamsWithTimeout creates a new PutServicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutServicesParamsWithTimeout(timeout time.Duration) *PutServicesParams { + var () + return &PutServicesParams{ + + timeout: timeout, + } +} + +// NewPutServicesParamsWithContext creates a new PutServicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutServicesParamsWithContext(ctx context.Context) *PutServicesParams { + var () + return &PutServicesParams{ + + Context: ctx, + } +} + +// NewPutServicesParamsWithHTTPClient creates a new PutServicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutServicesParamsWithHTTPClient(client *http.Client) *PutServicesParams { + var () + 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 +} + +// 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..42edf3a --- /dev/null +++ b/api/devops/devops_client/service/put_services_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutServicesOK creates a PutServicesOK with default headers values +func NewPutServicesOK() *PutServicesOK { + return &PutServicesOK{} +} + +/*PutServicesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..b8a4815 --- /dev/null +++ b/api/devops/devops_client/service/service_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetService(params *GetServiceParams, authInfo runtime.ClientAuthInfoWriter) (*GetServiceOK, error) + + GetServices(params *GetServicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetServicesOK, error) + + GetServicesObservable(params *GetServicesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetServicesObservableOK, error) + + PostServices(params *PostServicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostServicesOK, error) + + PutServices(params *PutServicesParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServiceParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServicesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetServicesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServicesObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PostServices(params *PostServicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostServicesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutServices(params *PutServicesParams, authInfo runtime.ClientAuthInfoWriter) (*PutServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutServicesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..99c729c --- /dev/null +++ b/api/devops/devops_client/template/get_template_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetTemplateParams() *GetTemplateParams { + var () + return &GetTemplateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTemplateParamsWithTimeout creates a new GetTemplateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTemplateParamsWithTimeout(timeout time.Duration) *GetTemplateParams { + var () + return &GetTemplateParams{ + + timeout: timeout, + } +} + +// NewGetTemplateParamsWithContext creates a new GetTemplateParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTemplateParamsWithContext(ctx context.Context) *GetTemplateParams { + var () + return &GetTemplateParams{ + + Context: ctx, + } +} + +// NewGetTemplateParamsWithHTTPClient creates a new GetTemplateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTemplateParamsWithHTTPClient(client *http.Client) *GetTemplateParams { + var () + 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 + Taxnexus Record Id of a Template + + */ + TemplateIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..f6f4bde --- /dev/null +++ b/api/devops/devops_client/template/get_template_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetTemplateOK creates a GetTemplateOK with default headers values +func NewGetTemplateOK() *GetTemplateOK { + return &GetTemplateOK{} +} + +/*GetTemplateOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..590d3a8 --- /dev/null +++ b/api/devops/devops_client/template/get_templates_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetTemplatesObservableParams() *GetTemplatesObservableParams { + + return &GetTemplatesObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTemplatesObservableParamsWithTimeout creates a new GetTemplatesObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..420db46 --- /dev/null +++ b/api/devops/devops_client/template/get_templates_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetTemplatesObservableOK creates a GetTemplatesObservableOK with default headers values +func NewGetTemplatesObservableOK() *GetTemplatesObservableOK { + return &GetTemplatesObservableOK{} +} + +/*GetTemplatesObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..b56d0d7 --- /dev/null +++ b/api/devops/devops_client/template/get_templates_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetTemplatesParams() *GetTemplatesParams { + var () + return &GetTemplatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTemplatesParamsWithTimeout creates a new GetTemplatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTemplatesParamsWithTimeout(timeout time.Duration) *GetTemplatesParams { + var () + return &GetTemplatesParams{ + + timeout: timeout, + } +} + +// NewGetTemplatesParamsWithContext creates a new GetTemplatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTemplatesParamsWithContext(ctx context.Context) *GetTemplatesParams { + var () + return &GetTemplatesParams{ + + Context: ctx, + } +} + +// NewGetTemplatesParamsWithHTTPClient creates a new GetTemplatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTemplatesParamsWithHTTPClient(client *http.Client) *GetTemplatesParams { + var () + 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 + + */ + Limit *int64 + /*ObjectType + Object Type Name + + */ + ObjectType *string + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TemplateID + Template ID + + */ + TemplateID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..e85ce7b --- /dev/null +++ b/api/devops/devops_client/template/get_templates_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetTemplatesOK creates a GetTemplatesOK with default headers values +func NewGetTemplatesOK() *GetTemplatesOK { + return &GetTemplatesOK{} +} + +/*GetTemplatesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..daf924e --- /dev/null +++ b/api/devops/devops_client/template/post_templates_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostTemplatesParams creates a new PostTemplatesParams object +// with the default values initialized. +func NewPostTemplatesParams() *PostTemplatesParams { + var () + return &PostTemplatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTemplatesParamsWithTimeout creates a new PostTemplatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTemplatesParamsWithTimeout(timeout time.Duration) *PostTemplatesParams { + var () + return &PostTemplatesParams{ + + timeout: timeout, + } +} + +// NewPostTemplatesParamsWithContext creates a new PostTemplatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTemplatesParamsWithContext(ctx context.Context) *PostTemplatesParams { + var () + return &PostTemplatesParams{ + + Context: ctx, + } +} + +// NewPostTemplatesParamsWithHTTPClient creates a new PostTemplatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTemplatesParamsWithHTTPClient(client *http.Client) *PostTemplatesParams { + var () + 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 +} + +// 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..8220079 --- /dev/null +++ b/api/devops/devops_client/template/post_templates_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostTemplatesOK creates a PostTemplatesOK with default headers values +func NewPostTemplatesOK() *PostTemplatesOK { + return &PostTemplatesOK{} +} + +/*PostTemplatesOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..77737f3 --- /dev/null +++ b/api/devops/devops_client/template/template_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTemplate(params *GetTemplateParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplateOK, error) + + GetTemplates(params *GetTemplatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplatesOK, error) + + GetTemplatesObservable(params *GetTemplatesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplatesObservableOK, error) + + PostTemplates(params *PostTemplatesParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetTemplateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTemplateParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetTemplatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTemplatesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetTemplatesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTemplatesObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PostTemplatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTemplatesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..c16b740 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenant_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetTenantParams() *GetTenantParams { + var () + return &GetTenantParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantParamsWithTimeout creates a new GetTenantParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTenantParamsWithTimeout(timeout time.Duration) *GetTenantParams { + var () + return &GetTenantParams{ + + timeout: timeout, + } +} + +// NewGetTenantParamsWithContext creates a new GetTenantParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTenantParamsWithContext(ctx context.Context) *GetTenantParams { + var () + return &GetTenantParams{ + + Context: ctx, + } +} + +// NewGetTenantParamsWithHTTPClient creates a new GetTenantParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTenantParamsWithHTTPClient(client *http.Client) *GetTenantParams { + var () + 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 + Taxnexus Record Id of a Tenant + + */ + TenantIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..68023e8 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenant_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetTenantOK creates a GetTenantOK with default headers values +func NewGetTenantOK() *GetTenantOK { + return &GetTenantOK{} +} + +/*GetTenantOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..114fd8c --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetTenantsObservableParams() *GetTenantsObservableParams { + + return &GetTenantsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantsObservableParamsWithTimeout creates a new GetTenantsObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..d268947 --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetTenantsObservableOK creates a GetTenantsObservableOK with default headers values +func NewGetTenantsObservableOK() *GetTenantsObservableOK { + return &GetTenantsObservableOK{} +} + +/*GetTenantsObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..610229f --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetTenantsParams() *GetTenantsParams { + var () + return &GetTenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantsParamsWithTimeout creates a new GetTenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTenantsParamsWithTimeout(timeout time.Duration) *GetTenantsParams { + var () + return &GetTenantsParams{ + + timeout: timeout, + } +} + +// NewGetTenantsParamsWithContext creates a new GetTenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTenantsParamsWithContext(ctx context.Context) *GetTenantsParams { + var () + return &GetTenantsParams{ + + Context: ctx, + } +} + +// NewGetTenantsParamsWithHTTPClient creates a new GetTenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTenantsParamsWithHTTPClient(client *http.Client) *GetTenantsParams { + var () + 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 { + + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TaxnexusAccount + Taxnexus Account of a Tenant + + */ + TaxnexusAccount *string + /*TenantID + Taxnexus Record Id of a Tenant + + */ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// 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 +} + +// WithTaxnexusAccount adds the taxnexusAccount to the get tenants params +func (o *GetTenantsParams) WithTaxnexusAccount(taxnexusAccount *string) *GetTenantsParams { + o.SetTaxnexusAccount(taxnexusAccount) + return o +} + +// SetTaxnexusAccount adds the taxnexusAccount to the get tenants params +func (o *GetTenantsParams) SetTaxnexusAccount(taxnexusAccount *string) { + o.TaxnexusAccount = taxnexusAccount +} + +// 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.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.TaxnexusAccount != nil { + + // query param taxnexusAccount + var qrTaxnexusAccount string + if o.TaxnexusAccount != nil { + qrTaxnexusAccount = *o.TaxnexusAccount + } + qTaxnexusAccount := qrTaxnexusAccount + if qTaxnexusAccount != "" { + if err := r.SetQueryParam("taxnexusAccount", qTaxnexusAccount); 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..29c6c7f --- /dev/null +++ b/api/devops/devops_client/tenant/get_tenants_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetTenantsOK creates a GetTenantsOK with default headers values +func NewGetTenantsOK() *GetTenantsOK { + return &GetTenantsOK{} +} + +/*GetTenantsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..0d17555 --- /dev/null +++ b/api/devops/devops_client/tenant/post_tenants_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostTenantsParams creates a new PostTenantsParams object +// with the default values initialized. +func NewPostTenantsParams() *PostTenantsParams { + var () + return &PostTenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTenantsParamsWithTimeout creates a new PostTenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTenantsParamsWithTimeout(timeout time.Duration) *PostTenantsParams { + var () + return &PostTenantsParams{ + + timeout: timeout, + } +} + +// NewPostTenantsParamsWithContext creates a new PostTenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTenantsParamsWithContext(ctx context.Context) *PostTenantsParams { + var () + return &PostTenantsParams{ + + Context: ctx, + } +} + +// NewPostTenantsParamsWithHTTPClient creates a new PostTenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTenantsParamsWithHTTPClient(client *http.Client) *PostTenantsParams { + var () + 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 +} + +// 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..6c321d4 --- /dev/null +++ b/api/devops/devops_client/tenant/post_tenants_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostTenantsOK creates a PostTenantsOK with default headers values +func NewPostTenantsOK() *PostTenantsOK { + return &PostTenantsOK{} +} + +/*PostTenantsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..9db61fc --- /dev/null +++ b/api/devops/devops_client/tenant/put_tenants_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPutTenantsParams creates a new PutTenantsParams object +// with the default values initialized. +func NewPutTenantsParams() *PutTenantsParams { + var () + return &PutTenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutTenantsParamsWithTimeout creates a new PutTenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutTenantsParamsWithTimeout(timeout time.Duration) *PutTenantsParams { + var () + return &PutTenantsParams{ + + timeout: timeout, + } +} + +// NewPutTenantsParamsWithContext creates a new PutTenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutTenantsParamsWithContext(ctx context.Context) *PutTenantsParams { + var () + return &PutTenantsParams{ + + Context: ctx, + } +} + +// NewPutTenantsParamsWithHTTPClient creates a new PutTenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutTenantsParamsWithHTTPClient(client *http.Client) *PutTenantsParams { + var () + 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 +} + +// 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..fd47249 --- /dev/null +++ b/api/devops/devops_client/tenant/put_tenants_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutTenantsOK creates a PutTenantsOK with default headers values +func NewPutTenantsOK() *PutTenantsOK { + return &PutTenantsOK{} +} + +/*PutTenantsOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..5927004 --- /dev/null +++ b/api/devops/devops_client/tenant/tenant_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTenant(params *GetTenantParams, authInfo runtime.ClientAuthInfoWriter) (*GetTenantOK, error) + + GetTenants(params *GetTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTenantsOK, error) + + GetTenantsObservable(params *GetTenantsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTenantsObservableOK, error) + + PostTenants(params *PostTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTenantsOK, error) + + PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetTenantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetTenantsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantsObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PostTenants(params *PostTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTenantsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutTenantsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..7509e09 --- /dev/null +++ b/api/devops/devops_client/user/get_user_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetUserParams() *GetUserParams { + var () + return &GetUserParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUserParamsWithTimeout creates a new GetUserParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUserParamsWithTimeout(timeout time.Duration) *GetUserParams { + var () + return &GetUserParams{ + + timeout: timeout, + } +} + +// NewGetUserParamsWithContext creates a new GetUserParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUserParamsWithContext(ctx context.Context) *GetUserParams { + var () + return &GetUserParams{ + + Context: ctx, + } +} + +// NewGetUserParamsWithHTTPClient creates a new GetUserParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUserParamsWithHTTPClient(client *http.Client) *GetUserParams { + var () + 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 + Taxnexus Record Id of a User + + */ + UserIDPath string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..0fa8e3e --- /dev/null +++ b/api/devops/devops_client/user/get_user_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetUserOK creates a GetUserOK with default headers values +func NewGetUserOK() *GetUserOK { + return &GetUserOK{} +} + +/*GetUserOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..65f991f --- /dev/null +++ b/api/devops/devops_client/user/get_users_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetUsersObservableParams() *GetUsersObservableParams { + + return &GetUsersObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUsersObservableParamsWithTimeout creates a new GetUsersObservableParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..6dcca7b --- /dev/null +++ b/api/devops/devops_client/user/get_users_observable_responses.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetUsersObservableOK creates a GetUsersObservableOK with default headers values +func NewGetUsersObservableOK() *GetUsersObservableOK { + return &GetUsersObservableOK{} +} + +/*GetUsersObservableOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..4a31ba9 --- /dev/null +++ b/api/devops/devops_client/user/get_users_parameters.go @@ -0,0 +1,375 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetUsersParams() *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUsersParamsWithTimeout creates a new GetUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: timeout, + } +} + +// NewGetUsersParamsWithContext creates a new GetUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams { + var () + return &GetUsersParams{ + + Context: ctx, + } +} + +// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams { + var () + 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 + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Active + Retrieve active records only? + + */ + Active *bool + /*ContactID + Taxnexus Record Id of a Contact + + */ + ContactID *string + /*Email + Email Address (not unique) + + */ + Email *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*UserID + Taxnexus User ID (unique) + + */ + UserID *string + /*Username + Username (unique) + + */ + Username *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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..8d88d61 --- /dev/null +++ b/api/devops/devops_client/user/get_users_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetUsersOK creates a GetUsersOK with default headers values +func NewGetUsersOK() *GetUsersOK { + return &GetUsersOK{} +} + +/*GetUsersOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..0b28d52 --- /dev/null +++ b/api/devops/devops_client/user/post_users_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPostUsersParams creates a new PostUsersParams object +// with the default values initialized. +func NewPostUsersParams() *PostUsersParams { + var () + return &PostUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostUsersParamsWithTimeout creates a new PostUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostUsersParamsWithTimeout(timeout time.Duration) *PostUsersParams { + var () + return &PostUsersParams{ + + timeout: timeout, + } +} + +// NewPostUsersParamsWithContext creates a new PostUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostUsersParamsWithContext(ctx context.Context) *PostUsersParams { + var () + return &PostUsersParams{ + + Context: ctx, + } +} + +// NewPostUsersParamsWithHTTPClient creates a new PostUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostUsersParamsWithHTTPClient(client *http.Client) *PostUsersParams { + var () + 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 +} + +// 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..58da126 --- /dev/null +++ b/api/devops/devops_client/user/post_users_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostUsersOK creates a PostUsersOK with default headers values +func NewPostUsersOK() *PostUsersOK { + return &PostUsersOK{} +} + +/*PostUsersOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..588eebe --- /dev/null +++ b/api/devops/devops_client/user/put_users_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/devops/devops_models" +) + +// NewPutUsersParams creates a new PutUsersParams object +// with the default values initialized. +func NewPutUsersParams() *PutUsersParams { + var () + return &PutUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutUsersParamsWithTimeout creates a new PutUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutUsersParamsWithTimeout(timeout time.Duration) *PutUsersParams { + var () + return &PutUsersParams{ + + timeout: timeout, + } +} + +// NewPutUsersParamsWithContext creates a new PutUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutUsersParamsWithContext(ctx context.Context) *PutUsersParams { + var () + return &PutUsersParams{ + + Context: ctx, + } +} + +// NewPutUsersParamsWithHTTPClient creates a new PutUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutUsersParamsWithHTTPClient(client *http.Client) *PutUsersParams { + var () + 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 +} + +// 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..abcdebb --- /dev/null +++ b/api/devops/devops_client/user/put_users_responses.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPutUsersOK creates a PutUsersOK with default headers values +func NewPutUsersOK() *PutUsersOK { + return &PutUsersOK{} +} + +/*PutUsersOK handles this case with default header values. + +Taxnexus 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..e62e156 --- /dev/null +++ b/api/devops/devops_client/user/user_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter) (*GetUserOK, error) + + GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersOK, error) + + GetUsersObservable(params *GetUsersObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersObservableOK, error) + + PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter) (*PostUsersOK, error) + + PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetUserOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUserParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetUsersObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersObservableParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PostUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostUsersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutUsersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..4cbea4e --- /dev/null +++ b/api/devops/devops_models/address.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..2fd7e4c --- /dev/null +++ b/api/devops/devops_models/cluster.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus 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 +} + +// 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..493ff74 --- /dev/null +++ b/api/devops/devops_models/cluster_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..5d627b4 --- /dev/null +++ b/api/devops/devops_models/cluster_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..ebc12d2 --- /dev/null +++ b/api/devops/devops_models/database.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 Taxnexus 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 +} + +// 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..642466d --- /dev/null +++ b/api/devops/devops_models/database_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..715d640 --- /dev/null +++ b/api/devops/devops_models/database_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..a75d3c8 --- /dev/null +++ b/api/devops/devops_models/delete_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..acee92d --- /dev/null +++ b/api/devops/devops_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..13da67b --- /dev/null +++ b/api/devops/devops_models/ingest.go @@ -0,0 +1,443 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 Taxnexus +// +// 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"` + + // Taxnexus 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"` + + // Taxnexus 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" + + // IngestIngestTypeTaxnexusAPI captures enum value "taxnexus-api" + IngestIngestTypeTaxnexusAPI 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" + + // IngestObjectTypeCashReceipt captures enum value "cash-receipt" + IngestObjectTypeCashReceipt 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 +} + +// 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..3c22917 --- /dev/null +++ b/api/devops/devops_models/ingest_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..8a4c54d --- /dev/null +++ b/api/devops/devops_models/ingest_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..c4f2355 --- /dev/null +++ b/api/devops/devops_models/job.go @@ -0,0 +1,484 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 { + + // Taxnexus Account Id + // Required: true + AccountID *string `json:"AccountID"` + + // Taxnexus Backend ID + BackendID string `json:"BackendID,omitempty"` + + // Taxnexus Company ID + CompanyID string `json:"CompanyID,omitempty"` + + // Taxnexus Coordinate ID + CoordinateID string `json:"CoordinateID,omitempty"` + + // Taxnexus 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"` + + // Taxnexus 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 +} + +// 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..d662f4b --- /dev/null +++ b/api/devops/devops_models/job_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..84dd245 --- /dev/null +++ b/api/devops/devops_models/job_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..7d52c9a --- /dev/null +++ b/api/devops/devops_models/message.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..3e40a60 --- /dev/null +++ b/api/devops/devops_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..fa6a7c4 --- /dev/null +++ b/api/devops/devops_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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..1fef58d --- /dev/null +++ b/api/devops/devops_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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..1cc7933 --- /dev/null +++ b/api/devops/devops_models/role.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..152da7d --- /dev/null +++ b/api/devops/devops_models/role_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..cee68ef --- /dev/null +++ b/api/devops/devops_models/role_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..e2f2c4b --- /dev/null +++ b/api/devops/devops_models/service.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus 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 +} + +// 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..594de69 --- /dev/null +++ b/api/devops/devops_models/service_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..a6411b5 --- /dev/null +++ b/api/devops/devops_models/service_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..8942569 --- /dev/null +++ b/api/devops/devops_models/template.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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"` + + // Taxnexus 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 +} + +// 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..5a49165 --- /dev/null +++ b/api/devops/devops_models/template_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..2ae794c --- /dev/null +++ b/api/devops/devops_models/template_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..902bb5f --- /dev/null +++ b/api/devops/devops_models/tenant.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Tenant Taxnexus 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 +} + +// 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..5fd9846 --- /dev/null +++ b/api/devops/devops_models/tenant_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..66199da --- /dev/null +++ b/api/devops/devops_models/tenant_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..0446999 --- /dev/null +++ b/api/devops/devops_models/tenant_user.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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..76c3c92 --- /dev/null +++ b/api/devops/devops_models/user.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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..657c6e7 --- /dev/null +++ b/api/devops/devops_models/user_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..3905793 --- /dev/null +++ b/api/devops/devops_models/user_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..10cf776 --- /dev/null +++ b/api/devops/devops_models/user_role.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/geo/geo_client/coordinate/coordinate_client.go b/api/geo/geo_client/coordinate/coordinate_client.go new file mode 100644 index 0000000..c1217be --- /dev/null +++ b/api/geo/geo_client/coordinate/coordinate_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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 coordinate API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for coordinate API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteCoordinate(params *DeleteCoordinateParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCoordinateOK, error) + + GetCoordinateBasic(params *GetCoordinateBasicParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinateBasicOK, error) + + GetCoordinateObservable(params *GetCoordinateObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinateObservableOK, error) + + GetCoordinates(params *GetCoordinatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinatesOK, error) + + PostCoordinates(params *PostCoordinatesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCoordinatesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteCoordinate deletes a coordinate + + Delete a Taxneuxs Coordinate record from the Coordinate database +*/ +func (a *Client) DeleteCoordinate(params *DeleteCoordinateParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCoordinateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteCoordinateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteCoordinate", + Method: "DELETE", + PathPattern: "/coordinates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteCoordinateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteCoordinateOK) + 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 deleteCoordinate: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCoordinateBasic gets a single taxnexus coordinate from address information + + Response is one minimized Coordinate record including Tax Type IDs +*/ +func (a *Client) GetCoordinateBasic(params *GetCoordinateBasicParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinateBasicOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCoordinateBasicParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCoordinateBasic", + Method: "GET", + PathPattern: "/coordinates/basic", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCoordinateBasicReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCoordinateBasicOK) + 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 getCoordinateBasic: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCoordinateObservable gets a single taxnexus coordinate as an observable array + + Response is one minimized Coordinate record including Tax Type IDs as an observable array +*/ +func (a *Client) GetCoordinateObservable(params *GetCoordinateObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinateObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCoordinateObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCoordinateObservable", + Method: "GET", + PathPattern: "/coordinates/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCoordinateObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCoordinateObservableOK) + 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 getCoordinateObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCoordinates gets a single taxnexus coordinate from address information + + Return a fully-populated Coordinate record including Tax Type array +*/ +func (a *Client) GetCoordinates(params *GetCoordinatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCoordinatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCoordinates", + Method: "GET", + PathPattern: "/coordinates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCoordinatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCoordinatesOK) + 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 getCoordinates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCoordinates processes a batch of coordinate g e t requests + + Processes a batch of Coordinate GET requests and returns an array of Coordinate records including Tax Type IDs +*/ +func (a *Client) PostCoordinates(params *PostCoordinatesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCoordinatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCoordinatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCoordinates", + Method: "POST", + PathPattern: "/coordinates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCoordinatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCoordinatesOK) + 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 postCoordinates: 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/geo/geo_client/coordinate/delete_coordinate_parameters.go b/api/geo/geo_client/coordinate/delete_coordinate_parameters.go new file mode 100644 index 0000000..d818fa4 --- /dev/null +++ b/api/geo/geo_client/coordinate/delete_coordinate_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" +) + +// NewDeleteCoordinateParams creates a new DeleteCoordinateParams object +// with the default values initialized. +func NewDeleteCoordinateParams() *DeleteCoordinateParams { + var () + return &DeleteCoordinateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteCoordinateParamsWithTimeout creates a new DeleteCoordinateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteCoordinateParamsWithTimeout(timeout time.Duration) *DeleteCoordinateParams { + var () + return &DeleteCoordinateParams{ + + timeout: timeout, + } +} + +// NewDeleteCoordinateParamsWithContext creates a new DeleteCoordinateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteCoordinateParamsWithContext(ctx context.Context) *DeleteCoordinateParams { + var () + return &DeleteCoordinateParams{ + + Context: ctx, + } +} + +// NewDeleteCoordinateParamsWithHTTPClient creates a new DeleteCoordinateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteCoordinateParamsWithHTTPClient(client *http.Client) *DeleteCoordinateParams { + var () + return &DeleteCoordinateParams{ + HTTPClient: client, + } +} + +/*DeleteCoordinateParams contains all the parameters to send to the API endpoint +for the delete coordinate operation typically these are written to a http.Request +*/ +type DeleteCoordinateParams struct { + + /*CoordinateID + Taxnexus Record Id of a Coordinate + + */ + CoordinateID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete coordinate params +func (o *DeleteCoordinateParams) WithTimeout(timeout time.Duration) *DeleteCoordinateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete coordinate params +func (o *DeleteCoordinateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete coordinate params +func (o *DeleteCoordinateParams) WithContext(ctx context.Context) *DeleteCoordinateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete coordinate params +func (o *DeleteCoordinateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete coordinate params +func (o *DeleteCoordinateParams) WithHTTPClient(client *http.Client) *DeleteCoordinateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete coordinate params +func (o *DeleteCoordinateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCoordinateID adds the coordinateID to the delete coordinate params +func (o *DeleteCoordinateParams) WithCoordinateID(coordinateID *string) *DeleteCoordinateParams { + o.SetCoordinateID(coordinateID) + return o +} + +// SetCoordinateID adds the coordinateId to the delete coordinate params +func (o *DeleteCoordinateParams) SetCoordinateID(coordinateID *string) { + o.CoordinateID = coordinateID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteCoordinateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CoordinateID != nil { + + // query param coordinateId + var qrCoordinateID string + if o.CoordinateID != nil { + qrCoordinateID = *o.CoordinateID + } + qCoordinateID := qrCoordinateID + if qCoordinateID != "" { + if err := r.SetQueryParam("coordinateId", qCoordinateID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/coordinate/delete_coordinate_responses.go b/api/geo/geo_client/coordinate/delete_coordinate_responses.go new file mode 100644 index 0000000..baa60bd --- /dev/null +++ b/api/geo/geo_client/coordinate/delete_coordinate_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// DeleteCoordinateReader is a Reader for the DeleteCoordinate structure. +type DeleteCoordinateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteCoordinateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteCoordinateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteCoordinateUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteCoordinateForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteCoordinateNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteCoordinateUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteCoordinateInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteCoordinateOK creates a DeleteCoordinateOK with default headers values +func NewDeleteCoordinateOK() *DeleteCoordinateOK { + return &DeleteCoordinateOK{} +} + +/*DeleteCoordinateOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteCoordinateOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.DeleteResponse +} + +func (o *DeleteCoordinateOK) Error() string { + return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateOK %+v", 200, o.Payload) +} + +func (o *DeleteCoordinateOK) GetPayload() *geo_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteCoordinateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCoordinateUnauthorized creates a DeleteCoordinateUnauthorized with default headers values +func NewDeleteCoordinateUnauthorized() *DeleteCoordinateUnauthorized { + return &DeleteCoordinateUnauthorized{} +} + +/*DeleteCoordinateUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteCoordinateUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *DeleteCoordinateUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteCoordinateUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *DeleteCoordinateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCoordinateForbidden creates a DeleteCoordinateForbidden with default headers values +func NewDeleteCoordinateForbidden() *DeleteCoordinateForbidden { + return &DeleteCoordinateForbidden{} +} + +/*DeleteCoordinateForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteCoordinateForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *DeleteCoordinateForbidden) Error() string { + return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateForbidden %+v", 403, o.Payload) +} + +func (o *DeleteCoordinateForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *DeleteCoordinateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCoordinateNotFound creates a DeleteCoordinateNotFound with default headers values +func NewDeleteCoordinateNotFound() *DeleteCoordinateNotFound { + return &DeleteCoordinateNotFound{} +} + +/*DeleteCoordinateNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteCoordinateNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *DeleteCoordinateNotFound) Error() string { + return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateNotFound %+v", 404, o.Payload) +} + +func (o *DeleteCoordinateNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *DeleteCoordinateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCoordinateUnprocessableEntity creates a DeleteCoordinateUnprocessableEntity with default headers values +func NewDeleteCoordinateUnprocessableEntity() *DeleteCoordinateUnprocessableEntity { + return &DeleteCoordinateUnprocessableEntity{} +} + +/*DeleteCoordinateUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteCoordinateUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *DeleteCoordinateUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteCoordinateUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *DeleteCoordinateUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCoordinateInternalServerError creates a DeleteCoordinateInternalServerError with default headers values +func NewDeleteCoordinateInternalServerError() *DeleteCoordinateInternalServerError { + return &DeleteCoordinateInternalServerError{} +} + +/*DeleteCoordinateInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteCoordinateInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *DeleteCoordinateInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /coordinates][%d] deleteCoordinateInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteCoordinateInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *DeleteCoordinateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/coordinate/get_coordinate_basic_parameters.go b/api/geo/geo_client/coordinate/get_coordinate_basic_parameters.go new file mode 100644 index 0000000..7fa6ec9 --- /dev/null +++ b/api/geo/geo_client/coordinate/get_coordinate_basic_parameters.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" +) + +// NewGetCoordinateBasicParams creates a new GetCoordinateBasicParams object +// with the default values initialized. +func NewGetCoordinateBasicParams() *GetCoordinateBasicParams { + var () + return &GetCoordinateBasicParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCoordinateBasicParamsWithTimeout creates a new GetCoordinateBasicParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCoordinateBasicParamsWithTimeout(timeout time.Duration) *GetCoordinateBasicParams { + var () + return &GetCoordinateBasicParams{ + + timeout: timeout, + } +} + +// NewGetCoordinateBasicParamsWithContext creates a new GetCoordinateBasicParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCoordinateBasicParamsWithContext(ctx context.Context) *GetCoordinateBasicParams { + var () + return &GetCoordinateBasicParams{ + + Context: ctx, + } +} + +// NewGetCoordinateBasicParamsWithHTTPClient creates a new GetCoordinateBasicParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCoordinateBasicParamsWithHTTPClient(client *http.Client) *GetCoordinateBasicParams { + var () + return &GetCoordinateBasicParams{ + HTTPClient: client, + } +} + +/*GetCoordinateBasicParams contains all the parameters to send to the API endpoint +for the get coordinate basic operation typically these are written to a http.Request +*/ +type GetCoordinateBasicParams struct { + + /*Address + Postal Address URL encoded; partial addresses allowed + + */ + Address *string + /*CoordinateID + Taxnexus Record Id of a Coordinate + + */ + CoordinateID *string + /*Date + Transaction date (defaults to current) + + */ + Date *string + /*PlaceName + Alternate City, ST format to backup addressQuery + + */ + PlaceName *string + /*Ref + Source system reference + + */ + Ref *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithTimeout(timeout time.Duration) *GetCoordinateBasicParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithContext(ctx context.Context) *GetCoordinateBasicParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithHTTPClient(client *http.Client) *GetCoordinateBasicParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddress adds the address to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithAddress(address *string) *GetCoordinateBasicParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetAddress(address *string) { + o.Address = address +} + +// WithCoordinateID adds the coordinateID to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithCoordinateID(coordinateID *string) *GetCoordinateBasicParams { + o.SetCoordinateID(coordinateID) + return o +} + +// SetCoordinateID adds the coordinateId to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetCoordinateID(coordinateID *string) { + o.CoordinateID = coordinateID +} + +// WithDate adds the date to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithDate(date *string) *GetCoordinateBasicParams { + o.SetDate(date) + return o +} + +// SetDate adds the date to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetDate(date *string) { + o.Date = date +} + +// WithPlaceName adds the placeName to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithPlaceName(placeName *string) *GetCoordinateBasicParams { + o.SetPlaceName(placeName) + return o +} + +// SetPlaceName adds the placeName to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetPlaceName(placeName *string) { + o.PlaceName = placeName +} + +// WithRef adds the ref to the get coordinate basic params +func (o *GetCoordinateBasicParams) WithRef(ref *string) *GetCoordinateBasicParams { + o.SetRef(ref) + return o +} + +// SetRef adds the ref to the get coordinate basic params +func (o *GetCoordinateBasicParams) SetRef(ref *string) { + o.Ref = ref +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCoordinateBasicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Address != nil { + + // query param address + var qrAddress string + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + + } + + if o.CoordinateID != nil { + + // query param coordinateId + var qrCoordinateID string + if o.CoordinateID != nil { + qrCoordinateID = *o.CoordinateID + } + qCoordinateID := qrCoordinateID + if qCoordinateID != "" { + if err := r.SetQueryParam("coordinateId", qCoordinateID); err != nil { + return err + } + } + + } + + if o.Date != nil { + + // query param date + var qrDate string + if o.Date != nil { + qrDate = *o.Date + } + qDate := qrDate + if qDate != "" { + if err := r.SetQueryParam("date", qDate); err != nil { + return err + } + } + + } + + if o.PlaceName != nil { + + // query param placeName + var qrPlaceName string + if o.PlaceName != nil { + qrPlaceName = *o.PlaceName + } + qPlaceName := qrPlaceName + if qPlaceName != "" { + if err := r.SetQueryParam("placeName", qPlaceName); err != nil { + return err + } + } + + } + + if o.Ref != nil { + + // query param ref + var qrRef string + if o.Ref != nil { + qrRef = *o.Ref + } + qRef := qrRef + if qRef != "" { + if err := r.SetQueryParam("ref", qRef); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/coordinate/get_coordinate_basic_responses.go b/api/geo/geo_client/coordinate/get_coordinate_basic_responses.go new file mode 100644 index 0000000..03c530e --- /dev/null +++ b/api/geo/geo_client/coordinate/get_coordinate_basic_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetCoordinateBasicReader is a Reader for the GetCoordinateBasic structure. +type GetCoordinateBasicReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCoordinateBasicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCoordinateBasicOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCoordinateBasicUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCoordinateBasicForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCoordinateBasicNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCoordinateBasicUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCoordinateBasicInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCoordinateBasicOK creates a GetCoordinateBasicOK with default headers values +func NewGetCoordinateBasicOK() *GetCoordinateBasicOK { + return &GetCoordinateBasicOK{} +} + +/*GetCoordinateBasicOK handles this case with default header values. + +Taxnexus Response with an array of basic Coordinate objects +*/ +type GetCoordinateBasicOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.CoordinateBasicResponse +} + +func (o *GetCoordinateBasicOK) Error() string { + return fmt.Sprintf("[GET /coordinates/basic][%d] getCoordinateBasicOK %+v", 200, o.Payload) +} + +func (o *GetCoordinateBasicOK) GetPayload() *geo_models.CoordinateBasicResponse { + return o.Payload +} + +func (o *GetCoordinateBasicOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.CoordinateBasicResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateBasicUnauthorized creates a GetCoordinateBasicUnauthorized with default headers values +func NewGetCoordinateBasicUnauthorized() *GetCoordinateBasicUnauthorized { + return &GetCoordinateBasicUnauthorized{} +} + +/*GetCoordinateBasicUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCoordinateBasicUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateBasicUnauthorized) Error() string { + return fmt.Sprintf("[GET /coordinates/basic][%d] getCoordinateBasicUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCoordinateBasicUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateBasicUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateBasicForbidden creates a GetCoordinateBasicForbidden with default headers values +func NewGetCoordinateBasicForbidden() *GetCoordinateBasicForbidden { + return &GetCoordinateBasicForbidden{} +} + +/*GetCoordinateBasicForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCoordinateBasicForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateBasicForbidden) Error() string { + return fmt.Sprintf("[GET /coordinates/basic][%d] getCoordinateBasicForbidden %+v", 403, o.Payload) +} + +func (o *GetCoordinateBasicForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateBasicForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateBasicNotFound creates a GetCoordinateBasicNotFound with default headers values +func NewGetCoordinateBasicNotFound() *GetCoordinateBasicNotFound { + return &GetCoordinateBasicNotFound{} +} + +/*GetCoordinateBasicNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCoordinateBasicNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateBasicNotFound) Error() string { + return fmt.Sprintf("[GET /coordinates/basic][%d] getCoordinateBasicNotFound %+v", 404, o.Payload) +} + +func (o *GetCoordinateBasicNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateBasicNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateBasicUnprocessableEntity creates a GetCoordinateBasicUnprocessableEntity with default headers values +func NewGetCoordinateBasicUnprocessableEntity() *GetCoordinateBasicUnprocessableEntity { + return &GetCoordinateBasicUnprocessableEntity{} +} + +/*GetCoordinateBasicUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCoordinateBasicUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateBasicUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /coordinates/basic][%d] getCoordinateBasicUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCoordinateBasicUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateBasicUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateBasicInternalServerError creates a GetCoordinateBasicInternalServerError with default headers values +func NewGetCoordinateBasicInternalServerError() *GetCoordinateBasicInternalServerError { + return &GetCoordinateBasicInternalServerError{} +} + +/*GetCoordinateBasicInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCoordinateBasicInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateBasicInternalServerError) Error() string { + return fmt.Sprintf("[GET /coordinates/basic][%d] getCoordinateBasicInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCoordinateBasicInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateBasicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/coordinate/get_coordinate_observable_parameters.go b/api/geo/geo_client/coordinate/get_coordinate_observable_parameters.go new file mode 100644 index 0000000..95de158 --- /dev/null +++ b/api/geo/geo_client/coordinate/get_coordinate_observable_parameters.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" +) + +// NewGetCoordinateObservableParams creates a new GetCoordinateObservableParams object +// with the default values initialized. +func NewGetCoordinateObservableParams() *GetCoordinateObservableParams { + var () + return &GetCoordinateObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCoordinateObservableParamsWithTimeout creates a new GetCoordinateObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCoordinateObservableParamsWithTimeout(timeout time.Duration) *GetCoordinateObservableParams { + var () + return &GetCoordinateObservableParams{ + + timeout: timeout, + } +} + +// NewGetCoordinateObservableParamsWithContext creates a new GetCoordinateObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCoordinateObservableParamsWithContext(ctx context.Context) *GetCoordinateObservableParams { + var () + return &GetCoordinateObservableParams{ + + Context: ctx, + } +} + +// NewGetCoordinateObservableParamsWithHTTPClient creates a new GetCoordinateObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCoordinateObservableParamsWithHTTPClient(client *http.Client) *GetCoordinateObservableParams { + var () + return &GetCoordinateObservableParams{ + HTTPClient: client, + } +} + +/*GetCoordinateObservableParams contains all the parameters to send to the API endpoint +for the get coordinate observable operation typically these are written to a http.Request +*/ +type GetCoordinateObservableParams struct { + + /*Address + Postal Address URL encoded; partial addresses allowed + + */ + Address *string + /*CoordinateID + Taxnexus Record Id of a Coordinate + + */ + CoordinateID *string + /*Date + Transaction date (defaults to current) + + */ + Date *string + /*PlaceName + Alternate City, ST format to backup addressQuery + + */ + PlaceName *string + /*Ref + Source system reference + + */ + Ref *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithTimeout(timeout time.Duration) *GetCoordinateObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithContext(ctx context.Context) *GetCoordinateObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithHTTPClient(client *http.Client) *GetCoordinateObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddress adds the address to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithAddress(address *string) *GetCoordinateObservableParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetAddress(address *string) { + o.Address = address +} + +// WithCoordinateID adds the coordinateID to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithCoordinateID(coordinateID *string) *GetCoordinateObservableParams { + o.SetCoordinateID(coordinateID) + return o +} + +// SetCoordinateID adds the coordinateId to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetCoordinateID(coordinateID *string) { + o.CoordinateID = coordinateID +} + +// WithDate adds the date to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithDate(date *string) *GetCoordinateObservableParams { + o.SetDate(date) + return o +} + +// SetDate adds the date to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetDate(date *string) { + o.Date = date +} + +// WithPlaceName adds the placeName to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithPlaceName(placeName *string) *GetCoordinateObservableParams { + o.SetPlaceName(placeName) + return o +} + +// SetPlaceName adds the placeName to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetPlaceName(placeName *string) { + o.PlaceName = placeName +} + +// WithRef adds the ref to the get coordinate observable params +func (o *GetCoordinateObservableParams) WithRef(ref *string) *GetCoordinateObservableParams { + o.SetRef(ref) + return o +} + +// SetRef adds the ref to the get coordinate observable params +func (o *GetCoordinateObservableParams) SetRef(ref *string) { + o.Ref = ref +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCoordinateObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Address != nil { + + // query param address + var qrAddress string + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + + } + + if o.CoordinateID != nil { + + // query param coordinateId + var qrCoordinateID string + if o.CoordinateID != nil { + qrCoordinateID = *o.CoordinateID + } + qCoordinateID := qrCoordinateID + if qCoordinateID != "" { + if err := r.SetQueryParam("coordinateId", qCoordinateID); err != nil { + return err + } + } + + } + + if o.Date != nil { + + // query param date + var qrDate string + if o.Date != nil { + qrDate = *o.Date + } + qDate := qrDate + if qDate != "" { + if err := r.SetQueryParam("date", qDate); err != nil { + return err + } + } + + } + + if o.PlaceName != nil { + + // query param placeName + var qrPlaceName string + if o.PlaceName != nil { + qrPlaceName = *o.PlaceName + } + qPlaceName := qrPlaceName + if qPlaceName != "" { + if err := r.SetQueryParam("placeName", qPlaceName); err != nil { + return err + } + } + + } + + if o.Ref != nil { + + // query param ref + var qrRef string + if o.Ref != nil { + qrRef = *o.Ref + } + qRef := qrRef + if qRef != "" { + if err := r.SetQueryParam("ref", qRef); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/coordinate/get_coordinate_observable_responses.go b/api/geo/geo_client/coordinate/get_coordinate_observable_responses.go new file mode 100644 index 0000000..dabc39d --- /dev/null +++ b/api/geo/geo_client/coordinate/get_coordinate_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetCoordinateObservableReader is a Reader for the GetCoordinateObservable structure. +type GetCoordinateObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCoordinateObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCoordinateObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCoordinateObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCoordinateObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCoordinateObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCoordinateObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCoordinateObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCoordinateObservableOK creates a GetCoordinateObservableOK with default headers values +func NewGetCoordinateObservableOK() *GetCoordinateObservableOK { + return &GetCoordinateObservableOK{} +} + +/*GetCoordinateObservableOK handles this case with default header values. + +Taxnexus Response with an array of basic Coordinate objects +*/ +type GetCoordinateObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.Coordinate +} + +func (o *GetCoordinateObservableOK) Error() string { + return fmt.Sprintf("[GET /coordinates/observable][%d] getCoordinateObservableOK %+v", 200, o.Payload) +} + +func (o *GetCoordinateObservableOK) GetPayload() []*geo_models.Coordinate { + return o.Payload +} + +func (o *GetCoordinateObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateObservableUnauthorized creates a GetCoordinateObservableUnauthorized with default headers values +func NewGetCoordinateObservableUnauthorized() *GetCoordinateObservableUnauthorized { + return &GetCoordinateObservableUnauthorized{} +} + +/*GetCoordinateObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCoordinateObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /coordinates/observable][%d] getCoordinateObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCoordinateObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateObservableForbidden creates a GetCoordinateObservableForbidden with default headers values +func NewGetCoordinateObservableForbidden() *GetCoordinateObservableForbidden { + return &GetCoordinateObservableForbidden{} +} + +/*GetCoordinateObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCoordinateObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateObservableForbidden) Error() string { + return fmt.Sprintf("[GET /coordinates/observable][%d] getCoordinateObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetCoordinateObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateObservableNotFound creates a GetCoordinateObservableNotFound with default headers values +func NewGetCoordinateObservableNotFound() *GetCoordinateObservableNotFound { + return &GetCoordinateObservableNotFound{} +} + +/*GetCoordinateObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCoordinateObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateObservableNotFound) Error() string { + return fmt.Sprintf("[GET /coordinates/observable][%d] getCoordinateObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetCoordinateObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateObservableUnprocessableEntity creates a GetCoordinateObservableUnprocessableEntity with default headers values +func NewGetCoordinateObservableUnprocessableEntity() *GetCoordinateObservableUnprocessableEntity { + return &GetCoordinateObservableUnprocessableEntity{} +} + +/*GetCoordinateObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCoordinateObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /coordinates/observable][%d] getCoordinateObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCoordinateObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinateObservableInternalServerError creates a GetCoordinateObservableInternalServerError with default headers values +func NewGetCoordinateObservableInternalServerError() *GetCoordinateObservableInternalServerError { + return &GetCoordinateObservableInternalServerError{} +} + +/*GetCoordinateObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCoordinateObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinateObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /coordinates/observable][%d] getCoordinateObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCoordinateObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinateObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/coordinate/get_coordinates_parameters.go b/api/geo/geo_client/coordinate/get_coordinates_parameters.go new file mode 100644 index 0000000..cb0bea8 --- /dev/null +++ b/api/geo/geo_client/coordinate/get_coordinates_parameters.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" +) + +// NewGetCoordinatesParams creates a new GetCoordinatesParams object +// with the default values initialized. +func NewGetCoordinatesParams() *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCoordinatesParamsWithTimeout creates a new GetCoordinatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCoordinatesParamsWithTimeout(timeout time.Duration) *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + + timeout: timeout, + } +} + +// NewGetCoordinatesParamsWithContext creates a new GetCoordinatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCoordinatesParamsWithContext(ctx context.Context) *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + + Context: ctx, + } +} + +// NewGetCoordinatesParamsWithHTTPClient creates a new GetCoordinatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCoordinatesParamsWithHTTPClient(client *http.Client) *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + HTTPClient: client, + } +} + +/*GetCoordinatesParams contains all the parameters to send to the API endpoint +for the get coordinates operation typically these are written to a http.Request +*/ +type GetCoordinatesParams struct { + + /*Address + Postal Address URL encoded; partial addresses allowed + + */ + Address *string + /*CoordinateID + Taxnexus Record Id of a Coordinate + + */ + CoordinateID *string + /*Date + Transaction date (defaults to current) + + */ + Date *string + /*PlaceName + Alternate City, ST format to backup addressQuery + + */ + PlaceName *string + /*Ref + Source system reference + + */ + Ref *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get coordinates params +func (o *GetCoordinatesParams) WithTimeout(timeout time.Duration) *GetCoordinatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get coordinates params +func (o *GetCoordinatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get coordinates params +func (o *GetCoordinatesParams) WithContext(ctx context.Context) *GetCoordinatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get coordinates params +func (o *GetCoordinatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get coordinates params +func (o *GetCoordinatesParams) WithHTTPClient(client *http.Client) *GetCoordinatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get coordinates params +func (o *GetCoordinatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddress adds the address to the get coordinates params +func (o *GetCoordinatesParams) WithAddress(address *string) *GetCoordinatesParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the get coordinates params +func (o *GetCoordinatesParams) SetAddress(address *string) { + o.Address = address +} + +// WithCoordinateID adds the coordinateID to the get coordinates params +func (o *GetCoordinatesParams) WithCoordinateID(coordinateID *string) *GetCoordinatesParams { + o.SetCoordinateID(coordinateID) + return o +} + +// SetCoordinateID adds the coordinateId to the get coordinates params +func (o *GetCoordinatesParams) SetCoordinateID(coordinateID *string) { + o.CoordinateID = coordinateID +} + +// WithDate adds the date to the get coordinates params +func (o *GetCoordinatesParams) WithDate(date *string) *GetCoordinatesParams { + o.SetDate(date) + return o +} + +// SetDate adds the date to the get coordinates params +func (o *GetCoordinatesParams) SetDate(date *string) { + o.Date = date +} + +// WithPlaceName adds the placeName to the get coordinates params +func (o *GetCoordinatesParams) WithPlaceName(placeName *string) *GetCoordinatesParams { + o.SetPlaceName(placeName) + return o +} + +// SetPlaceName adds the placeName to the get coordinates params +func (o *GetCoordinatesParams) SetPlaceName(placeName *string) { + o.PlaceName = placeName +} + +// WithRef adds the ref to the get coordinates params +func (o *GetCoordinatesParams) WithRef(ref *string) *GetCoordinatesParams { + o.SetRef(ref) + return o +} + +// SetRef adds the ref to the get coordinates params +func (o *GetCoordinatesParams) SetRef(ref *string) { + o.Ref = ref +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCoordinatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Address != nil { + + // query param address + var qrAddress string + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + + } + + if o.CoordinateID != nil { + + // query param coordinateId + var qrCoordinateID string + if o.CoordinateID != nil { + qrCoordinateID = *o.CoordinateID + } + qCoordinateID := qrCoordinateID + if qCoordinateID != "" { + if err := r.SetQueryParam("coordinateId", qCoordinateID); err != nil { + return err + } + } + + } + + if o.Date != nil { + + // query param date + var qrDate string + if o.Date != nil { + qrDate = *o.Date + } + qDate := qrDate + if qDate != "" { + if err := r.SetQueryParam("date", qDate); err != nil { + return err + } + } + + } + + if o.PlaceName != nil { + + // query param placeName + var qrPlaceName string + if o.PlaceName != nil { + qrPlaceName = *o.PlaceName + } + qPlaceName := qrPlaceName + if qPlaceName != "" { + if err := r.SetQueryParam("placeName", qPlaceName); err != nil { + return err + } + } + + } + + if o.Ref != nil { + + // query param ref + var qrRef string + if o.Ref != nil { + qrRef = *o.Ref + } + qRef := qrRef + if qRef != "" { + if err := r.SetQueryParam("ref", qRef); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/coordinate/get_coordinates_responses.go b/api/geo/geo_client/coordinate/get_coordinates_responses.go new file mode 100644 index 0000000..1f97a9f --- /dev/null +++ b/api/geo/geo_client/coordinate/get_coordinates_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetCoordinatesReader is a Reader for the GetCoordinates structure. +type GetCoordinatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCoordinatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCoordinatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCoordinatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCoordinatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCoordinatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCoordinatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCoordinatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCoordinatesOK creates a GetCoordinatesOK with default headers values +func NewGetCoordinatesOK() *GetCoordinatesOK { + return &GetCoordinatesOK{} +} + +/*GetCoordinatesOK handles this case with default header values. + +Taxnexus Response with an array of Coordinate objects +*/ +type GetCoordinatesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.CoordinateResponse +} + +func (o *GetCoordinatesOK) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesOK %+v", 200, o.Payload) +} + +func (o *GetCoordinatesOK) GetPayload() *geo_models.CoordinateResponse { + return o.Payload +} + +func (o *GetCoordinatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.CoordinateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesUnauthorized creates a GetCoordinatesUnauthorized with default headers values +func NewGetCoordinatesUnauthorized() *GetCoordinatesUnauthorized { + return &GetCoordinatesUnauthorized{} +} + +/*GetCoordinatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCoordinatesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCoordinatesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesForbidden creates a GetCoordinatesForbidden with default headers values +func NewGetCoordinatesForbidden() *GetCoordinatesForbidden { + return &GetCoordinatesForbidden{} +} + +/*GetCoordinatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCoordinatesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinatesForbidden) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesForbidden %+v", 403, o.Payload) +} + +func (o *GetCoordinatesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesNotFound creates a GetCoordinatesNotFound with default headers values +func NewGetCoordinatesNotFound() *GetCoordinatesNotFound { + return &GetCoordinatesNotFound{} +} + +/*GetCoordinatesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCoordinatesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinatesNotFound) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesNotFound %+v", 404, o.Payload) +} + +func (o *GetCoordinatesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesUnprocessableEntity creates a GetCoordinatesUnprocessableEntity with default headers values +func NewGetCoordinatesUnprocessableEntity() *GetCoordinatesUnprocessableEntity { + return &GetCoordinatesUnprocessableEntity{} +} + +/*GetCoordinatesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCoordinatesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCoordinatesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesInternalServerError creates a GetCoordinatesInternalServerError with default headers values +func NewGetCoordinatesInternalServerError() *GetCoordinatesInternalServerError { + return &GetCoordinatesInternalServerError{} +} + +/*GetCoordinatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCoordinatesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCoordinatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCoordinatesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCoordinatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/coordinate/post_coordinates_parameters.go b/api/geo/geo_client/coordinate/post_coordinates_parameters.go new file mode 100644 index 0000000..3c13951 --- /dev/null +++ b/api/geo/geo_client/coordinate/post_coordinates_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostCoordinatesParams creates a new PostCoordinatesParams object +// with the default values initialized. +func NewPostCoordinatesParams() *PostCoordinatesParams { + var () + return &PostCoordinatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCoordinatesParamsWithTimeout creates a new PostCoordinatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCoordinatesParamsWithTimeout(timeout time.Duration) *PostCoordinatesParams { + var () + return &PostCoordinatesParams{ + + timeout: timeout, + } +} + +// NewPostCoordinatesParamsWithContext creates a new PostCoordinatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCoordinatesParamsWithContext(ctx context.Context) *PostCoordinatesParams { + var () + return &PostCoordinatesParams{ + + Context: ctx, + } +} + +// NewPostCoordinatesParamsWithHTTPClient creates a new PostCoordinatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCoordinatesParamsWithHTTPClient(client *http.Client) *PostCoordinatesParams { + var () + return &PostCoordinatesParams{ + HTTPClient: client, + } +} + +/*PostCoordinatesParams contains all the parameters to send to the API endpoint +for the post coordinates operation typically these are written to a http.Request +*/ +type PostCoordinatesParams struct { + + /*CoordinateRequest + An array of new Coordinate records + + */ + CoordinateRequest *geo_models.CoordinateRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post coordinates params +func (o *PostCoordinatesParams) WithTimeout(timeout time.Duration) *PostCoordinatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post coordinates params +func (o *PostCoordinatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post coordinates params +func (o *PostCoordinatesParams) WithContext(ctx context.Context) *PostCoordinatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post coordinates params +func (o *PostCoordinatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post coordinates params +func (o *PostCoordinatesParams) WithHTTPClient(client *http.Client) *PostCoordinatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post coordinates params +func (o *PostCoordinatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCoordinateRequest adds the coordinateRequest to the post coordinates params +func (o *PostCoordinatesParams) WithCoordinateRequest(coordinateRequest *geo_models.CoordinateRequest) *PostCoordinatesParams { + o.SetCoordinateRequest(coordinateRequest) + return o +} + +// SetCoordinateRequest adds the coordinateRequest to the post coordinates params +func (o *PostCoordinatesParams) SetCoordinateRequest(coordinateRequest *geo_models.CoordinateRequest) { + o.CoordinateRequest = coordinateRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCoordinatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CoordinateRequest != nil { + if err := r.SetBodyParam(o.CoordinateRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/coordinate/post_coordinates_responses.go b/api/geo/geo_client/coordinate/post_coordinates_responses.go new file mode 100644 index 0000000..cdb468f --- /dev/null +++ b/api/geo/geo_client/coordinate/post_coordinates_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coordinate + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostCoordinatesReader is a Reader for the PostCoordinates structure. +type PostCoordinatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCoordinatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCoordinatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCoordinatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCoordinatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCoordinatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostCoordinatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCoordinatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostCoordinatesOK creates a PostCoordinatesOK with default headers values +func NewPostCoordinatesOK() *PostCoordinatesOK { + return &PostCoordinatesOK{} +} + +/*PostCoordinatesOK handles this case with default header values. + +Taxnexus Response with an array of Coordinate objects +*/ +type PostCoordinatesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.CoordinateResponse +} + +func (o *PostCoordinatesOK) Error() string { + return fmt.Sprintf("[POST /coordinates][%d] postCoordinatesOK %+v", 200, o.Payload) +} + +func (o *PostCoordinatesOK) GetPayload() *geo_models.CoordinateResponse { + return o.Payload +} + +func (o *PostCoordinatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.CoordinateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoordinatesUnauthorized creates a PostCoordinatesUnauthorized with default headers values +func NewPostCoordinatesUnauthorized() *PostCoordinatesUnauthorized { + return &PostCoordinatesUnauthorized{} +} + +/*PostCoordinatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostCoordinatesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCoordinatesUnauthorized) Error() string { + return fmt.Sprintf("[POST /coordinates][%d] postCoordinatesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCoordinatesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCoordinatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoordinatesForbidden creates a PostCoordinatesForbidden with default headers values +func NewPostCoordinatesForbidden() *PostCoordinatesForbidden { + return &PostCoordinatesForbidden{} +} + +/*PostCoordinatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostCoordinatesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCoordinatesForbidden) Error() string { + return fmt.Sprintf("[POST /coordinates][%d] postCoordinatesForbidden %+v", 403, o.Payload) +} + +func (o *PostCoordinatesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCoordinatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoordinatesNotFound creates a PostCoordinatesNotFound with default headers values +func NewPostCoordinatesNotFound() *PostCoordinatesNotFound { + return &PostCoordinatesNotFound{} +} + +/*PostCoordinatesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostCoordinatesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCoordinatesNotFound) Error() string { + return fmt.Sprintf("[POST /coordinates][%d] postCoordinatesNotFound %+v", 404, o.Payload) +} + +func (o *PostCoordinatesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCoordinatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoordinatesUnprocessableEntity creates a PostCoordinatesUnprocessableEntity with default headers values +func NewPostCoordinatesUnprocessableEntity() *PostCoordinatesUnprocessableEntity { + return &PostCoordinatesUnprocessableEntity{} +} + +/*PostCoordinatesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostCoordinatesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCoordinatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /coordinates][%d] postCoordinatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostCoordinatesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCoordinatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoordinatesInternalServerError creates a PostCoordinatesInternalServerError with default headers values +func NewPostCoordinatesInternalServerError() *PostCoordinatesInternalServerError { + return &PostCoordinatesInternalServerError{} +} + +/*PostCoordinatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostCoordinatesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCoordinatesInternalServerError) Error() string { + return fmt.Sprintf("[POST /coordinates][%d] postCoordinatesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCoordinatesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCoordinatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/cors/cors_client.go b/api/geo/geo_client/cors/cors_client.go new file mode 100644 index 0000000..af1e957 --- /dev/null +++ b/api/geo/geo_client/cors/cors_client.go @@ -0,0 +1,688 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCoordinatesObservableOptions(params *GetCoordinatesObservableOptionsParams) (*GetCoordinatesObservableOptionsOK, error) + + GetCoordinatesOptions(params *GetCoordinatesOptionsParams) (*GetCoordinatesOptionsOK, error) + + GetCountiesObservableOptions(params *GetCountiesObservableOptionsParams) (*GetCountiesObservableOptionsOK, error) + + GetCountiesOptions(params *GetCountiesOptionsParams) (*GetCountiesOptionsOK, error) + + GetCountriesObservableOptions(params *GetCountriesObservableOptionsParams) (*GetCountriesObservableOptionsOK, error) + + GetCountriesOptions(params *GetCountriesOptionsParams) (*GetCountriesOptionsOK, error) + + GetDomainsObservableOptions(params *GetDomainsObservableOptionsParams) (*GetDomainsObservableOptionsOK, error) + + GetDomainsOptions(params *GetDomainsOptionsParams) (*GetDomainsOptionsOK, error) + + GetPlacesObservableOptions(params *GetPlacesObservableOptionsParams) (*GetPlacesObservableOptionsOK, error) + + GetPlacesOptions(params *GetPlacesOptionsParams) (*GetPlacesOptionsOK, error) + + GetStatesObservableOptions(params *GetStatesObservableOptionsParams) (*GetStatesObservableOptionsOK, error) + + GetStatesOptions(params *GetStatesOptionsParams) (*GetStatesOptionsOK, error) + + GetTaxRateObservableOptions(params *GetTaxRateObservableOptionsParams) (*GetTaxRateObservableOptionsOK, error) + + GetTaxRatesOptions(params *GetTaxRatesOptionsParams) (*GetTaxRatesOptionsOK, error) + + GetTaxTypeObservableOptions(params *GetTaxTypeObservableOptionsParams) (*GetTaxTypeObservableOptionsOK, error) + + GetTaxTypesOptions(params *GetTaxTypesOptionsParams) (*GetTaxTypesOptionsOK, error) + + GetTaxnexusCodesObservableOptions(params *GetTaxnexusCodesObservableOptionsParams) (*GetTaxnexusCodesObservableOptionsOK, error) + + GetTaxnexusCodesOptions(params *GetTaxnexusCodesOptionsParams) (*GetTaxnexusCodesOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCoordinatesObservableOptions CORS support +*/ +func (a *Client) GetCoordinatesObservableOptions(params *GetCoordinatesObservableOptionsParams) (*GetCoordinatesObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCoordinatesObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCoordinatesObservableOptions", + Method: "OPTIONS", + PathPattern: "/coordinates/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCoordinatesObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCoordinatesObservableOptionsOK) + 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 getCoordinatesObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCoordinatesOptions CORS support +*/ +func (a *Client) GetCoordinatesOptions(params *GetCoordinatesOptionsParams) (*GetCoordinatesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCoordinatesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCoordinatesOptions", + Method: "OPTIONS", + PathPattern: "/coordinates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCoordinatesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCoordinatesOptionsOK) + 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 getCoordinatesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCountiesObservableOptions CORS support +*/ +func (a *Client) GetCountiesObservableOptions(params *GetCountiesObservableOptionsParams) (*GetCountiesObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountiesObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountiesObservableOptions", + Method: "OPTIONS", + PathPattern: "/counties/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountiesObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountiesObservableOptionsOK) + 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 getCountiesObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCountiesOptions CORS support +*/ +func (a *Client) GetCountiesOptions(params *GetCountiesOptionsParams) (*GetCountiesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountiesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountiesOptions", + Method: "OPTIONS", + PathPattern: "/counties", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountiesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountiesOptionsOK) + 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 getCountiesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCountriesObservableOptions CORS support +*/ +func (a *Client) GetCountriesObservableOptions(params *GetCountriesObservableOptionsParams) (*GetCountriesObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountriesObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountriesObservableOptions", + Method: "OPTIONS", + PathPattern: "/countries/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountriesObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountriesObservableOptionsOK) + 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 getCountriesObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCountriesOptions CORS support +*/ +func (a *Client) GetCountriesOptions(params *GetCountriesOptionsParams) (*GetCountriesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountriesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountriesOptions", + Method: "OPTIONS", + PathPattern: "/countries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountriesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountriesOptionsOK) + 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 getCountriesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetDomainsObservableOptions CORS support +*/ +func (a *Client) GetDomainsObservableOptions(params *GetDomainsObservableOptionsParams) (*GetDomainsObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDomainsObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getDomainsObservableOptions", + Method: "OPTIONS", + PathPattern: "/domains/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDomainsObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetDomainsObservableOptionsOK) + 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 getDomainsObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetDomainsOptions CORS support +*/ +func (a *Client) GetDomainsOptions(params *GetDomainsOptionsParams) (*GetDomainsOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDomainsOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getDomainsOptions", + Method: "OPTIONS", + PathPattern: "/domains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDomainsOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetDomainsOptionsOK) + 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 getDomainsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlacesObservableOptions CORS support +*/ +func (a *Client) GetPlacesObservableOptions(params *GetPlacesObservableOptionsParams) (*GetPlacesObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlacesObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlacesObservableOptions", + Method: "OPTIONS", + PathPattern: "/places/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlacesObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlacesObservableOptionsOK) + 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 getPlacesObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlacesOptions CORS support +*/ +func (a *Client) GetPlacesOptions(params *GetPlacesOptionsParams) (*GetPlacesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlacesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlacesOptions", + Method: "OPTIONS", + PathPattern: "/places", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlacesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlacesOptionsOK) + 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 getPlacesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetStatesObservableOptions CORS support +*/ +func (a *Client) GetStatesObservableOptions(params *GetStatesObservableOptionsParams) (*GetStatesObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetStatesObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getStatesObservableOptions", + Method: "OPTIONS", + PathPattern: "/states/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetStatesObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetStatesObservableOptionsOK) + 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 getStatesObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetStatesOptions CORS support +*/ +func (a *Client) GetStatesOptions(params *GetStatesOptionsParams) (*GetStatesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetStatesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getStatesOptions", + Method: "OPTIONS", + PathPattern: "/states", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetStatesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetStatesOptionsOK) + 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 getStatesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxRateObservableOptions CORS support +*/ +func (a *Client) GetTaxRateObservableOptions(params *GetTaxRateObservableOptionsParams) (*GetTaxRateObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxRateObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxRateObservableOptions", + Method: "OPTIONS", + PathPattern: "/taxrates/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxRateObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxRateObservableOptionsOK) + 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 getTaxRateObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxRatesOptions CORS support +*/ +func (a *Client) GetTaxRatesOptions(params *GetTaxRatesOptionsParams) (*GetTaxRatesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxRatesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxRatesOptions", + Method: "OPTIONS", + PathPattern: "/taxrates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxRatesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxRatesOptionsOK) + 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 getTaxRatesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxTypeObservableOptions CORS support +*/ +func (a *Client) GetTaxTypeObservableOptions(params *GetTaxTypeObservableOptionsParams) (*GetTaxTypeObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxTypeObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxTypeObservableOptions", + Method: "OPTIONS", + PathPattern: "/taxtypes/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxTypeObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxTypeObservableOptionsOK) + 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 getTaxTypeObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxTypesOptions CORS support +*/ +func (a *Client) GetTaxTypesOptions(params *GetTaxTypesOptionsParams) (*GetTaxTypesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxTypesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxTypesOptions", + Method: "OPTIONS", + PathPattern: "/taxtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxTypesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxTypesOptionsOK) + 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 getTaxTypesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxnexusCodesObservableOptions CORS support +*/ +func (a *Client) GetTaxnexusCodesObservableOptions(params *GetTaxnexusCodesObservableOptionsParams) (*GetTaxnexusCodesObservableOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxnexusCodesObservableOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxnexusCodesObservableOptions", + Method: "OPTIONS", + PathPattern: "/taxnexuscodes/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxnexusCodesObservableOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxnexusCodesObservableOptionsOK) + 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 getTaxnexusCodesObservableOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxnexusCodesOptions CORS support +*/ +func (a *Client) GetTaxnexusCodesOptions(params *GetTaxnexusCodesOptionsParams) (*GetTaxnexusCodesOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxnexusCodesOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxnexusCodesOptions", + Method: "OPTIONS", + PathPattern: "/taxnexuscodes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxnexusCodesOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxnexusCodesOptionsOK) + 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 getTaxnexusCodesOptions: 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/geo/geo_client/cors/get_coordinates_observable_options_parameters.go b/api/geo/geo_client/cors/get_coordinates_observable_options_parameters.go new file mode 100644 index 0000000..7613aaf --- /dev/null +++ b/api/geo/geo_client/cors/get_coordinates_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetCoordinatesObservableOptionsParams creates a new GetCoordinatesObservableOptionsParams object +// with the default values initialized. +func NewGetCoordinatesObservableOptionsParams() *GetCoordinatesObservableOptionsParams { + + return &GetCoordinatesObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCoordinatesObservableOptionsParamsWithTimeout creates a new GetCoordinatesObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCoordinatesObservableOptionsParamsWithTimeout(timeout time.Duration) *GetCoordinatesObservableOptionsParams { + + return &GetCoordinatesObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetCoordinatesObservableOptionsParamsWithContext creates a new GetCoordinatesObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCoordinatesObservableOptionsParamsWithContext(ctx context.Context) *GetCoordinatesObservableOptionsParams { + + return &GetCoordinatesObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetCoordinatesObservableOptionsParamsWithHTTPClient creates a new GetCoordinatesObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCoordinatesObservableOptionsParamsWithHTTPClient(client *http.Client) *GetCoordinatesObservableOptionsParams { + + return &GetCoordinatesObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetCoordinatesObservableOptionsParams contains all the parameters to send to the API endpoint +for the get coordinates observable options operation typically these are written to a http.Request +*/ +type GetCoordinatesObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get coordinates observable options params +func (o *GetCoordinatesObservableOptionsParams) WithTimeout(timeout time.Duration) *GetCoordinatesObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get coordinates observable options params +func (o *GetCoordinatesObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get coordinates observable options params +func (o *GetCoordinatesObservableOptionsParams) WithContext(ctx context.Context) *GetCoordinatesObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get coordinates observable options params +func (o *GetCoordinatesObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get coordinates observable options params +func (o *GetCoordinatesObservableOptionsParams) WithHTTPClient(client *http.Client) *GetCoordinatesObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get coordinates observable options params +func (o *GetCoordinatesObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCoordinatesObservableOptionsParams) 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/geo/geo_client/cors/get_coordinates_observable_options_responses.go b/api/geo/geo_client/cors/get_coordinates_observable_options_responses.go new file mode 100644 index 0000000..d063e17 --- /dev/null +++ b/api/geo/geo_client/cors/get_coordinates_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetCoordinatesObservableOptionsReader is a Reader for the GetCoordinatesObservableOptions structure. +type GetCoordinatesObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCoordinatesObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCoordinatesObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCoordinatesObservableOptionsOK creates a GetCoordinatesObservableOptionsOK with default headers values +func NewGetCoordinatesObservableOptionsOK() *GetCoordinatesObservableOptionsOK { + return &GetCoordinatesObservableOptionsOK{} +} + +/*GetCoordinatesObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetCoordinatesObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetCoordinatesObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /coordinates/observable][%d] getCoordinatesObservableOptionsOK ", 200) +} + +func (o *GetCoordinatesObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_coordinates_options_parameters.go b/api/geo/geo_client/cors/get_coordinates_options_parameters.go new file mode 100644 index 0000000..7e97d5d --- /dev/null +++ b/api/geo/geo_client/cors/get_coordinates_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetCoordinatesOptionsParams creates a new GetCoordinatesOptionsParams object +// with the default values initialized. +func NewGetCoordinatesOptionsParams() *GetCoordinatesOptionsParams { + + return &GetCoordinatesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCoordinatesOptionsParamsWithTimeout creates a new GetCoordinatesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCoordinatesOptionsParamsWithTimeout(timeout time.Duration) *GetCoordinatesOptionsParams { + + return &GetCoordinatesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetCoordinatesOptionsParamsWithContext creates a new GetCoordinatesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCoordinatesOptionsParamsWithContext(ctx context.Context) *GetCoordinatesOptionsParams { + + return &GetCoordinatesOptionsParams{ + + Context: ctx, + } +} + +// NewGetCoordinatesOptionsParamsWithHTTPClient creates a new GetCoordinatesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCoordinatesOptionsParamsWithHTTPClient(client *http.Client) *GetCoordinatesOptionsParams { + + return &GetCoordinatesOptionsParams{ + HTTPClient: client, + } +} + +/*GetCoordinatesOptionsParams contains all the parameters to send to the API endpoint +for the get coordinates options operation typically these are written to a http.Request +*/ +type GetCoordinatesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get coordinates options params +func (o *GetCoordinatesOptionsParams) WithTimeout(timeout time.Duration) *GetCoordinatesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get coordinates options params +func (o *GetCoordinatesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get coordinates options params +func (o *GetCoordinatesOptionsParams) WithContext(ctx context.Context) *GetCoordinatesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get coordinates options params +func (o *GetCoordinatesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get coordinates options params +func (o *GetCoordinatesOptionsParams) WithHTTPClient(client *http.Client) *GetCoordinatesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get coordinates options params +func (o *GetCoordinatesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCoordinatesOptionsParams) 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/geo/geo_client/cors/get_coordinates_options_responses.go b/api/geo/geo_client/cors/get_coordinates_options_responses.go new file mode 100644 index 0000000..afb4dc7 --- /dev/null +++ b/api/geo/geo_client/cors/get_coordinates_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetCoordinatesOptionsReader is a Reader for the GetCoordinatesOptions structure. +type GetCoordinatesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCoordinatesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCoordinatesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCoordinatesOptionsOK creates a GetCoordinatesOptionsOK with default headers values +func NewGetCoordinatesOptionsOK() *GetCoordinatesOptionsOK { + return &GetCoordinatesOptionsOK{} +} + +/*GetCoordinatesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetCoordinatesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetCoordinatesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /coordinates][%d] getCoordinatesOptionsOK ", 200) +} + +func (o *GetCoordinatesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_counties_observable_options_parameters.go b/api/geo/geo_client/cors/get_counties_observable_options_parameters.go new file mode 100644 index 0000000..800c444 --- /dev/null +++ b/api/geo/geo_client/cors/get_counties_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetCountiesObservableOptionsParams creates a new GetCountiesObservableOptionsParams object +// with the default values initialized. +func NewGetCountiesObservableOptionsParams() *GetCountiesObservableOptionsParams { + + return &GetCountiesObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountiesObservableOptionsParamsWithTimeout creates a new GetCountiesObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountiesObservableOptionsParamsWithTimeout(timeout time.Duration) *GetCountiesObservableOptionsParams { + + return &GetCountiesObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetCountiesObservableOptionsParamsWithContext creates a new GetCountiesObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountiesObservableOptionsParamsWithContext(ctx context.Context) *GetCountiesObservableOptionsParams { + + return &GetCountiesObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetCountiesObservableOptionsParamsWithHTTPClient creates a new GetCountiesObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountiesObservableOptionsParamsWithHTTPClient(client *http.Client) *GetCountiesObservableOptionsParams { + + return &GetCountiesObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetCountiesObservableOptionsParams contains all the parameters to send to the API endpoint +for the get counties observable options operation typically these are written to a http.Request +*/ +type GetCountiesObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get counties observable options params +func (o *GetCountiesObservableOptionsParams) WithTimeout(timeout time.Duration) *GetCountiesObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get counties observable options params +func (o *GetCountiesObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get counties observable options params +func (o *GetCountiesObservableOptionsParams) WithContext(ctx context.Context) *GetCountiesObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get counties observable options params +func (o *GetCountiesObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get counties observable options params +func (o *GetCountiesObservableOptionsParams) WithHTTPClient(client *http.Client) *GetCountiesObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get counties observable options params +func (o *GetCountiesObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountiesObservableOptionsParams) 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/geo/geo_client/cors/get_counties_observable_options_responses.go b/api/geo/geo_client/cors/get_counties_observable_options_responses.go new file mode 100644 index 0000000..8e08c61 --- /dev/null +++ b/api/geo/geo_client/cors/get_counties_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetCountiesObservableOptionsReader is a Reader for the GetCountiesObservableOptions structure. +type GetCountiesObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountiesObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountiesObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountiesObservableOptionsOK creates a GetCountiesObservableOptionsOK with default headers values +func NewGetCountiesObservableOptionsOK() *GetCountiesObservableOptionsOK { + return &GetCountiesObservableOptionsOK{} +} + +/*GetCountiesObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetCountiesObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetCountiesObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /counties/observable][%d] getCountiesObservableOptionsOK ", 200) +} + +func (o *GetCountiesObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_counties_options_parameters.go b/api/geo/geo_client/cors/get_counties_options_parameters.go new file mode 100644 index 0000000..faa6072 --- /dev/null +++ b/api/geo/geo_client/cors/get_counties_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetCountiesOptionsParams creates a new GetCountiesOptionsParams object +// with the default values initialized. +func NewGetCountiesOptionsParams() *GetCountiesOptionsParams { + + return &GetCountiesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountiesOptionsParamsWithTimeout creates a new GetCountiesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountiesOptionsParamsWithTimeout(timeout time.Duration) *GetCountiesOptionsParams { + + return &GetCountiesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetCountiesOptionsParamsWithContext creates a new GetCountiesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountiesOptionsParamsWithContext(ctx context.Context) *GetCountiesOptionsParams { + + return &GetCountiesOptionsParams{ + + Context: ctx, + } +} + +// NewGetCountiesOptionsParamsWithHTTPClient creates a new GetCountiesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountiesOptionsParamsWithHTTPClient(client *http.Client) *GetCountiesOptionsParams { + + return &GetCountiesOptionsParams{ + HTTPClient: client, + } +} + +/*GetCountiesOptionsParams contains all the parameters to send to the API endpoint +for the get counties options operation typically these are written to a http.Request +*/ +type GetCountiesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get counties options params +func (o *GetCountiesOptionsParams) WithTimeout(timeout time.Duration) *GetCountiesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get counties options params +func (o *GetCountiesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get counties options params +func (o *GetCountiesOptionsParams) WithContext(ctx context.Context) *GetCountiesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get counties options params +func (o *GetCountiesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get counties options params +func (o *GetCountiesOptionsParams) WithHTTPClient(client *http.Client) *GetCountiesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get counties options params +func (o *GetCountiesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountiesOptionsParams) 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/geo/geo_client/cors/get_counties_options_responses.go b/api/geo/geo_client/cors/get_counties_options_responses.go new file mode 100644 index 0000000..48ac60c --- /dev/null +++ b/api/geo/geo_client/cors/get_counties_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetCountiesOptionsReader is a Reader for the GetCountiesOptions structure. +type GetCountiesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountiesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountiesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountiesOptionsOK creates a GetCountiesOptionsOK with default headers values +func NewGetCountiesOptionsOK() *GetCountiesOptionsOK { + return &GetCountiesOptionsOK{} +} + +/*GetCountiesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetCountiesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetCountiesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /counties][%d] getCountiesOptionsOK ", 200) +} + +func (o *GetCountiesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_countries_observable_options_parameters.go b/api/geo/geo_client/cors/get_countries_observable_options_parameters.go new file mode 100644 index 0000000..da77e0c --- /dev/null +++ b/api/geo/geo_client/cors/get_countries_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetCountriesObservableOptionsParams creates a new GetCountriesObservableOptionsParams object +// with the default values initialized. +func NewGetCountriesObservableOptionsParams() *GetCountriesObservableOptionsParams { + + return &GetCountriesObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountriesObservableOptionsParamsWithTimeout creates a new GetCountriesObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountriesObservableOptionsParamsWithTimeout(timeout time.Duration) *GetCountriesObservableOptionsParams { + + return &GetCountriesObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetCountriesObservableOptionsParamsWithContext creates a new GetCountriesObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountriesObservableOptionsParamsWithContext(ctx context.Context) *GetCountriesObservableOptionsParams { + + return &GetCountriesObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetCountriesObservableOptionsParamsWithHTTPClient creates a new GetCountriesObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountriesObservableOptionsParamsWithHTTPClient(client *http.Client) *GetCountriesObservableOptionsParams { + + return &GetCountriesObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetCountriesObservableOptionsParams contains all the parameters to send to the API endpoint +for the get countries observable options operation typically these are written to a http.Request +*/ +type GetCountriesObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get countries observable options params +func (o *GetCountriesObservableOptionsParams) WithTimeout(timeout time.Duration) *GetCountriesObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get countries observable options params +func (o *GetCountriesObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get countries observable options params +func (o *GetCountriesObservableOptionsParams) WithContext(ctx context.Context) *GetCountriesObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get countries observable options params +func (o *GetCountriesObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get countries observable options params +func (o *GetCountriesObservableOptionsParams) WithHTTPClient(client *http.Client) *GetCountriesObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get countries observable options params +func (o *GetCountriesObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountriesObservableOptionsParams) 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/geo/geo_client/cors/get_countries_observable_options_responses.go b/api/geo/geo_client/cors/get_countries_observable_options_responses.go new file mode 100644 index 0000000..0703a40 --- /dev/null +++ b/api/geo/geo_client/cors/get_countries_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetCountriesObservableOptionsReader is a Reader for the GetCountriesObservableOptions structure. +type GetCountriesObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountriesObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountriesObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountriesObservableOptionsOK creates a GetCountriesObservableOptionsOK with default headers values +func NewGetCountriesObservableOptionsOK() *GetCountriesObservableOptionsOK { + return &GetCountriesObservableOptionsOK{} +} + +/*GetCountriesObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetCountriesObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetCountriesObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /countries/observable][%d] getCountriesObservableOptionsOK ", 200) +} + +func (o *GetCountriesObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_countries_options_parameters.go b/api/geo/geo_client/cors/get_countries_options_parameters.go new file mode 100644 index 0000000..5451a90 --- /dev/null +++ b/api/geo/geo_client/cors/get_countries_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetCountriesOptionsParams creates a new GetCountriesOptionsParams object +// with the default values initialized. +func NewGetCountriesOptionsParams() *GetCountriesOptionsParams { + + return &GetCountriesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountriesOptionsParamsWithTimeout creates a new GetCountriesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountriesOptionsParamsWithTimeout(timeout time.Duration) *GetCountriesOptionsParams { + + return &GetCountriesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetCountriesOptionsParamsWithContext creates a new GetCountriesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountriesOptionsParamsWithContext(ctx context.Context) *GetCountriesOptionsParams { + + return &GetCountriesOptionsParams{ + + Context: ctx, + } +} + +// NewGetCountriesOptionsParamsWithHTTPClient creates a new GetCountriesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountriesOptionsParamsWithHTTPClient(client *http.Client) *GetCountriesOptionsParams { + + return &GetCountriesOptionsParams{ + HTTPClient: client, + } +} + +/*GetCountriesOptionsParams contains all the parameters to send to the API endpoint +for the get countries options operation typically these are written to a http.Request +*/ +type GetCountriesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get countries options params +func (o *GetCountriesOptionsParams) WithTimeout(timeout time.Duration) *GetCountriesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get countries options params +func (o *GetCountriesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get countries options params +func (o *GetCountriesOptionsParams) WithContext(ctx context.Context) *GetCountriesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get countries options params +func (o *GetCountriesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get countries options params +func (o *GetCountriesOptionsParams) WithHTTPClient(client *http.Client) *GetCountriesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get countries options params +func (o *GetCountriesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountriesOptionsParams) 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/geo/geo_client/cors/get_countries_options_responses.go b/api/geo/geo_client/cors/get_countries_options_responses.go new file mode 100644 index 0000000..0bc630f --- /dev/null +++ b/api/geo/geo_client/cors/get_countries_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetCountriesOptionsReader is a Reader for the GetCountriesOptions structure. +type GetCountriesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountriesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountriesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountriesOptionsOK creates a GetCountriesOptionsOK with default headers values +func NewGetCountriesOptionsOK() *GetCountriesOptionsOK { + return &GetCountriesOptionsOK{} +} + +/*GetCountriesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetCountriesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetCountriesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /countries][%d] getCountriesOptionsOK ", 200) +} + +func (o *GetCountriesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_domains_observable_options_parameters.go b/api/geo/geo_client/cors/get_domains_observable_options_parameters.go new file mode 100644 index 0000000..b3e139a --- /dev/null +++ b/api/geo/geo_client/cors/get_domains_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetDomainsObservableOptionsParams creates a new GetDomainsObservableOptionsParams object +// with the default values initialized. +func NewGetDomainsObservableOptionsParams() *GetDomainsObservableOptionsParams { + + return &GetDomainsObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDomainsObservableOptionsParamsWithTimeout creates a new GetDomainsObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDomainsObservableOptionsParamsWithTimeout(timeout time.Duration) *GetDomainsObservableOptionsParams { + + return &GetDomainsObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetDomainsObservableOptionsParamsWithContext creates a new GetDomainsObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDomainsObservableOptionsParamsWithContext(ctx context.Context) *GetDomainsObservableOptionsParams { + + return &GetDomainsObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetDomainsObservableOptionsParamsWithHTTPClient creates a new GetDomainsObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDomainsObservableOptionsParamsWithHTTPClient(client *http.Client) *GetDomainsObservableOptionsParams { + + return &GetDomainsObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetDomainsObservableOptionsParams contains all the parameters to send to the API endpoint +for the get domains observable options operation typically these are written to a http.Request +*/ +type GetDomainsObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get domains observable options params +func (o *GetDomainsObservableOptionsParams) WithTimeout(timeout time.Duration) *GetDomainsObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get domains observable options params +func (o *GetDomainsObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get domains observable options params +func (o *GetDomainsObservableOptionsParams) WithContext(ctx context.Context) *GetDomainsObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get domains observable options params +func (o *GetDomainsObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get domains observable options params +func (o *GetDomainsObservableOptionsParams) WithHTTPClient(client *http.Client) *GetDomainsObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get domains observable options params +func (o *GetDomainsObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDomainsObservableOptionsParams) 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/geo/geo_client/cors/get_domains_observable_options_responses.go b/api/geo/geo_client/cors/get_domains_observable_options_responses.go new file mode 100644 index 0000000..25fdf87 --- /dev/null +++ b/api/geo/geo_client/cors/get_domains_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetDomainsObservableOptionsReader is a Reader for the GetDomainsObservableOptions structure. +type GetDomainsObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDomainsObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDomainsObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetDomainsObservableOptionsOK creates a GetDomainsObservableOptionsOK with default headers values +func NewGetDomainsObservableOptionsOK() *GetDomainsObservableOptionsOK { + return &GetDomainsObservableOptionsOK{} +} + +/*GetDomainsObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetDomainsObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetDomainsObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /domains/observable][%d] getDomainsObservableOptionsOK ", 200) +} + +func (o *GetDomainsObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_domains_options_parameters.go b/api/geo/geo_client/cors/get_domains_options_parameters.go new file mode 100644 index 0000000..a30132b --- /dev/null +++ b/api/geo/geo_client/cors/get_domains_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetDomainsOptionsParams creates a new GetDomainsOptionsParams object +// with the default values initialized. +func NewGetDomainsOptionsParams() *GetDomainsOptionsParams { + + return &GetDomainsOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDomainsOptionsParamsWithTimeout creates a new GetDomainsOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDomainsOptionsParamsWithTimeout(timeout time.Duration) *GetDomainsOptionsParams { + + return &GetDomainsOptionsParams{ + + timeout: timeout, + } +} + +// NewGetDomainsOptionsParamsWithContext creates a new GetDomainsOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDomainsOptionsParamsWithContext(ctx context.Context) *GetDomainsOptionsParams { + + return &GetDomainsOptionsParams{ + + Context: ctx, + } +} + +// NewGetDomainsOptionsParamsWithHTTPClient creates a new GetDomainsOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDomainsOptionsParamsWithHTTPClient(client *http.Client) *GetDomainsOptionsParams { + + return &GetDomainsOptionsParams{ + HTTPClient: client, + } +} + +/*GetDomainsOptionsParams contains all the parameters to send to the API endpoint +for the get domains options operation typically these are written to a http.Request +*/ +type GetDomainsOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get domains options params +func (o *GetDomainsOptionsParams) WithTimeout(timeout time.Duration) *GetDomainsOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get domains options params +func (o *GetDomainsOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get domains options params +func (o *GetDomainsOptionsParams) WithContext(ctx context.Context) *GetDomainsOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get domains options params +func (o *GetDomainsOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get domains options params +func (o *GetDomainsOptionsParams) WithHTTPClient(client *http.Client) *GetDomainsOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get domains options params +func (o *GetDomainsOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDomainsOptionsParams) 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/geo/geo_client/cors/get_domains_options_responses.go b/api/geo/geo_client/cors/get_domains_options_responses.go new file mode 100644 index 0000000..93fb3fe --- /dev/null +++ b/api/geo/geo_client/cors/get_domains_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetDomainsOptionsReader is a Reader for the GetDomainsOptions structure. +type GetDomainsOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDomainsOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDomainsOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetDomainsOptionsOK creates a GetDomainsOptionsOK with default headers values +func NewGetDomainsOptionsOK() *GetDomainsOptionsOK { + return &GetDomainsOptionsOK{} +} + +/*GetDomainsOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetDomainsOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetDomainsOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /domains][%d] getDomainsOptionsOK ", 200) +} + +func (o *GetDomainsOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_places_observable_options_parameters.go b/api/geo/geo_client/cors/get_places_observable_options_parameters.go new file mode 100644 index 0000000..7e99b51 --- /dev/null +++ b/api/geo/geo_client/cors/get_places_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetPlacesObservableOptionsParams creates a new GetPlacesObservableOptionsParams object +// with the default values initialized. +func NewGetPlacesObservableOptionsParams() *GetPlacesObservableOptionsParams { + + return &GetPlacesObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlacesObservableOptionsParamsWithTimeout creates a new GetPlacesObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlacesObservableOptionsParamsWithTimeout(timeout time.Duration) *GetPlacesObservableOptionsParams { + + return &GetPlacesObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetPlacesObservableOptionsParamsWithContext creates a new GetPlacesObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlacesObservableOptionsParamsWithContext(ctx context.Context) *GetPlacesObservableOptionsParams { + + return &GetPlacesObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetPlacesObservableOptionsParamsWithHTTPClient creates a new GetPlacesObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlacesObservableOptionsParamsWithHTTPClient(client *http.Client) *GetPlacesObservableOptionsParams { + + return &GetPlacesObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetPlacesObservableOptionsParams contains all the parameters to send to the API endpoint +for the get places observable options operation typically these are written to a http.Request +*/ +type GetPlacesObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get places observable options params +func (o *GetPlacesObservableOptionsParams) WithTimeout(timeout time.Duration) *GetPlacesObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get places observable options params +func (o *GetPlacesObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get places observable options params +func (o *GetPlacesObservableOptionsParams) WithContext(ctx context.Context) *GetPlacesObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get places observable options params +func (o *GetPlacesObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get places observable options params +func (o *GetPlacesObservableOptionsParams) WithHTTPClient(client *http.Client) *GetPlacesObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get places observable options params +func (o *GetPlacesObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlacesObservableOptionsParams) 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/geo/geo_client/cors/get_places_observable_options_responses.go b/api/geo/geo_client/cors/get_places_observable_options_responses.go new file mode 100644 index 0000000..bf75116 --- /dev/null +++ b/api/geo/geo_client/cors/get_places_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetPlacesObservableOptionsReader is a Reader for the GetPlacesObservableOptions structure. +type GetPlacesObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlacesObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlacesObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlacesObservableOptionsOK creates a GetPlacesObservableOptionsOK with default headers values +func NewGetPlacesObservableOptionsOK() *GetPlacesObservableOptionsOK { + return &GetPlacesObservableOptionsOK{} +} + +/*GetPlacesObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetPlacesObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetPlacesObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /places/observable][%d] getPlacesObservableOptionsOK ", 200) +} + +func (o *GetPlacesObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_places_options_parameters.go b/api/geo/geo_client/cors/get_places_options_parameters.go new file mode 100644 index 0000000..647f1a4 --- /dev/null +++ b/api/geo/geo_client/cors/get_places_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetPlacesOptionsParams creates a new GetPlacesOptionsParams object +// with the default values initialized. +func NewGetPlacesOptionsParams() *GetPlacesOptionsParams { + + return &GetPlacesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlacesOptionsParamsWithTimeout creates a new GetPlacesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlacesOptionsParamsWithTimeout(timeout time.Duration) *GetPlacesOptionsParams { + + return &GetPlacesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetPlacesOptionsParamsWithContext creates a new GetPlacesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlacesOptionsParamsWithContext(ctx context.Context) *GetPlacesOptionsParams { + + return &GetPlacesOptionsParams{ + + Context: ctx, + } +} + +// NewGetPlacesOptionsParamsWithHTTPClient creates a new GetPlacesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlacesOptionsParamsWithHTTPClient(client *http.Client) *GetPlacesOptionsParams { + + return &GetPlacesOptionsParams{ + HTTPClient: client, + } +} + +/*GetPlacesOptionsParams contains all the parameters to send to the API endpoint +for the get places options operation typically these are written to a http.Request +*/ +type GetPlacesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get places options params +func (o *GetPlacesOptionsParams) WithTimeout(timeout time.Duration) *GetPlacesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get places options params +func (o *GetPlacesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get places options params +func (o *GetPlacesOptionsParams) WithContext(ctx context.Context) *GetPlacesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get places options params +func (o *GetPlacesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get places options params +func (o *GetPlacesOptionsParams) WithHTTPClient(client *http.Client) *GetPlacesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get places options params +func (o *GetPlacesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlacesOptionsParams) 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/geo/geo_client/cors/get_places_options_responses.go b/api/geo/geo_client/cors/get_places_options_responses.go new file mode 100644 index 0000000..2553d55 --- /dev/null +++ b/api/geo/geo_client/cors/get_places_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetPlacesOptionsReader is a Reader for the GetPlacesOptions structure. +type GetPlacesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlacesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlacesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlacesOptionsOK creates a GetPlacesOptionsOK with default headers values +func NewGetPlacesOptionsOK() *GetPlacesOptionsOK { + return &GetPlacesOptionsOK{} +} + +/*GetPlacesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetPlacesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetPlacesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /places][%d] getPlacesOptionsOK ", 200) +} + +func (o *GetPlacesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_states_observable_options_parameters.go b/api/geo/geo_client/cors/get_states_observable_options_parameters.go new file mode 100644 index 0000000..38a8d65 --- /dev/null +++ b/api/geo/geo_client/cors/get_states_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetStatesObservableOptionsParams creates a new GetStatesObservableOptionsParams object +// with the default values initialized. +func NewGetStatesObservableOptionsParams() *GetStatesObservableOptionsParams { + + return &GetStatesObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetStatesObservableOptionsParamsWithTimeout creates a new GetStatesObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetStatesObservableOptionsParamsWithTimeout(timeout time.Duration) *GetStatesObservableOptionsParams { + + return &GetStatesObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetStatesObservableOptionsParamsWithContext creates a new GetStatesObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetStatesObservableOptionsParamsWithContext(ctx context.Context) *GetStatesObservableOptionsParams { + + return &GetStatesObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetStatesObservableOptionsParamsWithHTTPClient creates a new GetStatesObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetStatesObservableOptionsParamsWithHTTPClient(client *http.Client) *GetStatesObservableOptionsParams { + + return &GetStatesObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetStatesObservableOptionsParams contains all the parameters to send to the API endpoint +for the get states observable options operation typically these are written to a http.Request +*/ +type GetStatesObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get states observable options params +func (o *GetStatesObservableOptionsParams) WithTimeout(timeout time.Duration) *GetStatesObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get states observable options params +func (o *GetStatesObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get states observable options params +func (o *GetStatesObservableOptionsParams) WithContext(ctx context.Context) *GetStatesObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get states observable options params +func (o *GetStatesObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get states observable options params +func (o *GetStatesObservableOptionsParams) WithHTTPClient(client *http.Client) *GetStatesObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get states observable options params +func (o *GetStatesObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStatesObservableOptionsParams) 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/geo/geo_client/cors/get_states_observable_options_responses.go b/api/geo/geo_client/cors/get_states_observable_options_responses.go new file mode 100644 index 0000000..a49dbec --- /dev/null +++ b/api/geo/geo_client/cors/get_states_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetStatesObservableOptionsReader is a Reader for the GetStatesObservableOptions structure. +type GetStatesObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStatesObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStatesObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetStatesObservableOptionsOK creates a GetStatesObservableOptionsOK with default headers values +func NewGetStatesObservableOptionsOK() *GetStatesObservableOptionsOK { + return &GetStatesObservableOptionsOK{} +} + +/*GetStatesObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetStatesObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetStatesObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /states/observable][%d] getStatesObservableOptionsOK ", 200) +} + +func (o *GetStatesObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_states_options_parameters.go b/api/geo/geo_client/cors/get_states_options_parameters.go new file mode 100644 index 0000000..8a279d4 --- /dev/null +++ b/api/geo/geo_client/cors/get_states_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetStatesOptionsParams creates a new GetStatesOptionsParams object +// with the default values initialized. +func NewGetStatesOptionsParams() *GetStatesOptionsParams { + + return &GetStatesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetStatesOptionsParamsWithTimeout creates a new GetStatesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetStatesOptionsParamsWithTimeout(timeout time.Duration) *GetStatesOptionsParams { + + return &GetStatesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetStatesOptionsParamsWithContext creates a new GetStatesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetStatesOptionsParamsWithContext(ctx context.Context) *GetStatesOptionsParams { + + return &GetStatesOptionsParams{ + + Context: ctx, + } +} + +// NewGetStatesOptionsParamsWithHTTPClient creates a new GetStatesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetStatesOptionsParamsWithHTTPClient(client *http.Client) *GetStatesOptionsParams { + + return &GetStatesOptionsParams{ + HTTPClient: client, + } +} + +/*GetStatesOptionsParams contains all the parameters to send to the API endpoint +for the get states options operation typically these are written to a http.Request +*/ +type GetStatesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get states options params +func (o *GetStatesOptionsParams) WithTimeout(timeout time.Duration) *GetStatesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get states options params +func (o *GetStatesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get states options params +func (o *GetStatesOptionsParams) WithContext(ctx context.Context) *GetStatesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get states options params +func (o *GetStatesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get states options params +func (o *GetStatesOptionsParams) WithHTTPClient(client *http.Client) *GetStatesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get states options params +func (o *GetStatesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStatesOptionsParams) 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/geo/geo_client/cors/get_states_options_responses.go b/api/geo/geo_client/cors/get_states_options_responses.go new file mode 100644 index 0000000..bae13a0 --- /dev/null +++ b/api/geo/geo_client/cors/get_states_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetStatesOptionsReader is a Reader for the GetStatesOptions structure. +type GetStatesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStatesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStatesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetStatesOptionsOK creates a GetStatesOptionsOK with default headers values +func NewGetStatesOptionsOK() *GetStatesOptionsOK { + return &GetStatesOptionsOK{} +} + +/*GetStatesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetStatesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetStatesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /states][%d] getStatesOptionsOK ", 200) +} + +func (o *GetStatesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_tax_rate_observable_options_parameters.go b/api/geo/geo_client/cors/get_tax_rate_observable_options_parameters.go new file mode 100644 index 0000000..1f97df9 --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_rate_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetTaxRateObservableOptionsParams creates a new GetTaxRateObservableOptionsParams object +// with the default values initialized. +func NewGetTaxRateObservableOptionsParams() *GetTaxRateObservableOptionsParams { + + return &GetTaxRateObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxRateObservableOptionsParamsWithTimeout creates a new GetTaxRateObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxRateObservableOptionsParamsWithTimeout(timeout time.Duration) *GetTaxRateObservableOptionsParams { + + return &GetTaxRateObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetTaxRateObservableOptionsParamsWithContext creates a new GetTaxRateObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxRateObservableOptionsParamsWithContext(ctx context.Context) *GetTaxRateObservableOptionsParams { + + return &GetTaxRateObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetTaxRateObservableOptionsParamsWithHTTPClient creates a new GetTaxRateObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxRateObservableOptionsParamsWithHTTPClient(client *http.Client) *GetTaxRateObservableOptionsParams { + + return &GetTaxRateObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetTaxRateObservableOptionsParams contains all the parameters to send to the API endpoint +for the get tax rate observable options operation typically these are written to a http.Request +*/ +type GetTaxRateObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax rate observable options params +func (o *GetTaxRateObservableOptionsParams) WithTimeout(timeout time.Duration) *GetTaxRateObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax rate observable options params +func (o *GetTaxRateObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax rate observable options params +func (o *GetTaxRateObservableOptionsParams) WithContext(ctx context.Context) *GetTaxRateObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax rate observable options params +func (o *GetTaxRateObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax rate observable options params +func (o *GetTaxRateObservableOptionsParams) WithHTTPClient(client *http.Client) *GetTaxRateObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax rate observable options params +func (o *GetTaxRateObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxRateObservableOptionsParams) 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/geo/geo_client/cors/get_tax_rate_observable_options_responses.go b/api/geo/geo_client/cors/get_tax_rate_observable_options_responses.go new file mode 100644 index 0000000..71e2b9c --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_rate_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetTaxRateObservableOptionsReader is a Reader for the GetTaxRateObservableOptions structure. +type GetTaxRateObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxRateObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxRateObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxRateObservableOptionsOK creates a GetTaxRateObservableOptionsOK with default headers values +func NewGetTaxRateObservableOptionsOK() *GetTaxRateObservableOptionsOK { + return &GetTaxRateObservableOptionsOK{} +} + +/*GetTaxRateObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetTaxRateObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetTaxRateObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxrates/observable][%d] getTaxRateObservableOptionsOK ", 200) +} + +func (o *GetTaxRateObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_tax_rates_options_parameters.go b/api/geo/geo_client/cors/get_tax_rates_options_parameters.go new file mode 100644 index 0000000..187f84a --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_rates_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetTaxRatesOptionsParams creates a new GetTaxRatesOptionsParams object +// with the default values initialized. +func NewGetTaxRatesOptionsParams() *GetTaxRatesOptionsParams { + + return &GetTaxRatesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxRatesOptionsParamsWithTimeout creates a new GetTaxRatesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxRatesOptionsParamsWithTimeout(timeout time.Duration) *GetTaxRatesOptionsParams { + + return &GetTaxRatesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetTaxRatesOptionsParamsWithContext creates a new GetTaxRatesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxRatesOptionsParamsWithContext(ctx context.Context) *GetTaxRatesOptionsParams { + + return &GetTaxRatesOptionsParams{ + + Context: ctx, + } +} + +// NewGetTaxRatesOptionsParamsWithHTTPClient creates a new GetTaxRatesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxRatesOptionsParamsWithHTTPClient(client *http.Client) *GetTaxRatesOptionsParams { + + return &GetTaxRatesOptionsParams{ + HTTPClient: client, + } +} + +/*GetTaxRatesOptionsParams contains all the parameters to send to the API endpoint +for the get tax rates options operation typically these are written to a http.Request +*/ +type GetTaxRatesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax rates options params +func (o *GetTaxRatesOptionsParams) WithTimeout(timeout time.Duration) *GetTaxRatesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax rates options params +func (o *GetTaxRatesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax rates options params +func (o *GetTaxRatesOptionsParams) WithContext(ctx context.Context) *GetTaxRatesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax rates options params +func (o *GetTaxRatesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax rates options params +func (o *GetTaxRatesOptionsParams) WithHTTPClient(client *http.Client) *GetTaxRatesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax rates options params +func (o *GetTaxRatesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxRatesOptionsParams) 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/geo/geo_client/cors/get_tax_rates_options_responses.go b/api/geo/geo_client/cors/get_tax_rates_options_responses.go new file mode 100644 index 0000000..29b73fc --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_rates_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetTaxRatesOptionsReader is a Reader for the GetTaxRatesOptions structure. +type GetTaxRatesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxRatesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxRatesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxRatesOptionsOK creates a GetTaxRatesOptionsOK with default headers values +func NewGetTaxRatesOptionsOK() *GetTaxRatesOptionsOK { + return &GetTaxRatesOptionsOK{} +} + +/*GetTaxRatesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetTaxRatesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetTaxRatesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxrates][%d] getTaxRatesOptionsOK ", 200) +} + +func (o *GetTaxRatesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_tax_type_observable_options_parameters.go b/api/geo/geo_client/cors/get_tax_type_observable_options_parameters.go new file mode 100644 index 0000000..fa9f38b --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_type_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetTaxTypeObservableOptionsParams creates a new GetTaxTypeObservableOptionsParams object +// with the default values initialized. +func NewGetTaxTypeObservableOptionsParams() *GetTaxTypeObservableOptionsParams { + + return &GetTaxTypeObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxTypeObservableOptionsParamsWithTimeout creates a new GetTaxTypeObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxTypeObservableOptionsParamsWithTimeout(timeout time.Duration) *GetTaxTypeObservableOptionsParams { + + return &GetTaxTypeObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetTaxTypeObservableOptionsParamsWithContext creates a new GetTaxTypeObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxTypeObservableOptionsParamsWithContext(ctx context.Context) *GetTaxTypeObservableOptionsParams { + + return &GetTaxTypeObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetTaxTypeObservableOptionsParamsWithHTTPClient creates a new GetTaxTypeObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxTypeObservableOptionsParamsWithHTTPClient(client *http.Client) *GetTaxTypeObservableOptionsParams { + + return &GetTaxTypeObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetTaxTypeObservableOptionsParams contains all the parameters to send to the API endpoint +for the get tax type observable options operation typically these are written to a http.Request +*/ +type GetTaxTypeObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax type observable options params +func (o *GetTaxTypeObservableOptionsParams) WithTimeout(timeout time.Duration) *GetTaxTypeObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax type observable options params +func (o *GetTaxTypeObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax type observable options params +func (o *GetTaxTypeObservableOptionsParams) WithContext(ctx context.Context) *GetTaxTypeObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax type observable options params +func (o *GetTaxTypeObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax type observable options params +func (o *GetTaxTypeObservableOptionsParams) WithHTTPClient(client *http.Client) *GetTaxTypeObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax type observable options params +func (o *GetTaxTypeObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxTypeObservableOptionsParams) 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/geo/geo_client/cors/get_tax_type_observable_options_responses.go b/api/geo/geo_client/cors/get_tax_type_observable_options_responses.go new file mode 100644 index 0000000..569e922 --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_type_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetTaxTypeObservableOptionsReader is a Reader for the GetTaxTypeObservableOptions structure. +type GetTaxTypeObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxTypeObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxTypeObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxTypeObservableOptionsOK creates a GetTaxTypeObservableOptionsOK with default headers values +func NewGetTaxTypeObservableOptionsOK() *GetTaxTypeObservableOptionsOK { + return &GetTaxTypeObservableOptionsOK{} +} + +/*GetTaxTypeObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetTaxTypeObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetTaxTypeObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxtypes/observable][%d] getTaxTypeObservableOptionsOK ", 200) +} + +func (o *GetTaxTypeObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_tax_types_options_parameters.go b/api/geo/geo_client/cors/get_tax_types_options_parameters.go new file mode 100644 index 0000000..1a49f02 --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_types_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetTaxTypesOptionsParams creates a new GetTaxTypesOptionsParams object +// with the default values initialized. +func NewGetTaxTypesOptionsParams() *GetTaxTypesOptionsParams { + + return &GetTaxTypesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxTypesOptionsParamsWithTimeout creates a new GetTaxTypesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxTypesOptionsParamsWithTimeout(timeout time.Duration) *GetTaxTypesOptionsParams { + + return &GetTaxTypesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetTaxTypesOptionsParamsWithContext creates a new GetTaxTypesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxTypesOptionsParamsWithContext(ctx context.Context) *GetTaxTypesOptionsParams { + + return &GetTaxTypesOptionsParams{ + + Context: ctx, + } +} + +// NewGetTaxTypesOptionsParamsWithHTTPClient creates a new GetTaxTypesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxTypesOptionsParamsWithHTTPClient(client *http.Client) *GetTaxTypesOptionsParams { + + return &GetTaxTypesOptionsParams{ + HTTPClient: client, + } +} + +/*GetTaxTypesOptionsParams contains all the parameters to send to the API endpoint +for the get tax types options operation typically these are written to a http.Request +*/ +type GetTaxTypesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax types options params +func (o *GetTaxTypesOptionsParams) WithTimeout(timeout time.Duration) *GetTaxTypesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax types options params +func (o *GetTaxTypesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax types options params +func (o *GetTaxTypesOptionsParams) WithContext(ctx context.Context) *GetTaxTypesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax types options params +func (o *GetTaxTypesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax types options params +func (o *GetTaxTypesOptionsParams) WithHTTPClient(client *http.Client) *GetTaxTypesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax types options params +func (o *GetTaxTypesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxTypesOptionsParams) 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/geo/geo_client/cors/get_tax_types_options_responses.go b/api/geo/geo_client/cors/get_tax_types_options_responses.go new file mode 100644 index 0000000..d1ecf68 --- /dev/null +++ b/api/geo/geo_client/cors/get_tax_types_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetTaxTypesOptionsReader is a Reader for the GetTaxTypesOptions structure. +type GetTaxTypesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxTypesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxTypesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxTypesOptionsOK creates a GetTaxTypesOptionsOK with default headers values +func NewGetTaxTypesOptionsOK() *GetTaxTypesOptionsOK { + return &GetTaxTypesOptionsOK{} +} + +/*GetTaxTypesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetTaxTypesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetTaxTypesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxtypes][%d] getTaxTypesOptionsOK ", 200) +} + +func (o *GetTaxTypesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_taxnexus_codes_observable_options_parameters.go b/api/geo/geo_client/cors/get_taxnexus_codes_observable_options_parameters.go new file mode 100644 index 0000000..4184b54 --- /dev/null +++ b/api/geo/geo_client/cors/get_taxnexus_codes_observable_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetTaxnexusCodesObservableOptionsParams creates a new GetTaxnexusCodesObservableOptionsParams object +// with the default values initialized. +func NewGetTaxnexusCodesObservableOptionsParams() *GetTaxnexusCodesObservableOptionsParams { + + return &GetTaxnexusCodesObservableOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxnexusCodesObservableOptionsParamsWithTimeout creates a new GetTaxnexusCodesObservableOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxnexusCodesObservableOptionsParamsWithTimeout(timeout time.Duration) *GetTaxnexusCodesObservableOptionsParams { + + return &GetTaxnexusCodesObservableOptionsParams{ + + timeout: timeout, + } +} + +// NewGetTaxnexusCodesObservableOptionsParamsWithContext creates a new GetTaxnexusCodesObservableOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxnexusCodesObservableOptionsParamsWithContext(ctx context.Context) *GetTaxnexusCodesObservableOptionsParams { + + return &GetTaxnexusCodesObservableOptionsParams{ + + Context: ctx, + } +} + +// NewGetTaxnexusCodesObservableOptionsParamsWithHTTPClient creates a new GetTaxnexusCodesObservableOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxnexusCodesObservableOptionsParamsWithHTTPClient(client *http.Client) *GetTaxnexusCodesObservableOptionsParams { + + return &GetTaxnexusCodesObservableOptionsParams{ + HTTPClient: client, + } +} + +/*GetTaxnexusCodesObservableOptionsParams contains all the parameters to send to the API endpoint +for the get taxnexus codes observable options operation typically these are written to a http.Request +*/ +type GetTaxnexusCodesObservableOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get taxnexus codes observable options params +func (o *GetTaxnexusCodesObservableOptionsParams) WithTimeout(timeout time.Duration) *GetTaxnexusCodesObservableOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get taxnexus codes observable options params +func (o *GetTaxnexusCodesObservableOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get taxnexus codes observable options params +func (o *GetTaxnexusCodesObservableOptionsParams) WithContext(ctx context.Context) *GetTaxnexusCodesObservableOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get taxnexus codes observable options params +func (o *GetTaxnexusCodesObservableOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get taxnexus codes observable options params +func (o *GetTaxnexusCodesObservableOptionsParams) WithHTTPClient(client *http.Client) *GetTaxnexusCodesObservableOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get taxnexus codes observable options params +func (o *GetTaxnexusCodesObservableOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxnexusCodesObservableOptionsParams) 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/geo/geo_client/cors/get_taxnexus_codes_observable_options_responses.go b/api/geo/geo_client/cors/get_taxnexus_codes_observable_options_responses.go new file mode 100644 index 0000000..03006f9 --- /dev/null +++ b/api/geo/geo_client/cors/get_taxnexus_codes_observable_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetTaxnexusCodesObservableOptionsReader is a Reader for the GetTaxnexusCodesObservableOptions structure. +type GetTaxnexusCodesObservableOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxnexusCodesObservableOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxnexusCodesObservableOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxnexusCodesObservableOptionsOK creates a GetTaxnexusCodesObservableOptionsOK with default headers values +func NewGetTaxnexusCodesObservableOptionsOK() *GetTaxnexusCodesObservableOptionsOK { + return &GetTaxnexusCodesObservableOptionsOK{} +} + +/*GetTaxnexusCodesObservableOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetTaxnexusCodesObservableOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetTaxnexusCodesObservableOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxnexuscodes/observable][%d] getTaxnexusCodesObservableOptionsOK ", 200) +} + +func (o *GetTaxnexusCodesObservableOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/cors/get_taxnexus_codes_options_parameters.go b/api/geo/geo_client/cors/get_taxnexus_codes_options_parameters.go new file mode 100644 index 0000000..591b23e --- /dev/null +++ b/api/geo/geo_client/cors/get_taxnexus_codes_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetTaxnexusCodesOptionsParams creates a new GetTaxnexusCodesOptionsParams object +// with the default values initialized. +func NewGetTaxnexusCodesOptionsParams() *GetTaxnexusCodesOptionsParams { + + return &GetTaxnexusCodesOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxnexusCodesOptionsParamsWithTimeout creates a new GetTaxnexusCodesOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxnexusCodesOptionsParamsWithTimeout(timeout time.Duration) *GetTaxnexusCodesOptionsParams { + + return &GetTaxnexusCodesOptionsParams{ + + timeout: timeout, + } +} + +// NewGetTaxnexusCodesOptionsParamsWithContext creates a new GetTaxnexusCodesOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxnexusCodesOptionsParamsWithContext(ctx context.Context) *GetTaxnexusCodesOptionsParams { + + return &GetTaxnexusCodesOptionsParams{ + + Context: ctx, + } +} + +// NewGetTaxnexusCodesOptionsParamsWithHTTPClient creates a new GetTaxnexusCodesOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxnexusCodesOptionsParamsWithHTTPClient(client *http.Client) *GetTaxnexusCodesOptionsParams { + + return &GetTaxnexusCodesOptionsParams{ + HTTPClient: client, + } +} + +/*GetTaxnexusCodesOptionsParams contains all the parameters to send to the API endpoint +for the get taxnexus codes options operation typically these are written to a http.Request +*/ +type GetTaxnexusCodesOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get taxnexus codes options params +func (o *GetTaxnexusCodesOptionsParams) WithTimeout(timeout time.Duration) *GetTaxnexusCodesOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get taxnexus codes options params +func (o *GetTaxnexusCodesOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get taxnexus codes options params +func (o *GetTaxnexusCodesOptionsParams) WithContext(ctx context.Context) *GetTaxnexusCodesOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get taxnexus codes options params +func (o *GetTaxnexusCodesOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get taxnexus codes options params +func (o *GetTaxnexusCodesOptionsParams) WithHTTPClient(client *http.Client) *GetTaxnexusCodesOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get taxnexus codes options params +func (o *GetTaxnexusCodesOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxnexusCodesOptionsParams) 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/geo/geo_client/cors/get_taxnexus_codes_options_responses.go b/api/geo/geo_client/cors/get_taxnexus_codes_options_responses.go new file mode 100644 index 0000000..134659c --- /dev/null +++ b/api/geo/geo_client/cors/get_taxnexus_codes_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// GetTaxnexusCodesOptionsReader is a Reader for the GetTaxnexusCodesOptions structure. +type GetTaxnexusCodesOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxnexusCodesOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxnexusCodesOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxnexusCodesOptionsOK creates a GetTaxnexusCodesOptionsOK with default headers values +func NewGetTaxnexusCodesOptionsOK() *GetTaxnexusCodesOptionsOK { + return &GetTaxnexusCodesOptionsOK{} +} + +/*GetTaxnexusCodesOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type GetTaxnexusCodesOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *GetTaxnexusCodesOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxnexuscodes][%d] getTaxnexusCodesOptionsOK ", 200) +} + +func (o *GetTaxnexusCodesOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/geo/geo_client/country/country_client.go b/api/geo/geo_client/country/country_client.go new file mode 100644 index 0000000..6db9608 --- /dev/null +++ b/api/geo/geo_client/country/country_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package country + +// 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 country API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for country API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCountries(params *GetCountriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountriesOK, error) + + GetCountriesObservable(params *GetCountriesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountriesObservableOK, error) + + PostCountries(params *PostCountriesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCountriesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCountries retrieves countries + + Retrieve Countries, filter with parameters +*/ +func (a *Client) GetCountries(params *GetCountriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountries", + Method: "GET", + PathPattern: "/countries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountriesOK) + 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 getCountries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCountriesObservable gets countries in an observable array + + Returns a country retrieval in a observable array +*/ +func (a *Client) GetCountriesObservable(params *GetCountriesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountriesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountriesObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountriesObservable", + Method: "GET", + PathPattern: "/countries/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountriesObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountriesObservableOK) + 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 getCountriesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCountries stores new countries + + Create New Countries +*/ +func (a *Client) PostCountries(params *PostCountriesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCountriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCountriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCountries", + Method: "POST", + PathPattern: "/countries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCountriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCountriesOK) + 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 postCountries: 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/geo/geo_client/country/get_countries_observable_parameters.go b/api/geo/geo_client/country/get_countries_observable_parameters.go new file mode 100644 index 0000000..dac5621 --- /dev/null +++ b/api/geo/geo_client/country/get_countries_observable_parameters.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package country + +// 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" +) + +// NewGetCountriesObservableParams creates a new GetCountriesObservableParams object +// with the default values initialized. +func NewGetCountriesObservableParams() *GetCountriesObservableParams { + var () + return &GetCountriesObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountriesObservableParamsWithTimeout creates a new GetCountriesObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountriesObservableParamsWithTimeout(timeout time.Duration) *GetCountriesObservableParams { + var () + return &GetCountriesObservableParams{ + + timeout: timeout, + } +} + +// NewGetCountriesObservableParamsWithContext creates a new GetCountriesObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountriesObservableParamsWithContext(ctx context.Context) *GetCountriesObservableParams { + var () + return &GetCountriesObservableParams{ + + Context: ctx, + } +} + +// NewGetCountriesObservableParamsWithHTTPClient creates a new GetCountriesObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountriesObservableParamsWithHTTPClient(client *http.Client) *GetCountriesObservableParams { + var () + return &GetCountriesObservableParams{ + HTTPClient: client, + } +} + +/*GetCountriesObservableParams contains all the parameters to send to the API endpoint +for the get countries observable operation typically these are written to a http.Request +*/ +type GetCountriesObservableParams struct { + + /*CountryCode + The Country abbreviation (2 char) + + */ + CountryCode *string + /*CountryID + The ID of this Object + + */ + CountryID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get countries observable params +func (o *GetCountriesObservableParams) WithTimeout(timeout time.Duration) *GetCountriesObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get countries observable params +func (o *GetCountriesObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get countries observable params +func (o *GetCountriesObservableParams) WithContext(ctx context.Context) *GetCountriesObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get countries observable params +func (o *GetCountriesObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get countries observable params +func (o *GetCountriesObservableParams) WithHTTPClient(client *http.Client) *GetCountriesObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get countries observable params +func (o *GetCountriesObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountryCode adds the countryCode to the get countries observable params +func (o *GetCountriesObservableParams) WithCountryCode(countryCode *string) *GetCountriesObservableParams { + o.SetCountryCode(countryCode) + return o +} + +// SetCountryCode adds the countryCode to the get countries observable params +func (o *GetCountriesObservableParams) SetCountryCode(countryCode *string) { + o.CountryCode = countryCode +} + +// WithCountryID adds the countryID to the get countries observable params +func (o *GetCountriesObservableParams) WithCountryID(countryID *string) *GetCountriesObservableParams { + o.SetCountryID(countryID) + return o +} + +// SetCountryID adds the countryId to the get countries observable params +func (o *GetCountriesObservableParams) SetCountryID(countryID *string) { + o.CountryID = countryID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountriesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountryCode != nil { + + // query param countryCode + var qrCountryCode string + if o.CountryCode != nil { + qrCountryCode = *o.CountryCode + } + qCountryCode := qrCountryCode + if qCountryCode != "" { + if err := r.SetQueryParam("countryCode", qCountryCode); err != nil { + return err + } + } + + } + + if o.CountryID != nil { + + // query param countryId + var qrCountryID string + if o.CountryID != nil { + qrCountryID = *o.CountryID + } + qCountryID := qrCountryID + if qCountryID != "" { + if err := r.SetQueryParam("countryId", qCountryID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/country/get_countries_observable_responses.go b/api/geo/geo_client/country/get_countries_observable_responses.go new file mode 100644 index 0000000..11f18b0 --- /dev/null +++ b/api/geo/geo_client/country/get_countries_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package country + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetCountriesObservableReader is a Reader for the GetCountriesObservable structure. +type GetCountriesObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountriesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountriesObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCountriesObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCountriesObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCountriesObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCountriesObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCountriesObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountriesObservableOK creates a GetCountriesObservableOK with default headers values +func NewGetCountriesObservableOK() *GetCountriesObservableOK { + return &GetCountriesObservableOK{} +} + +/*GetCountriesObservableOK handles this case with default header values. + +Observable array response to a country retrieval +*/ +type GetCountriesObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.Country +} + +func (o *GetCountriesObservableOK) Error() string { + return fmt.Sprintf("[GET /countries/observable][%d] getCountriesObservableOK %+v", 200, o.Payload) +} + +func (o *GetCountriesObservableOK) GetPayload() []*geo_models.Country { + return o.Payload +} + +func (o *GetCountriesObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesObservableUnauthorized creates a GetCountriesObservableUnauthorized with default headers values +func NewGetCountriesObservableUnauthorized() *GetCountriesObservableUnauthorized { + return &GetCountriesObservableUnauthorized{} +} + +/*GetCountriesObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCountriesObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /countries/observable][%d] getCountriesObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCountriesObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesObservableForbidden creates a GetCountriesObservableForbidden with default headers values +func NewGetCountriesObservableForbidden() *GetCountriesObservableForbidden { + return &GetCountriesObservableForbidden{} +} + +/*GetCountriesObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCountriesObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesObservableForbidden) Error() string { + return fmt.Sprintf("[GET /countries/observable][%d] getCountriesObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetCountriesObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesObservableNotFound creates a GetCountriesObservableNotFound with default headers values +func NewGetCountriesObservableNotFound() *GetCountriesObservableNotFound { + return &GetCountriesObservableNotFound{} +} + +/*GetCountriesObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCountriesObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesObservableNotFound) Error() string { + return fmt.Sprintf("[GET /countries/observable][%d] getCountriesObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetCountriesObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesObservableUnprocessableEntity creates a GetCountriesObservableUnprocessableEntity with default headers values +func NewGetCountriesObservableUnprocessableEntity() *GetCountriesObservableUnprocessableEntity { + return &GetCountriesObservableUnprocessableEntity{} +} + +/*GetCountriesObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCountriesObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /countries/observable][%d] getCountriesObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCountriesObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesObservableInternalServerError creates a GetCountriesObservableInternalServerError with default headers values +func NewGetCountriesObservableInternalServerError() *GetCountriesObservableInternalServerError { + return &GetCountriesObservableInternalServerError{} +} + +/*GetCountriesObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCountriesObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /countries/observable][%d] getCountriesObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCountriesObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/country/get_countries_parameters.go b/api/geo/geo_client/country/get_countries_parameters.go new file mode 100644 index 0000000..6334cc5 --- /dev/null +++ b/api/geo/geo_client/country/get_countries_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package country + +// 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" +) + +// NewGetCountriesParams creates a new GetCountriesParams object +// with the default values initialized. +func NewGetCountriesParams() *GetCountriesParams { + var () + return &GetCountriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountriesParamsWithTimeout creates a new GetCountriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountriesParamsWithTimeout(timeout time.Duration) *GetCountriesParams { + var () + return &GetCountriesParams{ + + timeout: timeout, + } +} + +// NewGetCountriesParamsWithContext creates a new GetCountriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountriesParamsWithContext(ctx context.Context) *GetCountriesParams { + var () + return &GetCountriesParams{ + + Context: ctx, + } +} + +// NewGetCountriesParamsWithHTTPClient creates a new GetCountriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountriesParamsWithHTTPClient(client *http.Client) *GetCountriesParams { + var () + return &GetCountriesParams{ + HTTPClient: client, + } +} + +/*GetCountriesParams contains all the parameters to send to the API endpoint +for the get countries operation typically these are written to a http.Request +*/ +type GetCountriesParams struct { + + /*CountryCode + The Country abbreviation (2 char) + + */ + CountryCode *string + /*CountryID + The ID of this Object + + */ + CountryID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get countries params +func (o *GetCountriesParams) WithTimeout(timeout time.Duration) *GetCountriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get countries params +func (o *GetCountriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get countries params +func (o *GetCountriesParams) WithContext(ctx context.Context) *GetCountriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get countries params +func (o *GetCountriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get countries params +func (o *GetCountriesParams) WithHTTPClient(client *http.Client) *GetCountriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get countries params +func (o *GetCountriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountryCode adds the countryCode to the get countries params +func (o *GetCountriesParams) WithCountryCode(countryCode *string) *GetCountriesParams { + o.SetCountryCode(countryCode) + return o +} + +// SetCountryCode adds the countryCode to the get countries params +func (o *GetCountriesParams) SetCountryCode(countryCode *string) { + o.CountryCode = countryCode +} + +// WithCountryID adds the countryID to the get countries params +func (o *GetCountriesParams) WithCountryID(countryID *string) *GetCountriesParams { + o.SetCountryID(countryID) + return o +} + +// SetCountryID adds the countryId to the get countries params +func (o *GetCountriesParams) SetCountryID(countryID *string) { + o.CountryID = countryID +} + +// WithLimit adds the limit to the get countries params +func (o *GetCountriesParams) WithLimit(limit *int64) *GetCountriesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get countries params +func (o *GetCountriesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get countries params +func (o *GetCountriesParams) WithOffset(offset *int64) *GetCountriesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get countries params +func (o *GetCountriesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountryCode != nil { + + // query param countryCode + var qrCountryCode string + if o.CountryCode != nil { + qrCountryCode = *o.CountryCode + } + qCountryCode := qrCountryCode + if qCountryCode != "" { + if err := r.SetQueryParam("countryCode", qCountryCode); err != nil { + return err + } + } + + } + + if o.CountryID != nil { + + // query param countryId + var qrCountryID string + if o.CountryID != nil { + qrCountryID = *o.CountryID + } + qCountryID := qrCountryID + if qCountryID != "" { + if err := r.SetQueryParam("countryId", qCountryID); 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/geo/geo_client/country/get_countries_responses.go b/api/geo/geo_client/country/get_countries_responses.go new file mode 100644 index 0000000..afccf4b --- /dev/null +++ b/api/geo/geo_client/country/get_countries_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package country + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetCountriesReader is a Reader for the GetCountries structure. +type GetCountriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCountriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCountriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCountriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCountriesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCountriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountriesOK creates a GetCountriesOK with default headers values +func NewGetCountriesOK() *GetCountriesOK { + return &GetCountriesOK{} +} + +/*GetCountriesOK handles this case with default header values. + +Taxnexus Response with an array of Country objects +*/ +type GetCountriesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.CountryResponse +} + +func (o *GetCountriesOK) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesOK %+v", 200, o.Payload) +} + +func (o *GetCountriesOK) GetPayload() *geo_models.CountryResponse { + return o.Payload +} + +func (o *GetCountriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.CountryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesUnauthorized creates a GetCountriesUnauthorized with default headers values +func NewGetCountriesUnauthorized() *GetCountriesUnauthorized { + return &GetCountriesUnauthorized{} +} + +/*GetCountriesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCountriesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesUnauthorized) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCountriesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesForbidden creates a GetCountriesForbidden with default headers values +func NewGetCountriesForbidden() *GetCountriesForbidden { + return &GetCountriesForbidden{} +} + +/*GetCountriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCountriesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesForbidden) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesForbidden %+v", 403, o.Payload) +} + +func (o *GetCountriesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesNotFound creates a GetCountriesNotFound with default headers values +func NewGetCountriesNotFound() *GetCountriesNotFound { + return &GetCountriesNotFound{} +} + +/*GetCountriesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCountriesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesNotFound) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesNotFound %+v", 404, o.Payload) +} + +func (o *GetCountriesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesUnprocessableEntity creates a GetCountriesUnprocessableEntity with default headers values +func NewGetCountriesUnprocessableEntity() *GetCountriesUnprocessableEntity { + return &GetCountriesUnprocessableEntity{} +} + +/*GetCountriesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCountriesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCountriesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesInternalServerError creates a GetCountriesInternalServerError with default headers values +func NewGetCountriesInternalServerError() *GetCountriesInternalServerError { + return &GetCountriesInternalServerError{} +} + +/*GetCountriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCountriesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountriesInternalServerError) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCountriesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/country/post_countries_parameters.go b/api/geo/geo_client/country/post_countries_parameters.go new file mode 100644 index 0000000..6626941 --- /dev/null +++ b/api/geo/geo_client/country/post_countries_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package country + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostCountriesParams creates a new PostCountriesParams object +// with the default values initialized. +func NewPostCountriesParams() *PostCountriesParams { + var () + return &PostCountriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCountriesParamsWithTimeout creates a new PostCountriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCountriesParamsWithTimeout(timeout time.Duration) *PostCountriesParams { + var () + return &PostCountriesParams{ + + timeout: timeout, + } +} + +// NewPostCountriesParamsWithContext creates a new PostCountriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCountriesParamsWithContext(ctx context.Context) *PostCountriesParams { + var () + return &PostCountriesParams{ + + Context: ctx, + } +} + +// NewPostCountriesParamsWithHTTPClient creates a new PostCountriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCountriesParamsWithHTTPClient(client *http.Client) *PostCountriesParams { + var () + return &PostCountriesParams{ + HTTPClient: client, + } +} + +/*PostCountriesParams contains all the parameters to send to the API endpoint +for the post countries operation typically these are written to a http.Request +*/ +type PostCountriesParams struct { + + /*CountryRequest*/ + CountryRequest *geo_models.CountryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post countries params +func (o *PostCountriesParams) WithTimeout(timeout time.Duration) *PostCountriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post countries params +func (o *PostCountriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post countries params +func (o *PostCountriesParams) WithContext(ctx context.Context) *PostCountriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post countries params +func (o *PostCountriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post countries params +func (o *PostCountriesParams) WithHTTPClient(client *http.Client) *PostCountriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post countries params +func (o *PostCountriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountryRequest adds the countryRequest to the post countries params +func (o *PostCountriesParams) WithCountryRequest(countryRequest *geo_models.CountryRequest) *PostCountriesParams { + o.SetCountryRequest(countryRequest) + return o +} + +// SetCountryRequest adds the countryRequest to the post countries params +func (o *PostCountriesParams) SetCountryRequest(countryRequest *geo_models.CountryRequest) { + o.CountryRequest = countryRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCountriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountryRequest != nil { + if err := r.SetBodyParam(o.CountryRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/country/post_countries_responses.go b/api/geo/geo_client/country/post_countries_responses.go new file mode 100644 index 0000000..e7a6964 --- /dev/null +++ b/api/geo/geo_client/country/post_countries_responses.go @@ -0,0 +1,259 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package country + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostCountriesReader is a Reader for the PostCountries structure. +type PostCountriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCountriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCountriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCountriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCountriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCountriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCountriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostCountriesOK creates a PostCountriesOK with default headers values +func NewPostCountriesOK() *PostCountriesOK { + return &PostCountriesOK{} +} + +/*PostCountriesOK handles this case with default header values. + +Taxnexus Response with an array of Country objects +*/ +type PostCountriesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.CountryResponse +} + +func (o *PostCountriesOK) Error() string { + return fmt.Sprintf("[POST /countries][%d] postCountriesOK %+v", 200, o.Payload) +} + +func (o *PostCountriesOK) GetPayload() *geo_models.CountryResponse { + return o.Payload +} + +func (o *PostCountriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.CountryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountriesUnauthorized creates a PostCountriesUnauthorized with default headers values +func NewPostCountriesUnauthorized() *PostCountriesUnauthorized { + return &PostCountriesUnauthorized{} +} + +/*PostCountriesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostCountriesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountriesUnauthorized) Error() string { + return fmt.Sprintf("[POST /countries][%d] postCountriesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCountriesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountriesForbidden creates a PostCountriesForbidden with default headers values +func NewPostCountriesForbidden() *PostCountriesForbidden { + return &PostCountriesForbidden{} +} + +/*PostCountriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostCountriesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountriesForbidden) Error() string { + return fmt.Sprintf("[POST /countries][%d] postCountriesForbidden %+v", 403, o.Payload) +} + +func (o *PostCountriesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountriesNotFound creates a PostCountriesNotFound with default headers values +func NewPostCountriesNotFound() *PostCountriesNotFound { + return &PostCountriesNotFound{} +} + +/*PostCountriesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostCountriesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountriesNotFound) Error() string { + return fmt.Sprintf("[POST /countries][%d] postCountriesNotFound %+v", 404, o.Payload) +} + +func (o *PostCountriesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountriesInternalServerError creates a PostCountriesInternalServerError with default headers values +func NewPostCountriesInternalServerError() *PostCountriesInternalServerError { + return &PostCountriesInternalServerError{} +} + +/*PostCountriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostCountriesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountriesInternalServerError) Error() string { + return fmt.Sprintf("[POST /countries][%d] postCountriesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCountriesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/county/county_client.go b/api/geo/geo_client/county/county_client.go new file mode 100644 index 0000000..93ac57d --- /dev/null +++ b/api/geo/geo_client/county/county_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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 county API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for county API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCounties(params *GetCountiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountiesOK, error) + + GetCountiesObservable(params *GetCountiesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountiesObservableOK, error) + + PostCounties(params *PostCountiesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCountiesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCounties retrieves counties + + Retrieve Counties, filter with parameters +*/ +func (a *Client) GetCounties(params *GetCountiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountiesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCounties", + Method: "GET", + PathPattern: "/counties", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountiesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountiesOK) + 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 getCounties: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCountiesObservable gets counties in an observable array + + Returns a county retrieval in a observable array +*/ +func (a *Client) GetCountiesObservable(params *GetCountiesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountiesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountiesObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountiesObservable", + Method: "GET", + PathPattern: "/counties/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountiesObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountiesObservableOK) + 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 getCountiesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCounties stores new counties + + Create New Counties +*/ +func (a *Client) PostCounties(params *PostCountiesParams, authInfo runtime.ClientAuthInfoWriter) (*PostCountiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCountiesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCounties", + Method: "POST", + PathPattern: "/counties", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCountiesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCountiesOK) + 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 postCounties: 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/geo/geo_client/county/get_counties_observable_parameters.go b/api/geo/geo_client/county/get_counties_observable_parameters.go new file mode 100644 index 0000000..052a115 --- /dev/null +++ b/api/geo/geo_client/county/get_counties_observable_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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" +) + +// NewGetCountiesObservableParams creates a new GetCountiesObservableParams object +// with the default values initialized. +func NewGetCountiesObservableParams() *GetCountiesObservableParams { + var () + return &GetCountiesObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountiesObservableParamsWithTimeout creates a new GetCountiesObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountiesObservableParamsWithTimeout(timeout time.Duration) *GetCountiesObservableParams { + var () + return &GetCountiesObservableParams{ + + timeout: timeout, + } +} + +// NewGetCountiesObservableParamsWithContext creates a new GetCountiesObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountiesObservableParamsWithContext(ctx context.Context) *GetCountiesObservableParams { + var () + return &GetCountiesObservableParams{ + + Context: ctx, + } +} + +// NewGetCountiesObservableParamsWithHTTPClient creates a new GetCountiesObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountiesObservableParamsWithHTTPClient(client *http.Client) *GetCountiesObservableParams { + var () + return &GetCountiesObservableParams{ + HTTPClient: client, + } +} + +/*GetCountiesObservableParams contains all the parameters to send to the API endpoint +for the get counties observable operation typically these are written to a http.Request +*/ +type GetCountiesObservableParams struct { + + /*County + The County Name + + */ + County *string + /*CountyID + The ID of this Object + + */ + CountyID *string + /*Geocode + The Geocode of this Place record + + */ + Geocode *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get counties observable params +func (o *GetCountiesObservableParams) WithTimeout(timeout time.Duration) *GetCountiesObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get counties observable params +func (o *GetCountiesObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get counties observable params +func (o *GetCountiesObservableParams) WithContext(ctx context.Context) *GetCountiesObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get counties observable params +func (o *GetCountiesObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get counties observable params +func (o *GetCountiesObservableParams) WithHTTPClient(client *http.Client) *GetCountiesObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get counties observable params +func (o *GetCountiesObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCounty adds the county to the get counties observable params +func (o *GetCountiesObservableParams) WithCounty(county *string) *GetCountiesObservableParams { + o.SetCounty(county) + return o +} + +// SetCounty adds the county to the get counties observable params +func (o *GetCountiesObservableParams) SetCounty(county *string) { + o.County = county +} + +// WithCountyID adds the countyID to the get counties observable params +func (o *GetCountiesObservableParams) WithCountyID(countyID *string) *GetCountiesObservableParams { + o.SetCountyID(countyID) + return o +} + +// SetCountyID adds the countyId to the get counties observable params +func (o *GetCountiesObservableParams) SetCountyID(countyID *string) { + o.CountyID = countyID +} + +// WithGeocode adds the geocode to the get counties observable params +func (o *GetCountiesObservableParams) WithGeocode(geocode *string) *GetCountiesObservableParams { + o.SetGeocode(geocode) + return o +} + +// SetGeocode adds the geocode to the get counties observable params +func (o *GetCountiesObservableParams) SetGeocode(geocode *string) { + o.Geocode = geocode +} + +// WithState adds the state to the get counties observable params +func (o *GetCountiesObservableParams) WithState(state *string) *GetCountiesObservableParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get counties observable params +func (o *GetCountiesObservableParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountiesObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.County != nil { + + // query param county + var qrCounty string + if o.County != nil { + qrCounty = *o.County + } + qCounty := qrCounty + if qCounty != "" { + if err := r.SetQueryParam("county", qCounty); err != nil { + return err + } + } + + } + + if o.CountyID != nil { + + // query param countyId + var qrCountyID string + if o.CountyID != nil { + qrCountyID = *o.CountyID + } + qCountyID := qrCountyID + if qCountyID != "" { + if err := r.SetQueryParam("countyId", qCountyID); err != nil { + return err + } + } + + } + + if o.Geocode != nil { + + // query param geocode + var qrGeocode string + if o.Geocode != nil { + qrGeocode = *o.Geocode + } + qGeocode := qrGeocode + if qGeocode != "" { + if err := r.SetQueryParam("geocode", qGeocode); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/county/get_counties_observable_responses.go b/api/geo/geo_client/county/get_counties_observable_responses.go new file mode 100644 index 0000000..ff9d445 --- /dev/null +++ b/api/geo/geo_client/county/get_counties_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetCountiesObservableReader is a Reader for the GetCountiesObservable structure. +type GetCountiesObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountiesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountiesObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCountiesObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCountiesObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCountiesObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCountiesObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCountiesObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountiesObservableOK creates a GetCountiesObservableOK with default headers values +func NewGetCountiesObservableOK() *GetCountiesObservableOK { + return &GetCountiesObservableOK{} +} + +/*GetCountiesObservableOK handles this case with default header values. + +Observable array response to a county retrieval +*/ +type GetCountiesObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.County +} + +func (o *GetCountiesObservableOK) Error() string { + return fmt.Sprintf("[GET /counties/observable][%d] getCountiesObservableOK %+v", 200, o.Payload) +} + +func (o *GetCountiesObservableOK) GetPayload() []*geo_models.County { + return o.Payload +} + +func (o *GetCountiesObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesObservableUnauthorized creates a GetCountiesObservableUnauthorized with default headers values +func NewGetCountiesObservableUnauthorized() *GetCountiesObservableUnauthorized { + return &GetCountiesObservableUnauthorized{} +} + +/*GetCountiesObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCountiesObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /counties/observable][%d] getCountiesObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCountiesObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesObservableForbidden creates a GetCountiesObservableForbidden with default headers values +func NewGetCountiesObservableForbidden() *GetCountiesObservableForbidden { + return &GetCountiesObservableForbidden{} +} + +/*GetCountiesObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCountiesObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesObservableForbidden) Error() string { + return fmt.Sprintf("[GET /counties/observable][%d] getCountiesObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetCountiesObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesObservableNotFound creates a GetCountiesObservableNotFound with default headers values +func NewGetCountiesObservableNotFound() *GetCountiesObservableNotFound { + return &GetCountiesObservableNotFound{} +} + +/*GetCountiesObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCountiesObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesObservableNotFound) Error() string { + return fmt.Sprintf("[GET /counties/observable][%d] getCountiesObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetCountiesObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesObservableUnprocessableEntity creates a GetCountiesObservableUnprocessableEntity with default headers values +func NewGetCountiesObservableUnprocessableEntity() *GetCountiesObservableUnprocessableEntity { + return &GetCountiesObservableUnprocessableEntity{} +} + +/*GetCountiesObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCountiesObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /counties/observable][%d] getCountiesObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCountiesObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesObservableInternalServerError creates a GetCountiesObservableInternalServerError with default headers values +func NewGetCountiesObservableInternalServerError() *GetCountiesObservableInternalServerError { + return &GetCountiesObservableInternalServerError{} +} + +/*GetCountiesObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCountiesObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /counties/observable][%d] getCountiesObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCountiesObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/county/get_counties_parameters.go b/api/geo/geo_client/county/get_counties_parameters.go new file mode 100644 index 0000000..2cce813 --- /dev/null +++ b/api/geo/geo_client/county/get_counties_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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" +) + +// NewGetCountiesParams creates a new GetCountiesParams object +// with the default values initialized. +func NewGetCountiesParams() *GetCountiesParams { + var () + return &GetCountiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountiesParamsWithTimeout creates a new GetCountiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountiesParamsWithTimeout(timeout time.Duration) *GetCountiesParams { + var () + return &GetCountiesParams{ + + timeout: timeout, + } +} + +// NewGetCountiesParamsWithContext creates a new GetCountiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountiesParamsWithContext(ctx context.Context) *GetCountiesParams { + var () + return &GetCountiesParams{ + + Context: ctx, + } +} + +// NewGetCountiesParamsWithHTTPClient creates a new GetCountiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountiesParamsWithHTTPClient(client *http.Client) *GetCountiesParams { + var () + return &GetCountiesParams{ + HTTPClient: client, + } +} + +/*GetCountiesParams contains all the parameters to send to the API endpoint +for the get counties operation typically these are written to a http.Request +*/ +type GetCountiesParams struct { + + /*County + The County Name + + */ + County *string + /*CountyID + The ID of this Object + + */ + CountyID *string + /*Geocode + The Geocode of this Place record + + */ + Geocode *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*State + The State or Province abbreviation (2 char) + + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get counties params +func (o *GetCountiesParams) WithTimeout(timeout time.Duration) *GetCountiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get counties params +func (o *GetCountiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get counties params +func (o *GetCountiesParams) WithContext(ctx context.Context) *GetCountiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get counties params +func (o *GetCountiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get counties params +func (o *GetCountiesParams) WithHTTPClient(client *http.Client) *GetCountiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get counties params +func (o *GetCountiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCounty adds the county to the get counties params +func (o *GetCountiesParams) WithCounty(county *string) *GetCountiesParams { + o.SetCounty(county) + return o +} + +// SetCounty adds the county to the get counties params +func (o *GetCountiesParams) SetCounty(county *string) { + o.County = county +} + +// WithCountyID adds the countyID to the get counties params +func (o *GetCountiesParams) WithCountyID(countyID *string) *GetCountiesParams { + o.SetCountyID(countyID) + return o +} + +// SetCountyID adds the countyId to the get counties params +func (o *GetCountiesParams) SetCountyID(countyID *string) { + o.CountyID = countyID +} + +// WithGeocode adds the geocode to the get counties params +func (o *GetCountiesParams) WithGeocode(geocode *string) *GetCountiesParams { + o.SetGeocode(geocode) + return o +} + +// SetGeocode adds the geocode to the get counties params +func (o *GetCountiesParams) SetGeocode(geocode *string) { + o.Geocode = geocode +} + +// WithLimit adds the limit to the get counties params +func (o *GetCountiesParams) WithLimit(limit *int64) *GetCountiesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get counties params +func (o *GetCountiesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get counties params +func (o *GetCountiesParams) WithOffset(offset *int64) *GetCountiesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get counties params +func (o *GetCountiesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithState adds the state to the get counties params +func (o *GetCountiesParams) WithState(state *string) *GetCountiesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get counties params +func (o *GetCountiesParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.County != nil { + + // query param county + var qrCounty string + if o.County != nil { + qrCounty = *o.County + } + qCounty := qrCounty + if qCounty != "" { + if err := r.SetQueryParam("county", qCounty); err != nil { + return err + } + } + + } + + if o.CountyID != nil { + + // query param countyId + var qrCountyID string + if o.CountyID != nil { + qrCountyID = *o.CountyID + } + qCountyID := qrCountyID + if qCountyID != "" { + if err := r.SetQueryParam("countyId", qCountyID); err != nil { + return err + } + } + + } + + if o.Geocode != nil { + + // query param geocode + var qrGeocode string + if o.Geocode != nil { + qrGeocode = *o.Geocode + } + qGeocode := qrGeocode + if qGeocode != "" { + if err := r.SetQueryParam("geocode", qGeocode); 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.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/county/get_counties_responses.go b/api/geo/geo_client/county/get_counties_responses.go new file mode 100644 index 0000000..807a04a --- /dev/null +++ b/api/geo/geo_client/county/get_counties_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetCountiesReader is a Reader for the GetCounties structure. +type GetCountiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCountiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCountiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCountiesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCountiesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCountiesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountiesOK creates a GetCountiesOK with default headers values +func NewGetCountiesOK() *GetCountiesOK { + return &GetCountiesOK{} +} + +/*GetCountiesOK handles this case with default header values. + +Taxnexus Response with an array of County objects +*/ +type GetCountiesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.CountyResponse +} + +func (o *GetCountiesOK) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesOK %+v", 200, o.Payload) +} + +func (o *GetCountiesOK) GetPayload() *geo_models.CountyResponse { + return o.Payload +} + +func (o *GetCountiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.CountyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesUnauthorized creates a GetCountiesUnauthorized with default headers values +func NewGetCountiesUnauthorized() *GetCountiesUnauthorized { + return &GetCountiesUnauthorized{} +} + +/*GetCountiesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCountiesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesUnauthorized) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCountiesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesForbidden creates a GetCountiesForbidden with default headers values +func NewGetCountiesForbidden() *GetCountiesForbidden { + return &GetCountiesForbidden{} +} + +/*GetCountiesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCountiesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesForbidden) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesForbidden %+v", 403, o.Payload) +} + +func (o *GetCountiesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesNotFound creates a GetCountiesNotFound with default headers values +func NewGetCountiesNotFound() *GetCountiesNotFound { + return &GetCountiesNotFound{} +} + +/*GetCountiesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCountiesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesNotFound) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesNotFound %+v", 404, o.Payload) +} + +func (o *GetCountiesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesUnprocessableEntity creates a GetCountiesUnprocessableEntity with default headers values +func NewGetCountiesUnprocessableEntity() *GetCountiesUnprocessableEntity { + return &GetCountiesUnprocessableEntity{} +} + +/*GetCountiesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCountiesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCountiesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesInternalServerError creates a GetCountiesInternalServerError with default headers values +func NewGetCountiesInternalServerError() *GetCountiesInternalServerError { + return &GetCountiesInternalServerError{} +} + +/*GetCountiesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCountiesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetCountiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCountiesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetCountiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/county/post_counties_parameters.go b/api/geo/geo_client/county/post_counties_parameters.go new file mode 100644 index 0000000..943af91 --- /dev/null +++ b/api/geo/geo_client/county/post_counties_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostCountiesParams creates a new PostCountiesParams object +// with the default values initialized. +func NewPostCountiesParams() *PostCountiesParams { + var () + return &PostCountiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCountiesParamsWithTimeout creates a new PostCountiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCountiesParamsWithTimeout(timeout time.Duration) *PostCountiesParams { + var () + return &PostCountiesParams{ + + timeout: timeout, + } +} + +// NewPostCountiesParamsWithContext creates a new PostCountiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCountiesParamsWithContext(ctx context.Context) *PostCountiesParams { + var () + return &PostCountiesParams{ + + Context: ctx, + } +} + +// NewPostCountiesParamsWithHTTPClient creates a new PostCountiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCountiesParamsWithHTTPClient(client *http.Client) *PostCountiesParams { + var () + return &PostCountiesParams{ + HTTPClient: client, + } +} + +/*PostCountiesParams contains all the parameters to send to the API endpoint +for the post counties operation typically these are written to a http.Request +*/ +type PostCountiesParams struct { + + /*CountyRequest*/ + CountyRequest *geo_models.CountyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post counties params +func (o *PostCountiesParams) WithTimeout(timeout time.Duration) *PostCountiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post counties params +func (o *PostCountiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post counties params +func (o *PostCountiesParams) WithContext(ctx context.Context) *PostCountiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post counties params +func (o *PostCountiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post counties params +func (o *PostCountiesParams) WithHTTPClient(client *http.Client) *PostCountiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post counties params +func (o *PostCountiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountyRequest adds the countyRequest to the post counties params +func (o *PostCountiesParams) WithCountyRequest(countyRequest *geo_models.CountyRequest) *PostCountiesParams { + o.SetCountyRequest(countyRequest) + return o +} + +// SetCountyRequest adds the countyRequest to the post counties params +func (o *PostCountiesParams) SetCountyRequest(countyRequest *geo_models.CountyRequest) { + o.CountyRequest = countyRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCountiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountyRequest != nil { + if err := r.SetBodyParam(o.CountyRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/county/post_counties_responses.go b/api/geo/geo_client/county/post_counties_responses.go new file mode 100644 index 0000000..28ea4f1 --- /dev/null +++ b/api/geo/geo_client/county/post_counties_responses.go @@ -0,0 +1,259 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostCountiesReader is a Reader for the PostCounties structure. +type PostCountiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCountiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCountiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCountiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCountiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCountiesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCountiesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostCountiesOK creates a PostCountiesOK with default headers values +func NewPostCountiesOK() *PostCountiesOK { + return &PostCountiesOK{} +} + +/*PostCountiesOK handles this case with default header values. + +Taxnexus Response with an array of County objects +*/ +type PostCountiesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.CountyResponse +} + +func (o *PostCountiesOK) Error() string { + return fmt.Sprintf("[POST /counties][%d] postCountiesOK %+v", 200, o.Payload) +} + +func (o *PostCountiesOK) GetPayload() *geo_models.CountyResponse { + return o.Payload +} + +func (o *PostCountiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.CountyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountiesUnauthorized creates a PostCountiesUnauthorized with default headers values +func NewPostCountiesUnauthorized() *PostCountiesUnauthorized { + return &PostCountiesUnauthorized{} +} + +/*PostCountiesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostCountiesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountiesUnauthorized) Error() string { + return fmt.Sprintf("[POST /counties][%d] postCountiesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCountiesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountiesForbidden creates a PostCountiesForbidden with default headers values +func NewPostCountiesForbidden() *PostCountiesForbidden { + return &PostCountiesForbidden{} +} + +/*PostCountiesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostCountiesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountiesForbidden) Error() string { + return fmt.Sprintf("[POST /counties][%d] postCountiesForbidden %+v", 403, o.Payload) +} + +func (o *PostCountiesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountiesNotFound creates a PostCountiesNotFound with default headers values +func NewPostCountiesNotFound() *PostCountiesNotFound { + return &PostCountiesNotFound{} +} + +/*PostCountiesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostCountiesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountiesNotFound) Error() string { + return fmt.Sprintf("[POST /counties][%d] postCountiesNotFound %+v", 404, o.Payload) +} + +func (o *PostCountiesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCountiesInternalServerError creates a PostCountiesInternalServerError with default headers values +func NewPostCountiesInternalServerError() *PostCountiesInternalServerError { + return &PostCountiesInternalServerError{} +} + +/*PostCountiesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostCountiesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostCountiesInternalServerError) Error() string { + return fmt.Sprintf("[POST /counties][%d] postCountiesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCountiesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostCountiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/domain/domain_client.go b/api/geo/geo_client/domain/domain_client.go new file mode 100644 index 0000000..6f272cf --- /dev/null +++ b/api/geo/geo_client/domain/domain_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domain + +// 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 domain API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for domain API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetDomainObservable(params *GetDomainObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetDomainObservableOK, error) + + GetDomains(params *GetDomainsParams, authInfo runtime.ClientAuthInfoWriter) (*GetDomainsOK, error) + + PostDomains(params *PostDomainsParams, authInfo runtime.ClientAuthInfoWriter) (*PostDomainsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetDomainObservable gets domains in an observable array + + Returns a domain retrieval in a observable array +*/ +func (a *Client) GetDomainObservable(params *GetDomainObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetDomainObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDomainObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getDomainObservable", + Method: "GET", + PathPattern: "/domains/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDomainObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetDomainObservableOK) + 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 getDomainObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetDomains gets domain records + + Return all Domain records or by ID +*/ +func (a *Client) GetDomains(params *GetDomainsParams, authInfo runtime.ClientAuthInfoWriter) (*GetDomainsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDomainsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getDomains", + Method: "GET", + PathPattern: "/domains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDomainsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetDomainsOK) + 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 getDomains: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostDomains stores new domain records + + Store a batch of new Domain records +*/ +func (a *Client) PostDomains(params *PostDomainsParams, authInfo runtime.ClientAuthInfoWriter) (*PostDomainsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostDomainsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postDomains", + Method: "POST", + PathPattern: "/domains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostDomainsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostDomainsOK) + 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 postDomains: 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/geo/geo_client/domain/get_domain_observable_parameters.go b/api/geo/geo_client/domain/get_domain_observable_parameters.go new file mode 100644 index 0000000..e272d9c --- /dev/null +++ b/api/geo/geo_client/domain/get_domain_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domain + +// 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" +) + +// NewGetDomainObservableParams creates a new GetDomainObservableParams object +// with the default values initialized. +func NewGetDomainObservableParams() *GetDomainObservableParams { + + return &GetDomainObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDomainObservableParamsWithTimeout creates a new GetDomainObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDomainObservableParamsWithTimeout(timeout time.Duration) *GetDomainObservableParams { + + return &GetDomainObservableParams{ + + timeout: timeout, + } +} + +// NewGetDomainObservableParamsWithContext creates a new GetDomainObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDomainObservableParamsWithContext(ctx context.Context) *GetDomainObservableParams { + + return &GetDomainObservableParams{ + + Context: ctx, + } +} + +// NewGetDomainObservableParamsWithHTTPClient creates a new GetDomainObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDomainObservableParamsWithHTTPClient(client *http.Client) *GetDomainObservableParams { + + return &GetDomainObservableParams{ + HTTPClient: client, + } +} + +/*GetDomainObservableParams contains all the parameters to send to the API endpoint +for the get domain observable operation typically these are written to a http.Request +*/ +type GetDomainObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get domain observable params +func (o *GetDomainObservableParams) WithTimeout(timeout time.Duration) *GetDomainObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get domain observable params +func (o *GetDomainObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get domain observable params +func (o *GetDomainObservableParams) WithContext(ctx context.Context) *GetDomainObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get domain observable params +func (o *GetDomainObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get domain observable params +func (o *GetDomainObservableParams) WithHTTPClient(client *http.Client) *GetDomainObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get domain observable params +func (o *GetDomainObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDomainObservableParams) 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/geo/geo_client/domain/get_domain_observable_responses.go b/api/geo/geo_client/domain/get_domain_observable_responses.go new file mode 100644 index 0000000..2bfe1d7 --- /dev/null +++ b/api/geo/geo_client/domain/get_domain_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domain + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetDomainObservableReader is a Reader for the GetDomainObservable structure. +type GetDomainObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDomainObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDomainObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDomainObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDomainObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDomainObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDomainObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDomainObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetDomainObservableOK creates a GetDomainObservableOK with default headers values +func NewGetDomainObservableOK() *GetDomainObservableOK { + return &GetDomainObservableOK{} +} + +/*GetDomainObservableOK handles this case with default header values. + +Observable array response to a domain retrieval +*/ +type GetDomainObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.Domain +} + +func (o *GetDomainObservableOK) Error() string { + return fmt.Sprintf("[GET /domains/observable][%d] getDomainObservableOK %+v", 200, o.Payload) +} + +func (o *GetDomainObservableOK) GetPayload() []*geo_models.Domain { + return o.Payload +} + +func (o *GetDomainObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainObservableUnauthorized creates a GetDomainObservableUnauthorized with default headers values +func NewGetDomainObservableUnauthorized() *GetDomainObservableUnauthorized { + return &GetDomainObservableUnauthorized{} +} + +/*GetDomainObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetDomainObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /domains/observable][%d] getDomainObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetDomainObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainObservableForbidden creates a GetDomainObservableForbidden with default headers values +func NewGetDomainObservableForbidden() *GetDomainObservableForbidden { + return &GetDomainObservableForbidden{} +} + +/*GetDomainObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetDomainObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainObservableForbidden) Error() string { + return fmt.Sprintf("[GET /domains/observable][%d] getDomainObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetDomainObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainObservableNotFound creates a GetDomainObservableNotFound with default headers values +func NewGetDomainObservableNotFound() *GetDomainObservableNotFound { + return &GetDomainObservableNotFound{} +} + +/*GetDomainObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetDomainObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainObservableNotFound) Error() string { + return fmt.Sprintf("[GET /domains/observable][%d] getDomainObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetDomainObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainObservableUnprocessableEntity creates a GetDomainObservableUnprocessableEntity with default headers values +func NewGetDomainObservableUnprocessableEntity() *GetDomainObservableUnprocessableEntity { + return &GetDomainObservableUnprocessableEntity{} +} + +/*GetDomainObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDomainObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /domains/observable][%d] getDomainObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetDomainObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainObservableInternalServerError creates a GetDomainObservableInternalServerError with default headers values +func NewGetDomainObservableInternalServerError() *GetDomainObservableInternalServerError { + return &GetDomainObservableInternalServerError{} +} + +/*GetDomainObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetDomainObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /domains/observable][%d] getDomainObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDomainObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/domain/get_domains_parameters.go b/api/geo/geo_client/domain/get_domains_parameters.go new file mode 100644 index 0000000..48c7197 --- /dev/null +++ b/api/geo/geo_client/domain/get_domains_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domain + +// 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" +) + +// NewGetDomainsParams creates a new GetDomainsParams object +// with the default values initialized. +func NewGetDomainsParams() *GetDomainsParams { + + return &GetDomainsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDomainsParamsWithTimeout creates a new GetDomainsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDomainsParamsWithTimeout(timeout time.Duration) *GetDomainsParams { + + return &GetDomainsParams{ + + timeout: timeout, + } +} + +// NewGetDomainsParamsWithContext creates a new GetDomainsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDomainsParamsWithContext(ctx context.Context) *GetDomainsParams { + + return &GetDomainsParams{ + + Context: ctx, + } +} + +// NewGetDomainsParamsWithHTTPClient creates a new GetDomainsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDomainsParamsWithHTTPClient(client *http.Client) *GetDomainsParams { + + return &GetDomainsParams{ + HTTPClient: client, + } +} + +/*GetDomainsParams contains all the parameters to send to the API endpoint +for the get domains operation typically these are written to a http.Request +*/ +type GetDomainsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get domains params +func (o *GetDomainsParams) WithTimeout(timeout time.Duration) *GetDomainsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get domains params +func (o *GetDomainsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get domains params +func (o *GetDomainsParams) WithContext(ctx context.Context) *GetDomainsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get domains params +func (o *GetDomainsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get domains params +func (o *GetDomainsParams) WithHTTPClient(client *http.Client) *GetDomainsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get domains params +func (o *GetDomainsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDomainsParams) 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/geo/geo_client/domain/get_domains_responses.go b/api/geo/geo_client/domain/get_domains_responses.go new file mode 100644 index 0000000..b10016b --- /dev/null +++ b/api/geo/geo_client/domain/get_domains_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domain + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetDomainsReader is a Reader for the GetDomains structure. +type GetDomainsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDomainsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDomainsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDomainsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDomainsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDomainsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDomainsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDomainsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetDomainsOK creates a GetDomainsOK with default headers values +func NewGetDomainsOK() *GetDomainsOK { + return &GetDomainsOK{} +} + +/*GetDomainsOK handles this case with default header values. + +Taxnexus Response with an array of Domain objects +*/ +type GetDomainsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.DomainResponse +} + +func (o *GetDomainsOK) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsOK %+v", 200, o.Payload) +} + +func (o *GetDomainsOK) GetPayload() *geo_models.DomainResponse { + return o.Payload +} + +func (o *GetDomainsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.DomainResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsUnauthorized creates a GetDomainsUnauthorized with default headers values +func NewGetDomainsUnauthorized() *GetDomainsUnauthorized { + return &GetDomainsUnauthorized{} +} + +/*GetDomainsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetDomainsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainsUnauthorized) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetDomainsUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsForbidden creates a GetDomainsForbidden with default headers values +func NewGetDomainsForbidden() *GetDomainsForbidden { + return &GetDomainsForbidden{} +} + +/*GetDomainsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetDomainsForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainsForbidden) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsForbidden %+v", 403, o.Payload) +} + +func (o *GetDomainsForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsNotFound creates a GetDomainsNotFound with default headers values +func NewGetDomainsNotFound() *GetDomainsNotFound { + return &GetDomainsNotFound{} +} + +/*GetDomainsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetDomainsNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainsNotFound) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsNotFound %+v", 404, o.Payload) +} + +func (o *GetDomainsNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsUnprocessableEntity creates a GetDomainsUnprocessableEntity with default headers values +func NewGetDomainsUnprocessableEntity() *GetDomainsUnprocessableEntity { + return &GetDomainsUnprocessableEntity{} +} + +/*GetDomainsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDomainsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetDomainsUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsInternalServerError creates a GetDomainsInternalServerError with default headers values +func NewGetDomainsInternalServerError() *GetDomainsInternalServerError { + return &GetDomainsInternalServerError{} +} + +/*GetDomainsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetDomainsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetDomainsInternalServerError) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDomainsInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetDomainsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/domain/post_domains_parameters.go b/api/geo/geo_client/domain/post_domains_parameters.go new file mode 100644 index 0000000..43e7e7e --- /dev/null +++ b/api/geo/geo_client/domain/post_domains_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domain + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostDomainsParams creates a new PostDomainsParams object +// with the default values initialized. +func NewPostDomainsParams() *PostDomainsParams { + var () + return &PostDomainsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostDomainsParamsWithTimeout creates a new PostDomainsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostDomainsParamsWithTimeout(timeout time.Duration) *PostDomainsParams { + var () + return &PostDomainsParams{ + + timeout: timeout, + } +} + +// NewPostDomainsParamsWithContext creates a new PostDomainsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostDomainsParamsWithContext(ctx context.Context) *PostDomainsParams { + var () + return &PostDomainsParams{ + + Context: ctx, + } +} + +// NewPostDomainsParamsWithHTTPClient creates a new PostDomainsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostDomainsParamsWithHTTPClient(client *http.Client) *PostDomainsParams { + var () + return &PostDomainsParams{ + HTTPClient: client, + } +} + +/*PostDomainsParams contains all the parameters to send to the API endpoint +for the post domains operation typically these are written to a http.Request +*/ +type PostDomainsParams struct { + + /*DomainRequest*/ + DomainRequest *geo_models.DomainRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post domains params +func (o *PostDomainsParams) WithTimeout(timeout time.Duration) *PostDomainsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post domains params +func (o *PostDomainsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post domains params +func (o *PostDomainsParams) WithContext(ctx context.Context) *PostDomainsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post domains params +func (o *PostDomainsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post domains params +func (o *PostDomainsParams) WithHTTPClient(client *http.Client) *PostDomainsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post domains params +func (o *PostDomainsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDomainRequest adds the domainRequest to the post domains params +func (o *PostDomainsParams) WithDomainRequest(domainRequest *geo_models.DomainRequest) *PostDomainsParams { + o.SetDomainRequest(domainRequest) + return o +} + +// SetDomainRequest adds the domainRequest to the post domains params +func (o *PostDomainsParams) SetDomainRequest(domainRequest *geo_models.DomainRequest) { + o.DomainRequest = domainRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostDomainsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DomainRequest != nil { + if err := r.SetBodyParam(o.DomainRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/domain/post_domains_responses.go b/api/geo/geo_client/domain/post_domains_responses.go new file mode 100644 index 0000000..b589dbf --- /dev/null +++ b/api/geo/geo_client/domain/post_domains_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domain + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostDomainsReader is a Reader for the PostDomains structure. +type PostDomainsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostDomainsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostDomainsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostDomainsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostDomainsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostDomainsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostDomainsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostDomainsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostDomainsOK creates a PostDomainsOK with default headers values +func NewPostDomainsOK() *PostDomainsOK { + return &PostDomainsOK{} +} + +/*PostDomainsOK handles this case with default header values. + +Taxnexus Response with an array of Domain objects +*/ +type PostDomainsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.DomainResponse +} + +func (o *PostDomainsOK) Error() string { + return fmt.Sprintf("[POST /domains][%d] postDomainsOK %+v", 200, o.Payload) +} + +func (o *PostDomainsOK) GetPayload() *geo_models.DomainResponse { + return o.Payload +} + +func (o *PostDomainsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.DomainResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDomainsUnauthorized creates a PostDomainsUnauthorized with default headers values +func NewPostDomainsUnauthorized() *PostDomainsUnauthorized { + return &PostDomainsUnauthorized{} +} + +/*PostDomainsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostDomainsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostDomainsUnauthorized) Error() string { + return fmt.Sprintf("[POST /domains][%d] postDomainsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostDomainsUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostDomainsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDomainsForbidden creates a PostDomainsForbidden with default headers values +func NewPostDomainsForbidden() *PostDomainsForbidden { + return &PostDomainsForbidden{} +} + +/*PostDomainsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostDomainsForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostDomainsForbidden) Error() string { + return fmt.Sprintf("[POST /domains][%d] postDomainsForbidden %+v", 403, o.Payload) +} + +func (o *PostDomainsForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostDomainsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDomainsNotFound creates a PostDomainsNotFound with default headers values +func NewPostDomainsNotFound() *PostDomainsNotFound { + return &PostDomainsNotFound{} +} + +/*PostDomainsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostDomainsNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostDomainsNotFound) Error() string { + return fmt.Sprintf("[POST /domains][%d] postDomainsNotFound %+v", 404, o.Payload) +} + +func (o *PostDomainsNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostDomainsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDomainsUnprocessableEntity creates a PostDomainsUnprocessableEntity with default headers values +func NewPostDomainsUnprocessableEntity() *PostDomainsUnprocessableEntity { + return &PostDomainsUnprocessableEntity{} +} + +/*PostDomainsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostDomainsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostDomainsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /domains][%d] postDomainsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostDomainsUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostDomainsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostDomainsInternalServerError creates a PostDomainsInternalServerError with default headers values +func NewPostDomainsInternalServerError() *PostDomainsInternalServerError { + return &PostDomainsInternalServerError{} +} + +/*PostDomainsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostDomainsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostDomainsInternalServerError) Error() string { + return fmt.Sprintf("[POST /domains][%d] postDomainsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostDomainsInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostDomainsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/geo_client.go b/api/geo/geo_client/geo_client.go new file mode 100644 index 0000000..18fc656 --- /dev/null +++ b/api/geo/geo_client/geo_client.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_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" + + "github.com/taxnexus/go/lib/api/geo/geo_client/coordinate" + "github.com/taxnexus/go/lib/api/geo/geo_client/cors" + "github.com/taxnexus/go/lib/api/geo/geo_client/country" + "github.com/taxnexus/go/lib/api/geo/geo_client/county" + "github.com/taxnexus/go/lib/api/geo/geo_client/domain" + "github.com/taxnexus/go/lib/api/geo/geo_client/place" + "github.com/taxnexus/go/lib/api/geo/geo_client/state" + "github.com/taxnexus/go/lib/api/geo/geo_client/tax_rate" + "github.com/taxnexus/go/lib/api/geo/geo_client/tax_type" + "github.com/taxnexus/go/lib/api/geo/geo_client/taxnexus_code" +) + +// Default geo HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "geo.fabric.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 geo HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Geo { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new geo HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Geo { + // 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 geo client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Geo { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Geo) + cli.Transport = transport + cli.Coordinate = coordinate.New(transport, formats) + cli.Cors = cors.New(transport, formats) + cli.Country = country.New(transport, formats) + cli.County = county.New(transport, formats) + cli.Domain = domain.New(transport, formats) + cli.Place = place.New(transport, formats) + cli.State = state.New(transport, formats) + cli.TaxRate = tax_rate.New(transport, formats) + cli.TaxType = tax_type.New(transport, formats) + cli.TaxnexusCode = taxnexus_code.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 +} + +// Geo is a client for geo +type Geo struct { + Coordinate coordinate.ClientService + + Cors cors.ClientService + + Country country.ClientService + + County county.ClientService + + Domain domain.ClientService + + Place place.ClientService + + State state.ClientService + + TaxRate tax_rate.ClientService + + TaxType tax_type.ClientService + + TaxnexusCode taxnexus_code.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Geo) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Coordinate.SetTransport(transport) + c.Cors.SetTransport(transport) + c.Country.SetTransport(transport) + c.County.SetTransport(transport) + c.Domain.SetTransport(transport) + c.Place.SetTransport(transport) + c.State.SetTransport(transport) + c.TaxRate.SetTransport(transport) + c.TaxType.SetTransport(transport) + c.TaxnexusCode.SetTransport(transport) +} diff --git a/api/geo/geo_client/place/get_place_observable_parameters.go b/api/geo/geo_client/place/get_place_observable_parameters.go new file mode 100644 index 0000000..0cb7df4 --- /dev/null +++ b/api/geo/geo_client/place/get_place_observable_parameters.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package place + +// 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" +) + +// NewGetPlaceObservableParams creates a new GetPlaceObservableParams object +// with the default values initialized. +func NewGetPlaceObservableParams() *GetPlaceObservableParams { + var () + return &GetPlaceObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlaceObservableParamsWithTimeout creates a new GetPlaceObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlaceObservableParamsWithTimeout(timeout time.Duration) *GetPlaceObservableParams { + var () + return &GetPlaceObservableParams{ + + timeout: timeout, + } +} + +// NewGetPlaceObservableParamsWithContext creates a new GetPlaceObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlaceObservableParamsWithContext(ctx context.Context) *GetPlaceObservableParams { + var () + return &GetPlaceObservableParams{ + + Context: ctx, + } +} + +// NewGetPlaceObservableParamsWithHTTPClient creates a new GetPlaceObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlaceObservableParamsWithHTTPClient(client *http.Client) *GetPlaceObservableParams { + var () + return &GetPlaceObservableParams{ + HTTPClient: client, + } +} + +/*GetPlaceObservableParams contains all the parameters to send to the API endpoint +for the get place observable operation typically these are written to a http.Request +*/ +type GetPlaceObservableParams struct { + + /*Geocode + The Geocode of this Place record + + */ + Geocode *string + /*PlaceID + The ID of a Place record + + */ + PlaceID *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get place observable params +func (o *GetPlaceObservableParams) WithTimeout(timeout time.Duration) *GetPlaceObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get place observable params +func (o *GetPlaceObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get place observable params +func (o *GetPlaceObservableParams) WithContext(ctx context.Context) *GetPlaceObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get place observable params +func (o *GetPlaceObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get place observable params +func (o *GetPlaceObservableParams) WithHTTPClient(client *http.Client) *GetPlaceObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get place observable params +func (o *GetPlaceObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGeocode adds the geocode to the get place observable params +func (o *GetPlaceObservableParams) WithGeocode(geocode *string) *GetPlaceObservableParams { + o.SetGeocode(geocode) + return o +} + +// SetGeocode adds the geocode to the get place observable params +func (o *GetPlaceObservableParams) SetGeocode(geocode *string) { + o.Geocode = geocode +} + +// WithPlaceID adds the placeID to the get place observable params +func (o *GetPlaceObservableParams) WithPlaceID(placeID *string) *GetPlaceObservableParams { + o.SetPlaceID(placeID) + return o +} + +// SetPlaceID adds the placeId to the get place observable params +func (o *GetPlaceObservableParams) SetPlaceID(placeID *string) { + o.PlaceID = placeID +} + +// WithState adds the state to the get place observable params +func (o *GetPlaceObservableParams) WithState(state *string) *GetPlaceObservableParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get place observable params +func (o *GetPlaceObservableParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlaceObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Geocode != nil { + + // query param geocode + var qrGeocode string + if o.Geocode != nil { + qrGeocode = *o.Geocode + } + qGeocode := qrGeocode + if qGeocode != "" { + if err := r.SetQueryParam("geocode", qGeocode); err != nil { + return err + } + } + + } + + if o.PlaceID != nil { + + // query param placeId + var qrPlaceID string + if o.PlaceID != nil { + qrPlaceID = *o.PlaceID + } + qPlaceID := qrPlaceID + if qPlaceID != "" { + if err := r.SetQueryParam("placeId", qPlaceID); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/place/get_place_observable_responses.go b/api/geo/geo_client/place/get_place_observable_responses.go new file mode 100644 index 0000000..704192f --- /dev/null +++ b/api/geo/geo_client/place/get_place_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package place + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetPlaceObservableReader is a Reader for the GetPlaceObservable structure. +type GetPlaceObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlaceObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlaceObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlaceObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlaceObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlaceObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPlaceObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlaceObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlaceObservableOK creates a GetPlaceObservableOK with default headers values +func NewGetPlaceObservableOK() *GetPlaceObservableOK { + return &GetPlaceObservableOK{} +} + +/*GetPlaceObservableOK handles this case with default header values. + +Observable array response to a place retrieval +*/ +type GetPlaceObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.Place +} + +func (o *GetPlaceObservableOK) Error() string { + return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableOK %+v", 200, o.Payload) +} + +func (o *GetPlaceObservableOK) GetPayload() []*geo_models.Place { + return o.Payload +} + +func (o *GetPlaceObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlaceObservableUnauthorized creates a GetPlaceObservableUnauthorized with default headers values +func NewGetPlaceObservableUnauthorized() *GetPlaceObservableUnauthorized { + return &GetPlaceObservableUnauthorized{} +} + +/*GetPlaceObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlaceObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlaceObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlaceObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlaceObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlaceObservableForbidden creates a GetPlaceObservableForbidden with default headers values +func NewGetPlaceObservableForbidden() *GetPlaceObservableForbidden { + return &GetPlaceObservableForbidden{} +} + +/*GetPlaceObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlaceObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlaceObservableForbidden) Error() string { + return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetPlaceObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlaceObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlaceObservableNotFound creates a GetPlaceObservableNotFound with default headers values +func NewGetPlaceObservableNotFound() *GetPlaceObservableNotFound { + return &GetPlaceObservableNotFound{} +} + +/*GetPlaceObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlaceObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlaceObservableNotFound) Error() string { + return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetPlaceObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlaceObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlaceObservableUnprocessableEntity creates a GetPlaceObservableUnprocessableEntity with default headers values +func NewGetPlaceObservableUnprocessableEntity() *GetPlaceObservableUnprocessableEntity { + return &GetPlaceObservableUnprocessableEntity{} +} + +/*GetPlaceObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPlaceObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlaceObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPlaceObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlaceObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlaceObservableInternalServerError creates a GetPlaceObservableInternalServerError with default headers values +func NewGetPlaceObservableInternalServerError() *GetPlaceObservableInternalServerError { + return &GetPlaceObservableInternalServerError{} +} + +/*GetPlaceObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlaceObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlaceObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlaceObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlaceObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/place/get_places_parameters.go b/api/geo/geo_client/place/get_places_parameters.go new file mode 100644 index 0000000..d0a97e2 --- /dev/null +++ b/api/geo/geo_client/place/get_places_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package place + +// 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" +) + +// NewGetPlacesParams creates a new GetPlacesParams object +// with the default values initialized. +func NewGetPlacesParams() *GetPlacesParams { + var () + return &GetPlacesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlacesParamsWithTimeout creates a new GetPlacesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlacesParamsWithTimeout(timeout time.Duration) *GetPlacesParams { + var () + return &GetPlacesParams{ + + timeout: timeout, + } +} + +// NewGetPlacesParamsWithContext creates a new GetPlacesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlacesParamsWithContext(ctx context.Context) *GetPlacesParams { + var () + return &GetPlacesParams{ + + Context: ctx, + } +} + +// NewGetPlacesParamsWithHTTPClient creates a new GetPlacesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlacesParamsWithHTTPClient(client *http.Client) *GetPlacesParams { + var () + return &GetPlacesParams{ + HTTPClient: client, + } +} + +/*GetPlacesParams contains all the parameters to send to the API endpoint +for the get places operation typically these are written to a http.Request +*/ +type GetPlacesParams struct { + + /*Geocode + The Geocode of this Place record + + */ + Geocode *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*PlaceID + The ID of a Place record + + */ + PlaceID *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get places params +func (o *GetPlacesParams) WithTimeout(timeout time.Duration) *GetPlacesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get places params +func (o *GetPlacesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get places params +func (o *GetPlacesParams) WithContext(ctx context.Context) *GetPlacesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get places params +func (o *GetPlacesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get places params +func (o *GetPlacesParams) WithHTTPClient(client *http.Client) *GetPlacesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get places params +func (o *GetPlacesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGeocode adds the geocode to the get places params +func (o *GetPlacesParams) WithGeocode(geocode *string) *GetPlacesParams { + o.SetGeocode(geocode) + return o +} + +// SetGeocode adds the geocode to the get places params +func (o *GetPlacesParams) SetGeocode(geocode *string) { + o.Geocode = geocode +} + +// WithLimit adds the limit to the get places params +func (o *GetPlacesParams) WithLimit(limit *int64) *GetPlacesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get places params +func (o *GetPlacesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get places params +func (o *GetPlacesParams) WithOffset(offset *int64) *GetPlacesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get places params +func (o *GetPlacesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlaceID adds the placeID to the get places params +func (o *GetPlacesParams) WithPlaceID(placeID *string) *GetPlacesParams { + o.SetPlaceID(placeID) + return o +} + +// SetPlaceID adds the placeId to the get places params +func (o *GetPlacesParams) SetPlaceID(placeID *string) { + o.PlaceID = placeID +} + +// WithState adds the state to the get places params +func (o *GetPlacesParams) WithState(state *string) *GetPlacesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get places params +func (o *GetPlacesParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlacesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Geocode != nil { + + // query param geocode + var qrGeocode string + if o.Geocode != nil { + qrGeocode = *o.Geocode + } + qGeocode := qrGeocode + if qGeocode != "" { + if err := r.SetQueryParam("geocode", qGeocode); 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.PlaceID != nil { + + // query param placeId + var qrPlaceID string + if o.PlaceID != nil { + qrPlaceID = *o.PlaceID + } + qPlaceID := qrPlaceID + if qPlaceID != "" { + if err := r.SetQueryParam("placeId", qPlaceID); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/place/get_places_responses.go b/api/geo/geo_client/place/get_places_responses.go new file mode 100644 index 0000000..9e3b6fc --- /dev/null +++ b/api/geo/geo_client/place/get_places_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package place + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetPlacesReader is a Reader for the GetPlaces structure. +type GetPlacesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlacesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlacesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlacesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlacesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlacesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPlacesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlacesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlacesOK creates a GetPlacesOK with default headers values +func NewGetPlacesOK() *GetPlacesOK { + return &GetPlacesOK{} +} + +/*GetPlacesOK handles this case with default header values. + +Taxnexus Response with an array of Place objects +*/ +type GetPlacesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.PlaceResponse +} + +func (o *GetPlacesOK) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesOK %+v", 200, o.Payload) +} + +func (o *GetPlacesOK) GetPayload() *geo_models.PlaceResponse { + return o.Payload +} + +func (o *GetPlacesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.PlaceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesUnauthorized creates a GetPlacesUnauthorized with default headers values +func NewGetPlacesUnauthorized() *GetPlacesUnauthorized { + return &GetPlacesUnauthorized{} +} + +/*GetPlacesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlacesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlacesUnauthorized) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlacesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlacesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesForbidden creates a GetPlacesForbidden with default headers values +func NewGetPlacesForbidden() *GetPlacesForbidden { + return &GetPlacesForbidden{} +} + +/*GetPlacesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlacesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlacesForbidden) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesForbidden %+v", 403, o.Payload) +} + +func (o *GetPlacesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlacesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesNotFound creates a GetPlacesNotFound with default headers values +func NewGetPlacesNotFound() *GetPlacesNotFound { + return &GetPlacesNotFound{} +} + +/*GetPlacesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlacesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlacesNotFound) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesNotFound %+v", 404, o.Payload) +} + +func (o *GetPlacesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlacesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesUnprocessableEntity creates a GetPlacesUnprocessableEntity with default headers values +func NewGetPlacesUnprocessableEntity() *GetPlacesUnprocessableEntity { + return &GetPlacesUnprocessableEntity{} +} + +/*GetPlacesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPlacesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlacesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPlacesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlacesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesInternalServerError creates a GetPlacesInternalServerError with default headers values +func NewGetPlacesInternalServerError() *GetPlacesInternalServerError { + return &GetPlacesInternalServerError{} +} + +/*GetPlacesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlacesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetPlacesInternalServerError) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlacesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetPlacesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/place/place_client.go b/api/geo/geo_client/place/place_client.go new file mode 100644 index 0000000..3f45255 --- /dev/null +++ b/api/geo/geo_client/place/place_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package place + +// 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 place API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for place API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPlaceObservable(params *GetPlaceObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlaceObservableOK, error) + + GetPlaces(params *GetPlacesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlacesOK, error) + + PostPlaces(params *PostPlacesParams, authInfo runtime.ClientAuthInfoWriter) (*PostPlacesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPlaceObservable gets places in an observable array + + Returns a place retrieval in a observable array +*/ +func (a *Client) GetPlaceObservable(params *GetPlaceObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlaceObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlaceObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlaceObservable", + Method: "GET", + PathPattern: "/places/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlaceObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlaceObservableOK) + 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 getPlaceObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlaces retrieves places + + Retrieve Places, filter with parameters +*/ +func (a *Client) GetPlaces(params *GetPlacesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlacesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlacesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlaces", + Method: "GET", + PathPattern: "/places", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlacesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlacesOK) + 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 getPlaces: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPlaces stores new place records + + Store a batch of new Place records +*/ +func (a *Client) PostPlaces(params *PostPlacesParams, authInfo runtime.ClientAuthInfoWriter) (*PostPlacesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPlacesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPlaces", + Method: "POST", + PathPattern: "/places", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPlacesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPlacesOK) + 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 postPlaces: 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/geo/geo_client/place/post_places_parameters.go b/api/geo/geo_client/place/post_places_parameters.go new file mode 100644 index 0000000..8e247db --- /dev/null +++ b/api/geo/geo_client/place/post_places_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package place + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostPlacesParams creates a new PostPlacesParams object +// with the default values initialized. +func NewPostPlacesParams() *PostPlacesParams { + var () + return &PostPlacesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPlacesParamsWithTimeout creates a new PostPlacesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPlacesParamsWithTimeout(timeout time.Duration) *PostPlacesParams { + var () + return &PostPlacesParams{ + + timeout: timeout, + } +} + +// NewPostPlacesParamsWithContext creates a new PostPlacesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPlacesParamsWithContext(ctx context.Context) *PostPlacesParams { + var () + return &PostPlacesParams{ + + Context: ctx, + } +} + +// NewPostPlacesParamsWithHTTPClient creates a new PostPlacesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPlacesParamsWithHTTPClient(client *http.Client) *PostPlacesParams { + var () + return &PostPlacesParams{ + HTTPClient: client, + } +} + +/*PostPlacesParams contains all the parameters to send to the API endpoint +for the post places operation typically these are written to a http.Request +*/ +type PostPlacesParams struct { + + /*PlaceRequest + The new Places request package + + */ + PlaceRequest *geo_models.PlaceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post places params +func (o *PostPlacesParams) WithTimeout(timeout time.Duration) *PostPlacesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post places params +func (o *PostPlacesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post places params +func (o *PostPlacesParams) WithContext(ctx context.Context) *PostPlacesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post places params +func (o *PostPlacesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post places params +func (o *PostPlacesParams) WithHTTPClient(client *http.Client) *PostPlacesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post places params +func (o *PostPlacesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPlaceRequest adds the placeRequest to the post places params +func (o *PostPlacesParams) WithPlaceRequest(placeRequest *geo_models.PlaceRequest) *PostPlacesParams { + o.SetPlaceRequest(placeRequest) + return o +} + +// SetPlaceRequest adds the placeRequest to the post places params +func (o *PostPlacesParams) SetPlaceRequest(placeRequest *geo_models.PlaceRequest) { + o.PlaceRequest = placeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPlacesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PlaceRequest != nil { + if err := r.SetBodyParam(o.PlaceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/place/post_places_responses.go b/api/geo/geo_client/place/post_places_responses.go new file mode 100644 index 0000000..ae8b152 --- /dev/null +++ b/api/geo/geo_client/place/post_places_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package place + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostPlacesReader is a Reader for the PostPlaces structure. +type PostPlacesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPlacesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPlacesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPlacesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPlacesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPlacesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPlacesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPlacesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPlacesOK creates a PostPlacesOK with default headers values +func NewPostPlacesOK() *PostPlacesOK { + return &PostPlacesOK{} +} + +/*PostPlacesOK handles this case with default header values. + +Taxnexus Response with an array of Place objects +*/ +type PostPlacesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.PlaceResponse +} + +func (o *PostPlacesOK) Error() string { + return fmt.Sprintf("[POST /places][%d] postPlacesOK %+v", 200, o.Payload) +} + +func (o *PostPlacesOK) GetPayload() *geo_models.PlaceResponse { + return o.Payload +} + +func (o *PostPlacesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.PlaceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlacesUnauthorized creates a PostPlacesUnauthorized with default headers values +func NewPostPlacesUnauthorized() *PostPlacesUnauthorized { + return &PostPlacesUnauthorized{} +} + +/*PostPlacesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostPlacesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostPlacesUnauthorized) Error() string { + return fmt.Sprintf("[POST /places][%d] postPlacesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPlacesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostPlacesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlacesForbidden creates a PostPlacesForbidden with default headers values +func NewPostPlacesForbidden() *PostPlacesForbidden { + return &PostPlacesForbidden{} +} + +/*PostPlacesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPlacesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostPlacesForbidden) Error() string { + return fmt.Sprintf("[POST /places][%d] postPlacesForbidden %+v", 403, o.Payload) +} + +func (o *PostPlacesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostPlacesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlacesNotFound creates a PostPlacesNotFound with default headers values +func NewPostPlacesNotFound() *PostPlacesNotFound { + return &PostPlacesNotFound{} +} + +/*PostPlacesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPlacesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostPlacesNotFound) Error() string { + return fmt.Sprintf("[POST /places][%d] postPlacesNotFound %+v", 404, o.Payload) +} + +func (o *PostPlacesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostPlacesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlacesUnprocessableEntity creates a PostPlacesUnprocessableEntity with default headers values +func NewPostPlacesUnprocessableEntity() *PostPlacesUnprocessableEntity { + return &PostPlacesUnprocessableEntity{} +} + +/*PostPlacesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPlacesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostPlacesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /places][%d] postPlacesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostPlacesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostPlacesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlacesInternalServerError creates a PostPlacesInternalServerError with default headers values +func NewPostPlacesInternalServerError() *PostPlacesInternalServerError { + return &PostPlacesInternalServerError{} +} + +/*PostPlacesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPlacesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostPlacesInternalServerError) Error() string { + return fmt.Sprintf("[POST /places][%d] postPlacesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPlacesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostPlacesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/state/get_state_observable_parameters.go b/api/geo/geo_client/state/get_state_observable_parameters.go new file mode 100644 index 0000000..ac1745a --- /dev/null +++ b/api/geo/geo_client/state/get_state_observable_parameters.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package state + +// 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" +) + +// NewGetStateObservableParams creates a new GetStateObservableParams object +// with the default values initialized. +func NewGetStateObservableParams() *GetStateObservableParams { + var () + return &GetStateObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetStateObservableParamsWithTimeout creates a new GetStateObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetStateObservableParamsWithTimeout(timeout time.Duration) *GetStateObservableParams { + var () + return &GetStateObservableParams{ + + timeout: timeout, + } +} + +// NewGetStateObservableParamsWithContext creates a new GetStateObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetStateObservableParamsWithContext(ctx context.Context) *GetStateObservableParams { + var () + return &GetStateObservableParams{ + + Context: ctx, + } +} + +// NewGetStateObservableParamsWithHTTPClient creates a new GetStateObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetStateObservableParamsWithHTTPClient(client *http.Client) *GetStateObservableParams { + var () + return &GetStateObservableParams{ + HTTPClient: client, + } +} + +/*GetStateObservableParams contains all the parameters to send to the API endpoint +for the get state observable operation typically these are written to a http.Request +*/ +type GetStateObservableParams struct { + + /*StateID + The ID of this Object + + */ + StateID *string + /*CountryCode + The Country abbreviation (2 char) + + */ + CountryCode *string + /*Geocode + The Geocode of this Place record + + */ + Geocode *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get state observable params +func (o *GetStateObservableParams) WithTimeout(timeout time.Duration) *GetStateObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get state observable params +func (o *GetStateObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get state observable params +func (o *GetStateObservableParams) WithContext(ctx context.Context) *GetStateObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get state observable params +func (o *GetStateObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get state observable params +func (o *GetStateObservableParams) WithHTTPClient(client *http.Client) *GetStateObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get state observable params +func (o *GetStateObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStateID adds the stateID to the get state observable params +func (o *GetStateObservableParams) WithStateID(stateID *string) *GetStateObservableParams { + o.SetStateID(stateID) + return o +} + +// SetStateID adds the stateId to the get state observable params +func (o *GetStateObservableParams) SetStateID(stateID *string) { + o.StateID = stateID +} + +// WithCountryCode adds the countryCode to the get state observable params +func (o *GetStateObservableParams) WithCountryCode(countryCode *string) *GetStateObservableParams { + o.SetCountryCode(countryCode) + return o +} + +// SetCountryCode adds the countryCode to the get state observable params +func (o *GetStateObservableParams) SetCountryCode(countryCode *string) { + o.CountryCode = countryCode +} + +// WithGeocode adds the geocode to the get state observable params +func (o *GetStateObservableParams) WithGeocode(geocode *string) *GetStateObservableParams { + o.SetGeocode(geocode) + return o +} + +// SetGeocode adds the geocode to the get state observable params +func (o *GetStateObservableParams) SetGeocode(geocode *string) { + o.Geocode = geocode +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStateObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StateID != nil { + + // query param StateID + var qrStateID string + if o.StateID != nil { + qrStateID = *o.StateID + } + qStateID := qrStateID + if qStateID != "" { + if err := r.SetQueryParam("StateID", qStateID); err != nil { + return err + } + } + + } + + if o.CountryCode != nil { + + // query param countryCode + var qrCountryCode string + if o.CountryCode != nil { + qrCountryCode = *o.CountryCode + } + qCountryCode := qrCountryCode + if qCountryCode != "" { + if err := r.SetQueryParam("countryCode", qCountryCode); err != nil { + return err + } + } + + } + + if o.Geocode != nil { + + // query param geocode + var qrGeocode string + if o.Geocode != nil { + qrGeocode = *o.Geocode + } + qGeocode := qrGeocode + if qGeocode != "" { + if err := r.SetQueryParam("geocode", qGeocode); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/state/get_state_observable_responses.go b/api/geo/geo_client/state/get_state_observable_responses.go new file mode 100644 index 0000000..9ef389a --- /dev/null +++ b/api/geo/geo_client/state/get_state_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package state + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetStateObservableReader is a Reader for the GetStateObservable structure. +type GetStateObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStateObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStateObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetStateObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetStateObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetStateObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetStateObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetStateObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetStateObservableOK creates a GetStateObservableOK with default headers values +func NewGetStateObservableOK() *GetStateObservableOK { + return &GetStateObservableOK{} +} + +/*GetStateObservableOK handles this case with default header values. + +Observable array response to a state retrieval +*/ +type GetStateObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.State +} + +func (o *GetStateObservableOK) Error() string { + return fmt.Sprintf("[GET /states/observable][%d] getStateObservableOK %+v", 200, o.Payload) +} + +func (o *GetStateObservableOK) GetPayload() []*geo_models.State { + return o.Payload +} + +func (o *GetStateObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStateObservableUnauthorized creates a GetStateObservableUnauthorized with default headers values +func NewGetStateObservableUnauthorized() *GetStateObservableUnauthorized { + return &GetStateObservableUnauthorized{} +} + +/*GetStateObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetStateObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStateObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /states/observable][%d] getStateObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetStateObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStateObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStateObservableForbidden creates a GetStateObservableForbidden with default headers values +func NewGetStateObservableForbidden() *GetStateObservableForbidden { + return &GetStateObservableForbidden{} +} + +/*GetStateObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetStateObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStateObservableForbidden) Error() string { + return fmt.Sprintf("[GET /states/observable][%d] getStateObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetStateObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStateObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStateObservableNotFound creates a GetStateObservableNotFound with default headers values +func NewGetStateObservableNotFound() *GetStateObservableNotFound { + return &GetStateObservableNotFound{} +} + +/*GetStateObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetStateObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStateObservableNotFound) Error() string { + return fmt.Sprintf("[GET /states/observable][%d] getStateObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetStateObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStateObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStateObservableUnprocessableEntity creates a GetStateObservableUnprocessableEntity with default headers values +func NewGetStateObservableUnprocessableEntity() *GetStateObservableUnprocessableEntity { + return &GetStateObservableUnprocessableEntity{} +} + +/*GetStateObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetStateObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStateObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /states/observable][%d] getStateObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetStateObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStateObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStateObservableInternalServerError creates a GetStateObservableInternalServerError with default headers values +func NewGetStateObservableInternalServerError() *GetStateObservableInternalServerError { + return &GetStateObservableInternalServerError{} +} + +/*GetStateObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetStateObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStateObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /states/observable][%d] getStateObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetStateObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStateObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/state/get_states_parameters.go b/api/geo/geo_client/state/get_states_parameters.go new file mode 100644 index 0000000..21826e5 --- /dev/null +++ b/api/geo/geo_client/state/get_states_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package state + +// 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" +) + +// NewGetStatesParams creates a new GetStatesParams object +// with the default values initialized. +func NewGetStatesParams() *GetStatesParams { + var () + return &GetStatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetStatesParamsWithTimeout creates a new GetStatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetStatesParamsWithTimeout(timeout time.Duration) *GetStatesParams { + var () + return &GetStatesParams{ + + timeout: timeout, + } +} + +// NewGetStatesParamsWithContext creates a new GetStatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetStatesParamsWithContext(ctx context.Context) *GetStatesParams { + var () + return &GetStatesParams{ + + Context: ctx, + } +} + +// NewGetStatesParamsWithHTTPClient creates a new GetStatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetStatesParamsWithHTTPClient(client *http.Client) *GetStatesParams { + var () + return &GetStatesParams{ + HTTPClient: client, + } +} + +/*GetStatesParams contains all the parameters to send to the API endpoint +for the get states operation typically these are written to a http.Request +*/ +type GetStatesParams struct { + + /*StateID + The ID of this Object + + */ + StateID *string + /*CountryCode + The Country abbreviation (2 char) + + */ + CountryCode *string + /*Geocode + The Geocode of this Place record + + */ + Geocode *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get states params +func (o *GetStatesParams) WithTimeout(timeout time.Duration) *GetStatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get states params +func (o *GetStatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get states params +func (o *GetStatesParams) WithContext(ctx context.Context) *GetStatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get states params +func (o *GetStatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get states params +func (o *GetStatesParams) WithHTTPClient(client *http.Client) *GetStatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get states params +func (o *GetStatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStateID adds the stateID to the get states params +func (o *GetStatesParams) WithStateID(stateID *string) *GetStatesParams { + o.SetStateID(stateID) + return o +} + +// SetStateID adds the stateId to the get states params +func (o *GetStatesParams) SetStateID(stateID *string) { + o.StateID = stateID +} + +// WithCountryCode adds the countryCode to the get states params +func (o *GetStatesParams) WithCountryCode(countryCode *string) *GetStatesParams { + o.SetCountryCode(countryCode) + return o +} + +// SetCountryCode adds the countryCode to the get states params +func (o *GetStatesParams) SetCountryCode(countryCode *string) { + o.CountryCode = countryCode +} + +// WithGeocode adds the geocode to the get states params +func (o *GetStatesParams) WithGeocode(geocode *string) *GetStatesParams { + o.SetGeocode(geocode) + return o +} + +// SetGeocode adds the geocode to the get states params +func (o *GetStatesParams) SetGeocode(geocode *string) { + o.Geocode = geocode +} + +// WithLimit adds the limit to the get states params +func (o *GetStatesParams) WithLimit(limit *int64) *GetStatesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get states params +func (o *GetStatesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get states params +func (o *GetStatesParams) WithOffset(offset *int64) *GetStatesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get states params +func (o *GetStatesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StateID != nil { + + // query param StateID + var qrStateID string + if o.StateID != nil { + qrStateID = *o.StateID + } + qStateID := qrStateID + if qStateID != "" { + if err := r.SetQueryParam("StateID", qStateID); err != nil { + return err + } + } + + } + + if o.CountryCode != nil { + + // query param countryCode + var qrCountryCode string + if o.CountryCode != nil { + qrCountryCode = *o.CountryCode + } + qCountryCode := qrCountryCode + if qCountryCode != "" { + if err := r.SetQueryParam("countryCode", qCountryCode); err != nil { + return err + } + } + + } + + if o.Geocode != nil { + + // query param geocode + var qrGeocode string + if o.Geocode != nil { + qrGeocode = *o.Geocode + } + qGeocode := qrGeocode + if qGeocode != "" { + if err := r.SetQueryParam("geocode", qGeocode); 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/geo/geo_client/state/get_states_responses.go b/api/geo/geo_client/state/get_states_responses.go new file mode 100644 index 0000000..051fe52 --- /dev/null +++ b/api/geo/geo_client/state/get_states_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package state + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetStatesReader is a Reader for the GetStates structure. +type GetStatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetStatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetStatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetStatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetStatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetStatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetStatesOK creates a GetStatesOK with default headers values +func NewGetStatesOK() *GetStatesOK { + return &GetStatesOK{} +} + +/*GetStatesOK handles this case with default header values. + +Taxnexus Response with an array of State objects +*/ +type GetStatesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.StateResponse +} + +func (o *GetStatesOK) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesOK %+v", 200, o.Payload) +} + +func (o *GetStatesOK) GetPayload() *geo_models.StateResponse { + return o.Payload +} + +func (o *GetStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.StateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesUnauthorized creates a GetStatesUnauthorized with default headers values +func NewGetStatesUnauthorized() *GetStatesUnauthorized { + return &GetStatesUnauthorized{} +} + +/*GetStatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetStatesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetStatesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesForbidden creates a GetStatesForbidden with default headers values +func NewGetStatesForbidden() *GetStatesForbidden { + return &GetStatesForbidden{} +} + +/*GetStatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetStatesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStatesForbidden) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesForbidden %+v", 403, o.Payload) +} + +func (o *GetStatesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesNotFound creates a GetStatesNotFound with default headers values +func NewGetStatesNotFound() *GetStatesNotFound { + return &GetStatesNotFound{} +} + +/*GetStatesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetStatesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStatesNotFound) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesNotFound %+v", 404, o.Payload) +} + +func (o *GetStatesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesUnprocessableEntity creates a GetStatesUnprocessableEntity with default headers values +func NewGetStatesUnprocessableEntity() *GetStatesUnprocessableEntity { + return &GetStatesUnprocessableEntity{} +} + +/*GetStatesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetStatesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetStatesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesInternalServerError creates a GetStatesInternalServerError with default headers values +func NewGetStatesInternalServerError() *GetStatesInternalServerError { + return &GetStatesInternalServerError{} +} + +/*GetStatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetStatesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetStatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetStatesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetStatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/state/post_states_parameters.go b/api/geo/geo_client/state/post_states_parameters.go new file mode 100644 index 0000000..8d488b0 --- /dev/null +++ b/api/geo/geo_client/state/post_states_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package state + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostStatesParams creates a new PostStatesParams object +// with the default values initialized. +func NewPostStatesParams() *PostStatesParams { + var () + return &PostStatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostStatesParamsWithTimeout creates a new PostStatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostStatesParamsWithTimeout(timeout time.Duration) *PostStatesParams { + var () + return &PostStatesParams{ + + timeout: timeout, + } +} + +// NewPostStatesParamsWithContext creates a new PostStatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostStatesParamsWithContext(ctx context.Context) *PostStatesParams { + var () + return &PostStatesParams{ + + Context: ctx, + } +} + +// NewPostStatesParamsWithHTTPClient creates a new PostStatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostStatesParamsWithHTTPClient(client *http.Client) *PostStatesParams { + var () + return &PostStatesParams{ + HTTPClient: client, + } +} + +/*PostStatesParams contains all the parameters to send to the API endpoint +for the post states operation typically these are written to a http.Request +*/ +type PostStatesParams struct { + + /*StateRequest + The new Places request package + + */ + StateRequest *geo_models.StateRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post states params +func (o *PostStatesParams) WithTimeout(timeout time.Duration) *PostStatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post states params +func (o *PostStatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post states params +func (o *PostStatesParams) WithContext(ctx context.Context) *PostStatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post states params +func (o *PostStatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post states params +func (o *PostStatesParams) WithHTTPClient(client *http.Client) *PostStatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post states params +func (o *PostStatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStateRequest adds the stateRequest to the post states params +func (o *PostStatesParams) WithStateRequest(stateRequest *geo_models.StateRequest) *PostStatesParams { + o.SetStateRequest(stateRequest) + return o +} + +// SetStateRequest adds the stateRequest to the post states params +func (o *PostStatesParams) SetStateRequest(stateRequest *geo_models.StateRequest) { + o.StateRequest = stateRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StateRequest != nil { + if err := r.SetBodyParam(o.StateRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/state/post_states_responses.go b/api/geo/geo_client/state/post_states_responses.go new file mode 100644 index 0000000..c988c9e --- /dev/null +++ b/api/geo/geo_client/state/post_states_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package state + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostStatesReader is a Reader for the PostStates structure. +type PostStatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostStatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostStatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostStatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostStatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostStatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostStatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostStatesOK creates a PostStatesOK with default headers values +func NewPostStatesOK() *PostStatesOK { + return &PostStatesOK{} +} + +/*PostStatesOK handles this case with default header values. + +Taxnexus Response with an array of State objects +*/ +type PostStatesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.StateResponse +} + +func (o *PostStatesOK) Error() string { + return fmt.Sprintf("[POST /states][%d] postStatesOK %+v", 200, o.Payload) +} + +func (o *PostStatesOK) GetPayload() *geo_models.StateResponse { + return o.Payload +} + +func (o *PostStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.StateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatesUnauthorized creates a PostStatesUnauthorized with default headers values +func NewPostStatesUnauthorized() *PostStatesUnauthorized { + return &PostStatesUnauthorized{} +} + +/*PostStatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostStatesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostStatesUnauthorized) Error() string { + return fmt.Sprintf("[POST /states][%d] postStatesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostStatesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostStatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatesForbidden creates a PostStatesForbidden with default headers values +func NewPostStatesForbidden() *PostStatesForbidden { + return &PostStatesForbidden{} +} + +/*PostStatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostStatesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostStatesForbidden) Error() string { + return fmt.Sprintf("[POST /states][%d] postStatesForbidden %+v", 403, o.Payload) +} + +func (o *PostStatesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostStatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatesNotFound creates a PostStatesNotFound with default headers values +func NewPostStatesNotFound() *PostStatesNotFound { + return &PostStatesNotFound{} +} + +/*PostStatesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostStatesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostStatesNotFound) Error() string { + return fmt.Sprintf("[POST /states][%d] postStatesNotFound %+v", 404, o.Payload) +} + +func (o *PostStatesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostStatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatesUnprocessableEntity creates a PostStatesUnprocessableEntity with default headers values +func NewPostStatesUnprocessableEntity() *PostStatesUnprocessableEntity { + return &PostStatesUnprocessableEntity{} +} + +/*PostStatesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostStatesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostStatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /states][%d] postStatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostStatesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostStatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatesInternalServerError creates a PostStatesInternalServerError with default headers values +func NewPostStatesInternalServerError() *PostStatesInternalServerError { + return &PostStatesInternalServerError{} +} + +/*PostStatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostStatesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostStatesInternalServerError) Error() string { + return fmt.Sprintf("[POST /states][%d] postStatesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostStatesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostStatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/state/state_client.go b/api/geo/geo_client/state/state_client.go new file mode 100644 index 0000000..2134c9c --- /dev/null +++ b/api/geo/geo_client/state/state_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package state + +// 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 state API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for state API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetStateObservable(params *GetStateObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetStateObservableOK, error) + + GetStates(params *GetStatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetStatesOK, error) + + PostStates(params *PostStatesParams, authInfo runtime.ClientAuthInfoWriter) (*PostStatesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetStateObservable gets states in an observable array + + Returns a state retrieval in a observable array +*/ +func (a *Client) GetStateObservable(params *GetStateObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetStateObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetStateObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getStateObservable", + Method: "GET", + PathPattern: "/states/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetStateObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetStateObservableOK) + 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 getStateObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetStates retrieves states + + Retrieve States, filter with parameters +*/ +func (a *Client) GetStates(params *GetStatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetStatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetStatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getStates", + Method: "GET", + PathPattern: "/states", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetStatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetStatesOK) + 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 getStates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostStates stores new state records + + Store a batch of new State records +*/ +func (a *Client) PostStates(params *PostStatesParams, authInfo runtime.ClientAuthInfoWriter) (*PostStatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostStatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postStates", + Method: "POST", + PathPattern: "/states", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostStatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostStatesOK) + 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 postStates: 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/geo/geo_client/tax_rate/get_tax_rate_observable_parameters.go b/api/geo/geo_client/tax_rate/get_tax_rate_observable_parameters.go new file mode 100644 index 0000000..f9a9510 --- /dev/null +++ b/api/geo/geo_client/tax_rate/get_tax_rate_observable_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rate + +// 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" +) + +// NewGetTaxRateObservableParams creates a new GetTaxRateObservableParams object +// with the default values initialized. +func NewGetTaxRateObservableParams() *GetTaxRateObservableParams { + var () + return &GetTaxRateObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxRateObservableParamsWithTimeout creates a new GetTaxRateObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxRateObservableParamsWithTimeout(timeout time.Duration) *GetTaxRateObservableParams { + var () + return &GetTaxRateObservableParams{ + + timeout: timeout, + } +} + +// NewGetTaxRateObservableParamsWithContext creates a new GetTaxRateObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxRateObservableParamsWithContext(ctx context.Context) *GetTaxRateObservableParams { + var () + return &GetTaxRateObservableParams{ + + Context: ctx, + } +} + +// NewGetTaxRateObservableParamsWithHTTPClient creates a new GetTaxRateObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxRateObservableParamsWithHTTPClient(client *http.Client) *GetTaxRateObservableParams { + var () + return &GetTaxRateObservableParams{ + HTTPClient: client, + } +} + +/*GetTaxRateObservableParams contains all the parameters to send to the API endpoint +for the get tax rate observable operation typically these are written to a http.Request +*/ +type GetTaxRateObservableParams struct { + + /*CountyID + The ID of this Object + + */ + CountyID *string + /*JournalDate + Journal Entry Date (transaction date), required + + */ + JournalDate string + /*PlaceID + The ID of a Place record + + */ + PlaceID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax rate observable params +func (o *GetTaxRateObservableParams) WithTimeout(timeout time.Duration) *GetTaxRateObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax rate observable params +func (o *GetTaxRateObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax rate observable params +func (o *GetTaxRateObservableParams) WithContext(ctx context.Context) *GetTaxRateObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax rate observable params +func (o *GetTaxRateObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax rate observable params +func (o *GetTaxRateObservableParams) WithHTTPClient(client *http.Client) *GetTaxRateObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax rate observable params +func (o *GetTaxRateObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountyID adds the countyID to the get tax rate observable params +func (o *GetTaxRateObservableParams) WithCountyID(countyID *string) *GetTaxRateObservableParams { + o.SetCountyID(countyID) + return o +} + +// SetCountyID adds the countyId to the get tax rate observable params +func (o *GetTaxRateObservableParams) SetCountyID(countyID *string) { + o.CountyID = countyID +} + +// WithJournalDate adds the journalDate to the get tax rate observable params +func (o *GetTaxRateObservableParams) WithJournalDate(journalDate string) *GetTaxRateObservableParams { + o.SetJournalDate(journalDate) + return o +} + +// SetJournalDate adds the journalDate to the get tax rate observable params +func (o *GetTaxRateObservableParams) SetJournalDate(journalDate string) { + o.JournalDate = journalDate +} + +// WithPlaceID adds the placeID to the get tax rate observable params +func (o *GetTaxRateObservableParams) WithPlaceID(placeID *string) *GetTaxRateObservableParams { + o.SetPlaceID(placeID) + return o +} + +// SetPlaceID adds the placeId to the get tax rate observable params +func (o *GetTaxRateObservableParams) SetPlaceID(placeID *string) { + o.PlaceID = placeID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxRateObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountyID != nil { + + // query param countyId + var qrCountyID string + if o.CountyID != nil { + qrCountyID = *o.CountyID + } + qCountyID := qrCountyID + if qCountyID != "" { + if err := r.SetQueryParam("countyId", qCountyID); err != nil { + return err + } + } + + } + + // query param journalDate + qrJournalDate := o.JournalDate + qJournalDate := qrJournalDate + if qJournalDate != "" { + if err := r.SetQueryParam("journalDate", qJournalDate); err != nil { + return err + } + } + + if o.PlaceID != nil { + + // query param placeId + var qrPlaceID string + if o.PlaceID != nil { + qrPlaceID = *o.PlaceID + } + qPlaceID := qrPlaceID + if qPlaceID != "" { + if err := r.SetQueryParam("placeId", qPlaceID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/tax_rate/get_tax_rate_observable_responses.go b/api/geo/geo_client/tax_rate/get_tax_rate_observable_responses.go new file mode 100644 index 0000000..c779a06 --- /dev/null +++ b/api/geo/geo_client/tax_rate/get_tax_rate_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rate + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetTaxRateObservableReader is a Reader for the GetTaxRateObservable structure. +type GetTaxRateObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxRateObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxRateObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxRateObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxRateObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxRateObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxRateObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxRateObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxRateObservableOK creates a GetTaxRateObservableOK with default headers values +func NewGetTaxRateObservableOK() *GetTaxRateObservableOK { + return &GetTaxRateObservableOK{} +} + +/*GetTaxRateObservableOK handles this case with default header values. + +Observable array response to a tax rate retrieval +*/ +type GetTaxRateObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.TaxRate +} + +func (o *GetTaxRateObservableOK) Error() string { + return fmt.Sprintf("[GET /taxrates/observable][%d] getTaxRateObservableOK %+v", 200, o.Payload) +} + +func (o *GetTaxRateObservableOK) GetPayload() []*geo_models.TaxRate { + return o.Payload +} + +func (o *GetTaxRateObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRateObservableUnauthorized creates a GetTaxRateObservableUnauthorized with default headers values +func NewGetTaxRateObservableUnauthorized() *GetTaxRateObservableUnauthorized { + return &GetTaxRateObservableUnauthorized{} +} + +/*GetTaxRateObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxRateObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRateObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxrates/observable][%d] getTaxRateObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxRateObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRateObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRateObservableForbidden creates a GetTaxRateObservableForbidden with default headers values +func NewGetTaxRateObservableForbidden() *GetTaxRateObservableForbidden { + return &GetTaxRateObservableForbidden{} +} + +/*GetTaxRateObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxRateObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRateObservableForbidden) Error() string { + return fmt.Sprintf("[GET /taxrates/observable][%d] getTaxRateObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxRateObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRateObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRateObservableNotFound creates a GetTaxRateObservableNotFound with default headers values +func NewGetTaxRateObservableNotFound() *GetTaxRateObservableNotFound { + return &GetTaxRateObservableNotFound{} +} + +/*GetTaxRateObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxRateObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRateObservableNotFound) Error() string { + return fmt.Sprintf("[GET /taxrates/observable][%d] getTaxRateObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxRateObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRateObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRateObservableUnprocessableEntity creates a GetTaxRateObservableUnprocessableEntity with default headers values +func NewGetTaxRateObservableUnprocessableEntity() *GetTaxRateObservableUnprocessableEntity { + return &GetTaxRateObservableUnprocessableEntity{} +} + +/*GetTaxRateObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxRateObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRateObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxrates/observable][%d] getTaxRateObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxRateObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRateObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRateObservableInternalServerError creates a GetTaxRateObservableInternalServerError with default headers values +func NewGetTaxRateObservableInternalServerError() *GetTaxRateObservableInternalServerError { + return &GetTaxRateObservableInternalServerError{} +} + +/*GetTaxRateObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxRateObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRateObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxrates/observable][%d] getTaxRateObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxRateObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRateObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/tax_rate/get_tax_rates_parameters.go b/api/geo/geo_client/tax_rate/get_tax_rates_parameters.go new file mode 100644 index 0000000..1e2b496 --- /dev/null +++ b/api/geo/geo_client/tax_rate/get_tax_rates_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rate + +// 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" +) + +// NewGetTaxRatesParams creates a new GetTaxRatesParams object +// with the default values initialized. +func NewGetTaxRatesParams() *GetTaxRatesParams { + var () + return &GetTaxRatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxRatesParamsWithTimeout creates a new GetTaxRatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxRatesParamsWithTimeout(timeout time.Duration) *GetTaxRatesParams { + var () + return &GetTaxRatesParams{ + + timeout: timeout, + } +} + +// NewGetTaxRatesParamsWithContext creates a new GetTaxRatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxRatesParamsWithContext(ctx context.Context) *GetTaxRatesParams { + var () + return &GetTaxRatesParams{ + + Context: ctx, + } +} + +// NewGetTaxRatesParamsWithHTTPClient creates a new GetTaxRatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxRatesParamsWithHTTPClient(client *http.Client) *GetTaxRatesParams { + var () + return &GetTaxRatesParams{ + HTTPClient: client, + } +} + +/*GetTaxRatesParams contains all the parameters to send to the API endpoint +for the get tax rates operation typically these are written to a http.Request +*/ +type GetTaxRatesParams struct { + + /*CountyID + The ID of this Object + + */ + CountyID *string + /*JournalDate + Journal Entry Date (transaction date), required + + */ + JournalDate string + /*PlaceID + The ID of a Place record + + */ + PlaceID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax rates params +func (o *GetTaxRatesParams) WithTimeout(timeout time.Duration) *GetTaxRatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax rates params +func (o *GetTaxRatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax rates params +func (o *GetTaxRatesParams) WithContext(ctx context.Context) *GetTaxRatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax rates params +func (o *GetTaxRatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax rates params +func (o *GetTaxRatesParams) WithHTTPClient(client *http.Client) *GetTaxRatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax rates params +func (o *GetTaxRatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountyID adds the countyID to the get tax rates params +func (o *GetTaxRatesParams) WithCountyID(countyID *string) *GetTaxRatesParams { + o.SetCountyID(countyID) + return o +} + +// SetCountyID adds the countyId to the get tax rates params +func (o *GetTaxRatesParams) SetCountyID(countyID *string) { + o.CountyID = countyID +} + +// WithJournalDate adds the journalDate to the get tax rates params +func (o *GetTaxRatesParams) WithJournalDate(journalDate string) *GetTaxRatesParams { + o.SetJournalDate(journalDate) + return o +} + +// SetJournalDate adds the journalDate to the get tax rates params +func (o *GetTaxRatesParams) SetJournalDate(journalDate string) { + o.JournalDate = journalDate +} + +// WithPlaceID adds the placeID to the get tax rates params +func (o *GetTaxRatesParams) WithPlaceID(placeID *string) *GetTaxRatesParams { + o.SetPlaceID(placeID) + return o +} + +// SetPlaceID adds the placeId to the get tax rates params +func (o *GetTaxRatesParams) SetPlaceID(placeID *string) { + o.PlaceID = placeID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxRatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountyID != nil { + + // query param countyId + var qrCountyID string + if o.CountyID != nil { + qrCountyID = *o.CountyID + } + qCountyID := qrCountyID + if qCountyID != "" { + if err := r.SetQueryParam("countyId", qCountyID); err != nil { + return err + } + } + + } + + // query param journalDate + qrJournalDate := o.JournalDate + qJournalDate := qrJournalDate + if qJournalDate != "" { + if err := r.SetQueryParam("journalDate", qJournalDate); err != nil { + return err + } + } + + if o.PlaceID != nil { + + // query param placeId + var qrPlaceID string + if o.PlaceID != nil { + qrPlaceID = *o.PlaceID + } + qPlaceID := qrPlaceID + if qPlaceID != "" { + if err := r.SetQueryParam("placeId", qPlaceID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/tax_rate/get_tax_rates_responses.go b/api/geo/geo_client/tax_rate/get_tax_rates_responses.go new file mode 100644 index 0000000..66411cb --- /dev/null +++ b/api/geo/geo_client/tax_rate/get_tax_rates_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rate + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetTaxRatesReader is a Reader for the GetTaxRates structure. +type GetTaxRatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxRatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxRatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxRatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxRatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxRatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxRatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxRatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxRatesOK creates a GetTaxRatesOK with default headers values +func NewGetTaxRatesOK() *GetTaxRatesOK { + return &GetTaxRatesOK{} +} + +/*GetTaxRatesOK handles this case with default header values. + +Taxnexus Response with an array of Tax Rate records +*/ +type GetTaxRatesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.TaxRateResponse +} + +func (o *GetTaxRatesOK) Error() string { + return fmt.Sprintf("[GET /taxrates][%d] getTaxRatesOK %+v", 200, o.Payload) +} + +func (o *GetTaxRatesOK) GetPayload() *geo_models.TaxRateResponse { + return o.Payload +} + +func (o *GetTaxRatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.TaxRateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRatesUnauthorized creates a GetTaxRatesUnauthorized with default headers values +func NewGetTaxRatesUnauthorized() *GetTaxRatesUnauthorized { + return &GetTaxRatesUnauthorized{} +} + +/*GetTaxRatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxRatesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxrates][%d] getTaxRatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxRatesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRatesForbidden creates a GetTaxRatesForbidden with default headers values +func NewGetTaxRatesForbidden() *GetTaxRatesForbidden { + return &GetTaxRatesForbidden{} +} + +/*GetTaxRatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxRatesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRatesForbidden) Error() string { + return fmt.Sprintf("[GET /taxrates][%d] getTaxRatesForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxRatesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRatesNotFound creates a GetTaxRatesNotFound with default headers values +func NewGetTaxRatesNotFound() *GetTaxRatesNotFound { + return &GetTaxRatesNotFound{} +} + +/*GetTaxRatesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxRatesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRatesNotFound) Error() string { + return fmt.Sprintf("[GET /taxrates][%d] getTaxRatesNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxRatesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRatesUnprocessableEntity creates a GetTaxRatesUnprocessableEntity with default headers values +func NewGetTaxRatesUnprocessableEntity() *GetTaxRatesUnprocessableEntity { + return &GetTaxRatesUnprocessableEntity{} +} + +/*GetTaxRatesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxRatesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxrates][%d] getTaxRatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxRatesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxRatesInternalServerError creates a GetTaxRatesInternalServerError with default headers values +func NewGetTaxRatesInternalServerError() *GetTaxRatesInternalServerError { + return &GetTaxRatesInternalServerError{} +} + +/*GetTaxRatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxRatesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxRatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxrates][%d] getTaxRatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxRatesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxRatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/tax_rate/tax_rate_client.go b/api/geo/geo_client/tax_rate/tax_rate_client.go new file mode 100644 index 0000000..19616c4 --- /dev/null +++ b/api/geo/geo_client/tax_rate/tax_rate_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rate + +// 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 tax rate API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax rate API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTaxRateObservable(params *GetTaxRateObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxRateObservableOK, error) + + GetTaxRates(params *GetTaxRatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxRatesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTaxRateObservable gets taxrates in an observable array + + Returns a taxrate retrieval in a observable array +*/ +func (a *Client) GetTaxRateObservable(params *GetTaxRateObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxRateObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxRateObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxRateObservable", + Method: "GET", + PathPattern: "/taxrates/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxRateObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxRateObservableOK) + 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 getTaxRateObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxRates combineds tax rates + + Returns SALES TAX rates based on County or Place ID +*/ +func (a *Client) GetTaxRates(params *GetTaxRatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxRatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxRatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxRates", + Method: "GET", + PathPattern: "/taxrates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxRatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxRatesOK) + 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 getTaxRates: 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/geo/geo_client/tax_type/get_tax_types_observable_parameters.go b/api/geo/geo_client/tax_type/get_tax_types_observable_parameters.go new file mode 100644 index 0000000..3ed9a78 --- /dev/null +++ b/api/geo/geo_client/tax_type/get_tax_types_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type + +// 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" +) + +// NewGetTaxTypesObservableParams creates a new GetTaxTypesObservableParams object +// with the default values initialized. +func NewGetTaxTypesObservableParams() *GetTaxTypesObservableParams { + + return &GetTaxTypesObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxTypesObservableParamsWithTimeout creates a new GetTaxTypesObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxTypesObservableParamsWithTimeout(timeout time.Duration) *GetTaxTypesObservableParams { + + return &GetTaxTypesObservableParams{ + + timeout: timeout, + } +} + +// NewGetTaxTypesObservableParamsWithContext creates a new GetTaxTypesObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxTypesObservableParamsWithContext(ctx context.Context) *GetTaxTypesObservableParams { + + return &GetTaxTypesObservableParams{ + + Context: ctx, + } +} + +// NewGetTaxTypesObservableParamsWithHTTPClient creates a new GetTaxTypesObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxTypesObservableParamsWithHTTPClient(client *http.Client) *GetTaxTypesObservableParams { + + return &GetTaxTypesObservableParams{ + HTTPClient: client, + } +} + +/*GetTaxTypesObservableParams contains all the parameters to send to the API endpoint +for the get tax types observable operation typically these are written to a http.Request +*/ +type GetTaxTypesObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax types observable params +func (o *GetTaxTypesObservableParams) WithTimeout(timeout time.Duration) *GetTaxTypesObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax types observable params +func (o *GetTaxTypesObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax types observable params +func (o *GetTaxTypesObservableParams) WithContext(ctx context.Context) *GetTaxTypesObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax types observable params +func (o *GetTaxTypesObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax types observable params +func (o *GetTaxTypesObservableParams) WithHTTPClient(client *http.Client) *GetTaxTypesObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax types observable params +func (o *GetTaxTypesObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxTypesObservableParams) 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/geo/geo_client/tax_type/get_tax_types_observable_responses.go b/api/geo/geo_client/tax_type/get_tax_types_observable_responses.go new file mode 100644 index 0000000..33abac3 --- /dev/null +++ b/api/geo/geo_client/tax_type/get_tax_types_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetTaxTypesObservableReader is a Reader for the GetTaxTypesObservable structure. +type GetTaxTypesObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxTypesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxTypesObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxTypesObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxTypesObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxTypesObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxTypesObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxTypesObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxTypesObservableOK creates a GetTaxTypesObservableOK with default headers values +func NewGetTaxTypesObservableOK() *GetTaxTypesObservableOK { + return &GetTaxTypesObservableOK{} +} + +/*GetTaxTypesObservableOK handles this case with default header values. + +Observable array response to a taxtype retrieval +*/ +type GetTaxTypesObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.TaxType +} + +func (o *GetTaxTypesObservableOK) Error() string { + return fmt.Sprintf("[GET /taxtypes/observable][%d] getTaxTypesObservableOK %+v", 200, o.Payload) +} + +func (o *GetTaxTypesObservableOK) GetPayload() []*geo_models.TaxType { + return o.Payload +} + +func (o *GetTaxTypesObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesObservableUnauthorized creates a GetTaxTypesObservableUnauthorized with default headers values +func NewGetTaxTypesObservableUnauthorized() *GetTaxTypesObservableUnauthorized { + return &GetTaxTypesObservableUnauthorized{} +} + +/*GetTaxTypesObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxTypesObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxtypes/observable][%d] getTaxTypesObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxTypesObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesObservableForbidden creates a GetTaxTypesObservableForbidden with default headers values +func NewGetTaxTypesObservableForbidden() *GetTaxTypesObservableForbidden { + return &GetTaxTypesObservableForbidden{} +} + +/*GetTaxTypesObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxTypesObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesObservableForbidden) Error() string { + return fmt.Sprintf("[GET /taxtypes/observable][%d] getTaxTypesObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxTypesObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesObservableNotFound creates a GetTaxTypesObservableNotFound with default headers values +func NewGetTaxTypesObservableNotFound() *GetTaxTypesObservableNotFound { + return &GetTaxTypesObservableNotFound{} +} + +/*GetTaxTypesObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxTypesObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesObservableNotFound) Error() string { + return fmt.Sprintf("[GET /taxtypes/observable][%d] getTaxTypesObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxTypesObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesObservableUnprocessableEntity creates a GetTaxTypesObservableUnprocessableEntity with default headers values +func NewGetTaxTypesObservableUnprocessableEntity() *GetTaxTypesObservableUnprocessableEntity { + return &GetTaxTypesObservableUnprocessableEntity{} +} + +/*GetTaxTypesObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxTypesObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxtypes/observable][%d] getTaxTypesObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxTypesObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesObservableInternalServerError creates a GetTaxTypesObservableInternalServerError with default headers values +func NewGetTaxTypesObservableInternalServerError() *GetTaxTypesObservableInternalServerError { + return &GetTaxTypesObservableInternalServerError{} +} + +/*GetTaxTypesObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxTypesObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxtypes/observable][%d] getTaxTypesObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxTypesObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/tax_type/get_tax_types_parameters.go b/api/geo/geo_client/tax_type/get_tax_types_parameters.go new file mode 100644 index 0000000..4eebf40 --- /dev/null +++ b/api/geo/geo_client/tax_type/get_tax_types_parameters.go @@ -0,0 +1,471 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type + +// 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" +) + +// NewGetTaxTypesParams creates a new GetTaxTypesParams object +// with the default values initialized. +func NewGetTaxTypesParams() *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxTypesParamsWithTimeout creates a new GetTaxTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxTypesParamsWithTimeout(timeout time.Duration) *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + + timeout: timeout, + } +} + +// NewGetTaxTypesParamsWithContext creates a new GetTaxTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxTypesParamsWithContext(ctx context.Context) *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + + Context: ctx, + } +} + +// NewGetTaxTypesParamsWithHTTPClient creates a new GetTaxTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxTypesParamsWithHTTPClient(client *http.Client) *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + HTTPClient: client, + } +} + +/*GetTaxTypesParams contains all the parameters to send to the API endpoint +for the get tax types operation typically these are written to a http.Request +*/ +type GetTaxTypesParams struct { + + /*Active + Retrieve only active records? + + */ + Active *bool + /*Address + Postal Address URL encoded; partial addresses allowed + + */ + Address *string + /*CountryCode + The Country abbreviation (2 char) + + */ + CountryCode *string + /*County + The County Name + + */ + County *string + /*Date + Transaction date (defaults to current) + + */ + Date *string + /*Ids + Taxnexus Record Ids of the Tax Types in a JSON array url encoded + + */ + Ids *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*Place + The City name (must be accompanied by State) + + */ + Place *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + /*TaxTypeID + Taxnexus Record Id of the Tax Type + + */ + TaxTypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax types params +func (o *GetTaxTypesParams) WithTimeout(timeout time.Duration) *GetTaxTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax types params +func (o *GetTaxTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax types params +func (o *GetTaxTypesParams) WithContext(ctx context.Context) *GetTaxTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax types params +func (o *GetTaxTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax types params +func (o *GetTaxTypesParams) WithHTTPClient(client *http.Client) *GetTaxTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax types params +func (o *GetTaxTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get tax types params +func (o *GetTaxTypesParams) WithActive(active *bool) *GetTaxTypesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get tax types params +func (o *GetTaxTypesParams) SetActive(active *bool) { + o.Active = active +} + +// WithAddress adds the address to the get tax types params +func (o *GetTaxTypesParams) WithAddress(address *string) *GetTaxTypesParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the get tax types params +func (o *GetTaxTypesParams) SetAddress(address *string) { + o.Address = address +} + +// WithCountryCode adds the countryCode to the get tax types params +func (o *GetTaxTypesParams) WithCountryCode(countryCode *string) *GetTaxTypesParams { + o.SetCountryCode(countryCode) + return o +} + +// SetCountryCode adds the countryCode to the get tax types params +func (o *GetTaxTypesParams) SetCountryCode(countryCode *string) { + o.CountryCode = countryCode +} + +// WithCounty adds the county to the get tax types params +func (o *GetTaxTypesParams) WithCounty(county *string) *GetTaxTypesParams { + o.SetCounty(county) + return o +} + +// SetCounty adds the county to the get tax types params +func (o *GetTaxTypesParams) SetCounty(county *string) { + o.County = county +} + +// WithDate adds the date to the get tax types params +func (o *GetTaxTypesParams) WithDate(date *string) *GetTaxTypesParams { + o.SetDate(date) + return o +} + +// SetDate adds the date to the get tax types params +func (o *GetTaxTypesParams) SetDate(date *string) { + o.Date = date +} + +// WithIds adds the ids to the get tax types params +func (o *GetTaxTypesParams) WithIds(ids *string) *GetTaxTypesParams { + o.SetIds(ids) + return o +} + +// SetIds adds the ids to the get tax types params +func (o *GetTaxTypesParams) SetIds(ids *string) { + o.Ids = ids +} + +// WithLimit adds the limit to the get tax types params +func (o *GetTaxTypesParams) WithLimit(limit *int64) *GetTaxTypesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get tax types params +func (o *GetTaxTypesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get tax types params +func (o *GetTaxTypesParams) WithOffset(offset *int64) *GetTaxTypesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get tax types params +func (o *GetTaxTypesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlace adds the place to the get tax types params +func (o *GetTaxTypesParams) WithPlace(place *string) *GetTaxTypesParams { + o.SetPlace(place) + return o +} + +// SetPlace adds the place to the get tax types params +func (o *GetTaxTypesParams) SetPlace(place *string) { + o.Place = place +} + +// WithState adds the state to the get tax types params +func (o *GetTaxTypesParams) WithState(state *string) *GetTaxTypesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get tax types params +func (o *GetTaxTypesParams) SetState(state *string) { + o.State = state +} + +// WithTaxTypeID adds the taxTypeID to the get tax types params +func (o *GetTaxTypesParams) WithTaxTypeID(taxTypeID *string) *GetTaxTypesParams { + o.SetTaxTypeID(taxTypeID) + return o +} + +// SetTaxTypeID adds the taxTypeId to the get tax types params +func (o *GetTaxTypesParams) SetTaxTypeID(taxTypeID *string) { + o.TaxTypeID = taxTypeID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxTypesParams) 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.Address != nil { + + // query param address + var qrAddress string + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + + } + + if o.CountryCode != nil { + + // query param countryCode + var qrCountryCode string + if o.CountryCode != nil { + qrCountryCode = *o.CountryCode + } + qCountryCode := qrCountryCode + if qCountryCode != "" { + if err := r.SetQueryParam("countryCode", qCountryCode); err != nil { + return err + } + } + + } + + if o.County != nil { + + // query param county + var qrCounty string + if o.County != nil { + qrCounty = *o.County + } + qCounty := qrCounty + if qCounty != "" { + if err := r.SetQueryParam("county", qCounty); err != nil { + return err + } + } + + } + + if o.Date != nil { + + // query param date + var qrDate string + if o.Date != nil { + qrDate = *o.Date + } + qDate := qrDate + if qDate != "" { + if err := r.SetQueryParam("date", qDate); err != nil { + return err + } + } + + } + + if o.Ids != nil { + + // query param ids + var qrIds string + if o.Ids != nil { + qrIds = *o.Ids + } + qIds := qrIds + if qIds != "" { + if err := r.SetQueryParam("ids", qIds); 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.Place != nil { + + // query param place + var qrPlace string + if o.Place != nil { + qrPlace = *o.Place + } + qPlace := qrPlace + if qPlace != "" { + if err := r.SetQueryParam("place", qPlace); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if o.TaxTypeID != nil { + + // query param taxTypeId + var qrTaxTypeID string + if o.TaxTypeID != nil { + qrTaxTypeID = *o.TaxTypeID + } + qTaxTypeID := qrTaxTypeID + if qTaxTypeID != "" { + if err := r.SetQueryParam("taxTypeId", qTaxTypeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/tax_type/get_tax_types_responses.go b/api/geo/geo_client/tax_type/get_tax_types_responses.go new file mode 100644 index 0000000..498d79f --- /dev/null +++ b/api/geo/geo_client/tax_type/get_tax_types_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetTaxTypesReader is a Reader for the GetTaxTypes structure. +type GetTaxTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxTypesOK creates a GetTaxTypesOK with default headers values +func NewGetTaxTypesOK() *GetTaxTypesOK { + return &GetTaxTypesOK{} +} + +/*GetTaxTypesOK handles this case with default header values. + +Taxnexus Response with an array of Tax Type objects +*/ +type GetTaxTypesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.TaxTypeResponse +} + +func (o *GetTaxTypesOK) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesOK %+v", 200, o.Payload) +} + +func (o *GetTaxTypesOK) GetPayload() *geo_models.TaxTypeResponse { + return o.Payload +} + +func (o *GetTaxTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.TaxTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesUnauthorized creates a GetTaxTypesUnauthorized with default headers values +func NewGetTaxTypesUnauthorized() *GetTaxTypesUnauthorized { + return &GetTaxTypesUnauthorized{} +} + +/*GetTaxTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxTypesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxTypesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesForbidden creates a GetTaxTypesForbidden with default headers values +func NewGetTaxTypesForbidden() *GetTaxTypesForbidden { + return &GetTaxTypesForbidden{} +} + +/*GetTaxTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxTypesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesForbidden) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxTypesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesNotFound creates a GetTaxTypesNotFound with default headers values +func NewGetTaxTypesNotFound() *GetTaxTypesNotFound { + return &GetTaxTypesNotFound{} +} + +/*GetTaxTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxTypesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesNotFound) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxTypesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesUnprocessableEntity creates a GetTaxTypesUnprocessableEntity with default headers values +func NewGetTaxTypesUnprocessableEntity() *GetTaxTypesUnprocessableEntity { + return &GetTaxTypesUnprocessableEntity{} +} + +/*GetTaxTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxTypesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxTypesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesInternalServerError creates a GetTaxTypesInternalServerError with default headers values +func NewGetTaxTypesInternalServerError() *GetTaxTypesInternalServerError { + return &GetTaxTypesInternalServerError{} +} + +/*GetTaxTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxTypesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxTypesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/tax_type/post_tax_types_parameters.go b/api/geo/geo_client/tax_type/post_tax_types_parameters.go new file mode 100644 index 0000000..fdcb0a4 --- /dev/null +++ b/api/geo/geo_client/tax_type/post_tax_types_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostTaxTypesParams creates a new PostTaxTypesParams object +// with the default values initialized. +func NewPostTaxTypesParams() *PostTaxTypesParams { + var () + return &PostTaxTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxTypesParamsWithTimeout creates a new PostTaxTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxTypesParamsWithTimeout(timeout time.Duration) *PostTaxTypesParams { + var () + return &PostTaxTypesParams{ + + timeout: timeout, + } +} + +// NewPostTaxTypesParamsWithContext creates a new PostTaxTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxTypesParamsWithContext(ctx context.Context) *PostTaxTypesParams { + var () + return &PostTaxTypesParams{ + + Context: ctx, + } +} + +// NewPostTaxTypesParamsWithHTTPClient creates a new PostTaxTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxTypesParamsWithHTTPClient(client *http.Client) *PostTaxTypesParams { + var () + return &PostTaxTypesParams{ + HTTPClient: client, + } +} + +/*PostTaxTypesParams contains all the parameters to send to the API endpoint +for the post tax types operation typically these are written to a http.Request +*/ +type PostTaxTypesParams struct { + + /*TaxTypeRequest + The new Places request package + + */ + TaxTypeRequest *geo_models.TaxTypeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post tax types params +func (o *PostTaxTypesParams) WithTimeout(timeout time.Duration) *PostTaxTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post tax types params +func (o *PostTaxTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post tax types params +func (o *PostTaxTypesParams) WithContext(ctx context.Context) *PostTaxTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post tax types params +func (o *PostTaxTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post tax types params +func (o *PostTaxTypesParams) WithHTTPClient(client *http.Client) *PostTaxTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post tax types params +func (o *PostTaxTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaxTypeRequest adds the taxTypeRequest to the post tax types params +func (o *PostTaxTypesParams) WithTaxTypeRequest(taxTypeRequest *geo_models.TaxTypeRequest) *PostTaxTypesParams { + o.SetTaxTypeRequest(taxTypeRequest) + return o +} + +// SetTaxTypeRequest adds the taxTypeRequest to the post tax types params +func (o *PostTaxTypesParams) SetTaxTypeRequest(taxTypeRequest *geo_models.TaxTypeRequest) { + o.TaxTypeRequest = taxTypeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TaxTypeRequest != nil { + if err := r.SetBodyParam(o.TaxTypeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/tax_type/post_tax_types_responses.go b/api/geo/geo_client/tax_type/post_tax_types_responses.go new file mode 100644 index 0000000..14f1379 --- /dev/null +++ b/api/geo/geo_client/tax_type/post_tax_types_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostTaxTypesReader is a Reader for the PostTaxTypes structure. +type PostTaxTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTaxTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxTypesOK creates a PostTaxTypesOK with default headers values +func NewPostTaxTypesOK() *PostTaxTypesOK { + return &PostTaxTypesOK{} +} + +/*PostTaxTypesOK handles this case with default header values. + +Taxnexus Response with an array of Tax Type objects +*/ +type PostTaxTypesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.TaxTypeResponse +} + +func (o *PostTaxTypesOK) Error() string { + return fmt.Sprintf("[POST /taxtypes][%d] postTaxTypesOK %+v", 200, o.Payload) +} + +func (o *PostTaxTypesOK) GetPayload() *geo_models.TaxTypeResponse { + return o.Payload +} + +func (o *PostTaxTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.TaxTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypesUnauthorized creates a PostTaxTypesUnauthorized with default headers values +func NewPostTaxTypesUnauthorized() *PostTaxTypesUnauthorized { + return &PostTaxTypesUnauthorized{} +} + +/*PostTaxTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostTaxTypesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxTypesUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxtypes][%d] postTaxTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxTypesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypesForbidden creates a PostTaxTypesForbidden with default headers values +func NewPostTaxTypesForbidden() *PostTaxTypesForbidden { + return &PostTaxTypesForbidden{} +} + +/*PostTaxTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxTypesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxTypesForbidden) Error() string { + return fmt.Sprintf("[POST /taxtypes][%d] postTaxTypesForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxTypesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypesNotFound creates a PostTaxTypesNotFound with default headers values +func NewPostTaxTypesNotFound() *PostTaxTypesNotFound { + return &PostTaxTypesNotFound{} +} + +/*PostTaxTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxTypesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxTypesNotFound) Error() string { + return fmt.Sprintf("[POST /taxtypes][%d] postTaxTypesNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxTypesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypesUnprocessableEntity creates a PostTaxTypesUnprocessableEntity with default headers values +func NewPostTaxTypesUnprocessableEntity() *PostTaxTypesUnprocessableEntity { + return &PostTaxTypesUnprocessableEntity{} +} + +/*PostTaxTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTaxTypesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /taxtypes][%d] postTaxTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTaxTypesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypesInternalServerError creates a PostTaxTypesInternalServerError with default headers values +func NewPostTaxTypesInternalServerError() *PostTaxTypesInternalServerError { + return &PostTaxTypesInternalServerError{} +} + +/*PostTaxTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxTypesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxTypesInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxtypes][%d] postTaxTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxTypesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/tax_type/tax_type_client.go b/api/geo/geo_client/tax_type/tax_type_client.go new file mode 100644 index 0000000..a39b49c --- /dev/null +++ b/api/geo/geo_client/tax_type/tax_type_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type + +// 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 tax type API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax type API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTaxTypes(params *GetTaxTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypesOK, error) + + GetTaxTypesObservable(params *GetTaxTypesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypesObservableOK, error) + + PostTaxTypes(params *PostTaxTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxTypesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTaxTypes gets a list of tax types + + Return a list of tax types +*/ +func (a *Client) GetTaxTypes(params *GetTaxTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxTypes", + Method: "GET", + PathPattern: "/taxtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxTypesOK) + 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 getTaxTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxTypesObservable gets taxtypes in an observable array + + Returns a taxtype retrieval in a observable array +*/ +func (a *Client) GetTaxTypesObservable(params *GetTaxTypesObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypesObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxTypesObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxTypesObservable", + Method: "GET", + PathPattern: "/taxtypes/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxTypesObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxTypesObservableOK) + 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 getTaxTypesObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTaxTypes stores new tax type records + + Store a batch of new TaxType records +*/ +func (a *Client) PostTaxTypes(params *PostTaxTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxTypes", + Method: "POST", + PathPattern: "/taxtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxTypesOK) + 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 postTaxTypes: 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/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_parameters.go b/api/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_parameters.go new file mode 100644 index 0000000..af36d7d --- /dev/null +++ b/api/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_parameters.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_code + +// 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" +) + +// NewGetTaxnexusCodeObservableParams creates a new GetTaxnexusCodeObservableParams object +// with the default values initialized. +func NewGetTaxnexusCodeObservableParams() *GetTaxnexusCodeObservableParams { + var () + return &GetTaxnexusCodeObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxnexusCodeObservableParamsWithTimeout creates a new GetTaxnexusCodeObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxnexusCodeObservableParamsWithTimeout(timeout time.Duration) *GetTaxnexusCodeObservableParams { + var () + return &GetTaxnexusCodeObservableParams{ + + timeout: timeout, + } +} + +// NewGetTaxnexusCodeObservableParamsWithContext creates a new GetTaxnexusCodeObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxnexusCodeObservableParamsWithContext(ctx context.Context) *GetTaxnexusCodeObservableParams { + var () + return &GetTaxnexusCodeObservableParams{ + + Context: ctx, + } +} + +// NewGetTaxnexusCodeObservableParamsWithHTTPClient creates a new GetTaxnexusCodeObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxnexusCodeObservableParamsWithHTTPClient(client *http.Client) *GetTaxnexusCodeObservableParams { + var () + return &GetTaxnexusCodeObservableParams{ + HTTPClient: client, + } +} + +/*GetTaxnexusCodeObservableParams contains all the parameters to send to the API endpoint +for the get taxnexus code observable operation typically these are written to a http.Request +*/ +type GetTaxnexusCodeObservableParams struct { + + /*StateID + The ID of this Object + + */ + StateID *string + /*CountryCode + The Country abbreviation (2 char) + + */ + CountryCode *string + /*Geocode + The Geocode of this Place record + + */ + Geocode *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) WithTimeout(timeout time.Duration) *GetTaxnexusCodeObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) WithContext(ctx context.Context) *GetTaxnexusCodeObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) WithHTTPClient(client *http.Client) *GetTaxnexusCodeObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStateID adds the stateID to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) WithStateID(stateID *string) *GetTaxnexusCodeObservableParams { + o.SetStateID(stateID) + return o +} + +// SetStateID adds the stateId to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) SetStateID(stateID *string) { + o.StateID = stateID +} + +// WithCountryCode adds the countryCode to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) WithCountryCode(countryCode *string) *GetTaxnexusCodeObservableParams { + o.SetCountryCode(countryCode) + return o +} + +// SetCountryCode adds the countryCode to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) SetCountryCode(countryCode *string) { + o.CountryCode = countryCode +} + +// WithGeocode adds the geocode to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) WithGeocode(geocode *string) *GetTaxnexusCodeObservableParams { + o.SetGeocode(geocode) + return o +} + +// SetGeocode adds the geocode to the get taxnexus code observable params +func (o *GetTaxnexusCodeObservableParams) SetGeocode(geocode *string) { + o.Geocode = geocode +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxnexusCodeObservableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StateID != nil { + + // query param StateID + var qrStateID string + if o.StateID != nil { + qrStateID = *o.StateID + } + qStateID := qrStateID + if qStateID != "" { + if err := r.SetQueryParam("StateID", qStateID); err != nil { + return err + } + } + + } + + if o.CountryCode != nil { + + // query param countryCode + var qrCountryCode string + if o.CountryCode != nil { + qrCountryCode = *o.CountryCode + } + qCountryCode := qrCountryCode + if qCountryCode != "" { + if err := r.SetQueryParam("countryCode", qCountryCode); err != nil { + return err + } + } + + } + + if o.Geocode != nil { + + // query param geocode + var qrGeocode string + if o.Geocode != nil { + qrGeocode = *o.Geocode + } + qGeocode := qrGeocode + if qGeocode != "" { + if err := r.SetQueryParam("geocode", qGeocode); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_responses.go b/api/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_responses.go new file mode 100644 index 0000000..94ac268 --- /dev/null +++ b/api/geo/geo_client/taxnexus_code/get_taxnexus_code_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_code + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetTaxnexusCodeObservableReader is a Reader for the GetTaxnexusCodeObservable structure. +type GetTaxnexusCodeObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxnexusCodeObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxnexusCodeObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxnexusCodeObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxnexusCodeObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxnexusCodeObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxnexusCodeObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxnexusCodeObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxnexusCodeObservableOK creates a GetTaxnexusCodeObservableOK with default headers values +func NewGetTaxnexusCodeObservableOK() *GetTaxnexusCodeObservableOK { + return &GetTaxnexusCodeObservableOK{} +} + +/*GetTaxnexusCodeObservableOK handles this case with default header values. + +Observable array response to a Taxnexus Code retrieval +*/ +type GetTaxnexusCodeObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*geo_models.TaxnexusCode +} + +func (o *GetTaxnexusCodeObservableOK) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes/observable][%d] getTaxnexusCodeObservableOK %+v", 200, o.Payload) +} + +func (o *GetTaxnexusCodeObservableOK) GetPayload() []*geo_models.TaxnexusCode { + return o.Payload +} + +func (o *GetTaxnexusCodeObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodeObservableUnauthorized creates a GetTaxnexusCodeObservableUnauthorized with default headers values +func NewGetTaxnexusCodeObservableUnauthorized() *GetTaxnexusCodeObservableUnauthorized { + return &GetTaxnexusCodeObservableUnauthorized{} +} + +/*GetTaxnexusCodeObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxnexusCodeObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodeObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes/observable][%d] getTaxnexusCodeObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxnexusCodeObservableUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodeObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodeObservableForbidden creates a GetTaxnexusCodeObservableForbidden with default headers values +func NewGetTaxnexusCodeObservableForbidden() *GetTaxnexusCodeObservableForbidden { + return &GetTaxnexusCodeObservableForbidden{} +} + +/*GetTaxnexusCodeObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxnexusCodeObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodeObservableForbidden) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes/observable][%d] getTaxnexusCodeObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxnexusCodeObservableForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodeObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodeObservableNotFound creates a GetTaxnexusCodeObservableNotFound with default headers values +func NewGetTaxnexusCodeObservableNotFound() *GetTaxnexusCodeObservableNotFound { + return &GetTaxnexusCodeObservableNotFound{} +} + +/*GetTaxnexusCodeObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxnexusCodeObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodeObservableNotFound) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes/observable][%d] getTaxnexusCodeObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxnexusCodeObservableNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodeObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodeObservableUnprocessableEntity creates a GetTaxnexusCodeObservableUnprocessableEntity with default headers values +func NewGetTaxnexusCodeObservableUnprocessableEntity() *GetTaxnexusCodeObservableUnprocessableEntity { + return &GetTaxnexusCodeObservableUnprocessableEntity{} +} + +/*GetTaxnexusCodeObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxnexusCodeObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodeObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes/observable][%d] getTaxnexusCodeObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxnexusCodeObservableUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodeObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodeObservableInternalServerError creates a GetTaxnexusCodeObservableInternalServerError with default headers values +func NewGetTaxnexusCodeObservableInternalServerError() *GetTaxnexusCodeObservableInternalServerError { + return &GetTaxnexusCodeObservableInternalServerError{} +} + +/*GetTaxnexusCodeObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxnexusCodeObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodeObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes/observable][%d] getTaxnexusCodeObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxnexusCodeObservableInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodeObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/taxnexus_code/get_taxnexus_codes_parameters.go b/api/geo/geo_client/taxnexus_code/get_taxnexus_codes_parameters.go new file mode 100644 index 0000000..eb852a7 --- /dev/null +++ b/api/geo/geo_client/taxnexus_code/get_taxnexus_codes_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_code + +// 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" +) + +// NewGetTaxnexusCodesParams creates a new GetTaxnexusCodesParams object +// with the default values initialized. +func NewGetTaxnexusCodesParams() *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxnexusCodesParamsWithTimeout creates a new GetTaxnexusCodesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxnexusCodesParamsWithTimeout(timeout time.Duration) *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + + timeout: timeout, + } +} + +// NewGetTaxnexusCodesParamsWithContext creates a new GetTaxnexusCodesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxnexusCodesParamsWithContext(ctx context.Context) *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + + Context: ctx, + } +} + +// NewGetTaxnexusCodesParamsWithHTTPClient creates a new GetTaxnexusCodesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxnexusCodesParamsWithHTTPClient(client *http.Client) *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + HTTPClient: client, + } +} + +/*GetTaxnexusCodesParams contains all the parameters to send to the API endpoint +for the get taxnexus codes operation typically these are written to a http.Request +*/ +type GetTaxnexusCodesParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TaxnexusCodeID + Taxnexus Code ID + + */ + TaxnexusCodeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithTimeout(timeout time.Duration) *GetTaxnexusCodesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithContext(ctx context.Context) *GetTaxnexusCodesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithHTTPClient(client *http.Client) *GetTaxnexusCodesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithLimit(limit *int64) *GetTaxnexusCodesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithOffset(offset *int64) *GetTaxnexusCodesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithTaxnexusCodeID adds the taxnexusCodeID to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithTaxnexusCodeID(taxnexusCodeID *string) *GetTaxnexusCodesParams { + o.SetTaxnexusCodeID(taxnexusCodeID) + return o +} + +// SetTaxnexusCodeID adds the taxnexusCodeId to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetTaxnexusCodeID(taxnexusCodeID *string) { + o.TaxnexusCodeID = taxnexusCodeID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxnexusCodesParams) 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.TaxnexusCodeID != nil { + + // query param taxnexusCodeId + var qrTaxnexusCodeID string + if o.TaxnexusCodeID != nil { + qrTaxnexusCodeID = *o.TaxnexusCodeID + } + qTaxnexusCodeID := qrTaxnexusCodeID + if qTaxnexusCodeID != "" { + if err := r.SetQueryParam("taxnexusCodeId", qTaxnexusCodeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/taxnexus_code/get_taxnexus_codes_responses.go b/api/geo/geo_client/taxnexus_code/get_taxnexus_codes_responses.go new file mode 100644 index 0000000..b2e3e22 --- /dev/null +++ b/api/geo/geo_client/taxnexus_code/get_taxnexus_codes_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_code + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// GetTaxnexusCodesReader is a Reader for the GetTaxnexusCodes structure. +type GetTaxnexusCodesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxnexusCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxnexusCodesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxnexusCodesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxnexusCodesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxnexusCodesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxnexusCodesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxnexusCodesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxnexusCodesOK creates a GetTaxnexusCodesOK with default headers values +func NewGetTaxnexusCodesOK() *GetTaxnexusCodesOK { + return &GetTaxnexusCodesOK{} +} + +/*GetTaxnexusCodesOK handles this case with default header values. + +Taxnexus Response with an array of Taxnexus Codes +*/ +type GetTaxnexusCodesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.TaxnexusCodeResponse +} + +func (o *GetTaxnexusCodesOK) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesOK %+v", 200, o.Payload) +} + +func (o *GetTaxnexusCodesOK) GetPayload() *geo_models.TaxnexusCodeResponse { + return o.Payload +} + +func (o *GetTaxnexusCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.TaxnexusCodeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesUnauthorized creates a GetTaxnexusCodesUnauthorized with default headers values +func NewGetTaxnexusCodesUnauthorized() *GetTaxnexusCodesUnauthorized { + return &GetTaxnexusCodesUnauthorized{} +} + +/*GetTaxnexusCodesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxnexusCodesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodesUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxnexusCodesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesForbidden creates a GetTaxnexusCodesForbidden with default headers values +func NewGetTaxnexusCodesForbidden() *GetTaxnexusCodesForbidden { + return &GetTaxnexusCodesForbidden{} +} + +/*GetTaxnexusCodesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxnexusCodesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodesForbidden) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxnexusCodesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesNotFound creates a GetTaxnexusCodesNotFound with default headers values +func NewGetTaxnexusCodesNotFound() *GetTaxnexusCodesNotFound { + return &GetTaxnexusCodesNotFound{} +} + +/*GetTaxnexusCodesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxnexusCodesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodesNotFound) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxnexusCodesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesUnprocessableEntity creates a GetTaxnexusCodesUnprocessableEntity with default headers values +func NewGetTaxnexusCodesUnprocessableEntity() *GetTaxnexusCodesUnprocessableEntity { + return &GetTaxnexusCodesUnprocessableEntity{} +} + +/*GetTaxnexusCodesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxnexusCodesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxnexusCodesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesInternalServerError creates a GetTaxnexusCodesInternalServerError with default headers values +func NewGetTaxnexusCodesInternalServerError() *GetTaxnexusCodesInternalServerError { + return &GetTaxnexusCodesInternalServerError{} +} + +/*GetTaxnexusCodesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxnexusCodesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *GetTaxnexusCodesInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxnexusCodesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/taxnexus_code/post_taxnexus_codes_parameters.go b/api/geo/geo_client/taxnexus_code/post_taxnexus_codes_parameters.go new file mode 100644 index 0000000..a525c26 --- /dev/null +++ b/api/geo/geo_client/taxnexus_code/post_taxnexus_codes_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_code + +// 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/taxnexus/go/lib/api/geo/geo_models" +) + +// NewPostTaxnexusCodesParams creates a new PostTaxnexusCodesParams object +// with the default values initialized. +func NewPostTaxnexusCodesParams() *PostTaxnexusCodesParams { + var () + return &PostTaxnexusCodesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxnexusCodesParamsWithTimeout creates a new PostTaxnexusCodesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxnexusCodesParamsWithTimeout(timeout time.Duration) *PostTaxnexusCodesParams { + var () + return &PostTaxnexusCodesParams{ + + timeout: timeout, + } +} + +// NewPostTaxnexusCodesParamsWithContext creates a new PostTaxnexusCodesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxnexusCodesParamsWithContext(ctx context.Context) *PostTaxnexusCodesParams { + var () + return &PostTaxnexusCodesParams{ + + Context: ctx, + } +} + +// NewPostTaxnexusCodesParamsWithHTTPClient creates a new PostTaxnexusCodesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxnexusCodesParamsWithHTTPClient(client *http.Client) *PostTaxnexusCodesParams { + var () + return &PostTaxnexusCodesParams{ + HTTPClient: client, + } +} + +/*PostTaxnexusCodesParams contains all the parameters to send to the API endpoint +for the post taxnexus codes operation typically these are written to a http.Request +*/ +type PostTaxnexusCodesParams struct { + + /*TaxnexusCodeRequest + The new Places request package + + */ + TaxnexusCodeRequest *geo_models.TaxnexusCodeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) WithTimeout(timeout time.Duration) *PostTaxnexusCodesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) WithContext(ctx context.Context) *PostTaxnexusCodesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) WithHTTPClient(client *http.Client) *PostTaxnexusCodesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaxnexusCodeRequest adds the taxnexusCodeRequest to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) WithTaxnexusCodeRequest(taxnexusCodeRequest *geo_models.TaxnexusCodeRequest) *PostTaxnexusCodesParams { + o.SetTaxnexusCodeRequest(taxnexusCodeRequest) + return o +} + +// SetTaxnexusCodeRequest adds the taxnexusCodeRequest to the post taxnexus codes params +func (o *PostTaxnexusCodesParams) SetTaxnexusCodeRequest(taxnexusCodeRequest *geo_models.TaxnexusCodeRequest) { + o.TaxnexusCodeRequest = taxnexusCodeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxnexusCodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TaxnexusCodeRequest != nil { + if err := r.SetBodyParam(o.TaxnexusCodeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/geo/geo_client/taxnexus_code/post_taxnexus_codes_responses.go b/api/geo/geo_client/taxnexus_code/post_taxnexus_codes_responses.go new file mode 100644 index 0000000..82025be --- /dev/null +++ b/api/geo/geo_client/taxnexus_code/post_taxnexus_codes_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_code + +// 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" + + "github.com/taxnexus/go/lib/api/geo/geo_models" +) + +// PostTaxnexusCodesReader is a Reader for the PostTaxnexusCodes structure. +type PostTaxnexusCodesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxnexusCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxnexusCodesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxnexusCodesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxnexusCodesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxnexusCodesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTaxnexusCodesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxnexusCodesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxnexusCodesOK creates a PostTaxnexusCodesOK with default headers values +func NewPostTaxnexusCodesOK() *PostTaxnexusCodesOK { + return &PostTaxnexusCodesOK{} +} + +/*PostTaxnexusCodesOK handles this case with default header values. + +Taxnexus Response with an array of Taxnexus Codes +*/ +type PostTaxnexusCodesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *geo_models.TaxnexusCodeResponse +} + +func (o *PostTaxnexusCodesOK) Error() string { + return fmt.Sprintf("[POST /taxnexuscodes][%d] postTaxnexusCodesOK %+v", 200, o.Payload) +} + +func (o *PostTaxnexusCodesOK) GetPayload() *geo_models.TaxnexusCodeResponse { + return o.Payload +} + +func (o *PostTaxnexusCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(geo_models.TaxnexusCodeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxnexusCodesUnauthorized creates a PostTaxnexusCodesUnauthorized with default headers values +func NewPostTaxnexusCodesUnauthorized() *PostTaxnexusCodesUnauthorized { + return &PostTaxnexusCodesUnauthorized{} +} + +/*PostTaxnexusCodesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostTaxnexusCodesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxnexusCodesUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxnexuscodes][%d] postTaxnexusCodesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxnexusCodesUnauthorized) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxnexusCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxnexusCodesForbidden creates a PostTaxnexusCodesForbidden with default headers values +func NewPostTaxnexusCodesForbidden() *PostTaxnexusCodesForbidden { + return &PostTaxnexusCodesForbidden{} +} + +/*PostTaxnexusCodesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxnexusCodesForbidden struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxnexusCodesForbidden) Error() string { + return fmt.Sprintf("[POST /taxnexuscodes][%d] postTaxnexusCodesForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxnexusCodesForbidden) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxnexusCodesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxnexusCodesNotFound creates a PostTaxnexusCodesNotFound with default headers values +func NewPostTaxnexusCodesNotFound() *PostTaxnexusCodesNotFound { + return &PostTaxnexusCodesNotFound{} +} + +/*PostTaxnexusCodesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxnexusCodesNotFound struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxnexusCodesNotFound) Error() string { + return fmt.Sprintf("[POST /taxnexuscodes][%d] postTaxnexusCodesNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxnexusCodesNotFound) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxnexusCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxnexusCodesUnprocessableEntity creates a PostTaxnexusCodesUnprocessableEntity with default headers values +func NewPostTaxnexusCodesUnprocessableEntity() *PostTaxnexusCodesUnprocessableEntity { + return &PostTaxnexusCodesUnprocessableEntity{} +} + +/*PostTaxnexusCodesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTaxnexusCodesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxnexusCodesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /taxnexuscodes][%d] postTaxnexusCodesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTaxnexusCodesUnprocessableEntity) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxnexusCodesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxnexusCodesInternalServerError creates a PostTaxnexusCodesInternalServerError with default headers values +func NewPostTaxnexusCodesInternalServerError() *PostTaxnexusCodesInternalServerError { + return &PostTaxnexusCodesInternalServerError{} +} + +/*PostTaxnexusCodesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxnexusCodesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *geo_models.Error +} + +func (o *PostTaxnexusCodesInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxnexuscodes][%d] postTaxnexusCodesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxnexusCodesInternalServerError) GetPayload() *geo_models.Error { + return o.Payload +} + +func (o *PostTaxnexusCodesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(geo_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/geo/geo_client/taxnexus_code/taxnexus_code_client.go b/api/geo/geo_client/taxnexus_code/taxnexus_code_client.go new file mode 100644 index 0000000..f8b5df5 --- /dev/null +++ b/api/geo/geo_client/taxnexus_code/taxnexus_code_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_code + +// 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 taxnexus code API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for taxnexus code API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTaxnexusCodeObservable(params *GetTaxnexusCodeObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxnexusCodeObservableOK, error) + + GetTaxnexusCodes(params *GetTaxnexusCodesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxnexusCodesOK, error) + + PostTaxnexusCodes(params *PostTaxnexusCodesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxnexusCodesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTaxnexusCodeObservable gets taxnexuscodes in an observable array + + Returns a taxnexuscode retrieval in a observable array +*/ +func (a *Client) GetTaxnexusCodeObservable(params *GetTaxnexusCodeObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxnexusCodeObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxnexusCodeObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxnexusCodeObservable", + Method: "GET", + PathPattern: "/taxnexuscodes/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxnexusCodeObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxnexusCodeObservableOK) + 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 getTaxnexusCodeObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxnexusCodes gets a list of taxnexus codes + + Return a list of TaxnexusCodes +*/ +func (a *Client) GetTaxnexusCodes(params *GetTaxnexusCodesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxnexusCodesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxnexusCodesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxnexusCodes", + Method: "GET", + PathPattern: "/taxnexuscodes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxnexusCodesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxnexusCodesOK) + 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 getTaxnexusCodes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTaxnexusCodes stores new taxnexus code records + + Store a batch of new TaxnexusCode records +*/ +func (a *Client) PostTaxnexusCodes(params *PostTaxnexusCodesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxnexusCodesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxnexusCodesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxnexusCodes", + Method: "POST", + PathPattern: "/taxnexuscodes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxnexusCodesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxnexusCodesOK) + 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 postTaxnexusCodes: 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/geo/geo_models/address.go b/api/geo/geo_models/address.go new file mode 100644 index 0000000..e94f1ee --- /dev/null +++ b/api/geo/geo_models/address.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/geo/geo_models/coordinate.go b/api/geo/geo_models/coordinate.go new file mode 100644 index 0000000..e773d3a --- /dev/null +++ b/api/geo/geo_models/coordinate.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Coordinate coordinate +// +// swagger:model Coordinate +type Coordinate struct { + + // Geocoder Country + Country string `json:"Country,omitempty"` + + // Taxnexus Country ID + CountryID string `json:"CountryID,omitempty"` + + // Geocoder County + County string `json:"County,omitempty"` + + // Taxnexus County ID + CountyID string `json:"CountyID,omitempty"` + + // Situs Focus for tax determination + Focus string `json:"Focus,omitempty"` + + // Formatted Address from Geocoder + FormattedAddress string `json:"FormattedAddress,omitempty"` + + // Taxnexus Coordinate Record Id + ID string `json:"ID,omitempty"` + + // Situs Incorporated District? + IsDistrict bool `json:"IsDistrict,omitempty"` + + // Latitude of coordinate + Latitude float64 `json:"Latitude,omitempty"` + + // Longitude of coordinate + Longitude float64 `json:"Longitude,omitempty"` + + // Google map image + // Format: byte + Map strfmt.Base64 `json:"Map,omitempty"` + + // Coordinate Name from Search Text + Name string `json:"Name,omitempty"` + + // Geocoder Neighborhood + Neighborhood string `json:"Neighborhood,omitempty"` + + // Geocoder Place + Place string `json:"Place,omitempty"` + + // The Taxnexus Geocode for this rated location (place or county) + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // Taxnexus Place ID + PlaceID string `json:"PlaceID,omitempty"` + + // Geocoder Postal Code + PostalCode string `json:"PostalCode,omitempty"` + + // External System reference ID + Ref string `json:"Ref,omitempty"` + + // Geocoder State/Province name + State string `json:"State,omitempty"` + + // Taxnexus State ID + StateID string `json:"StateID,omitempty"` + + // The Status of the coordinate in Taxnexus + Status string `json:"Status,omitempty"` + + // Geocoder Street Name (only) + Street string `json:"Street,omitempty"` + + // Geocoder Streen number + StreetNumber string `json:"StreetNumber,omitempty"` + + // Google street view image + // Format: byte + StreetView strfmt.Base64 `json:"StreetView,omitempty"` + + // tax rate + TaxRate *TaxRate `json:"TaxRate,omitempty"` + + // tax types + TaxTypes []*TaxType `json:"TaxTypes"` +} + +// Validate validates this coordinate +func (m *Coordinate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxRate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTypes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Coordinate) validateTaxRate(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxRate) { // not required + return nil + } + + if m.TaxRate != nil { + if err := m.TaxRate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxRate") + } + return err + } + } + + return nil +} + +func (m *Coordinate) validateTaxTypes(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTypes) { // not required + return nil + } + + for i := 0; i < len(m.TaxTypes); i++ { + if swag.IsZero(m.TaxTypes[i]) { // not required + continue + } + + if m.TaxTypes[i] != nil { + if err := m.TaxTypes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTypes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Coordinate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Coordinate) UnmarshalBinary(b []byte) error { + var res Coordinate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/coordinate_basic.go b/api/geo/geo_models/coordinate_basic.go new file mode 100644 index 0000000..b8cec3b --- /dev/null +++ b/api/geo/geo_models/coordinate_basic.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoordinateBasic Minimized version of full Coordinate record; should contain just enough data for tax rating purposes +// +// swagger:model CoordinateBasic +type CoordinateBasic struct { + + // Taxnexus Country ID + CountryID string `json:"CountryID,omitempty"` + + // Taxnexus County ID + CountyID string `json:"CountyID,omitempty"` + + // Situs Focus for tax determination + Focus string `json:"Focus,omitempty"` + + // Taxnexus Coordinate Record Id + ID string `json:"ID,omitempty"` + + // Situs Incorporated District? + IsDistrict bool `json:"IsDistrict,omitempty"` + + // Coordinate Name from Search Text + Name string `json:"Name,omitempty"` + + // The Taxnexus Geocode for this rated location (place or county) + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // Taxnexus Place ID + PlaceID string `json:"PlaceID,omitempty"` + + // External System reference ID + Ref string `json:"Ref,omitempty"` + + // Taxnexus State ID + StateID string `json:"StateID,omitempty"` + + // tax types + TaxTypes []*TaxTypeID `json:"TaxTypes"` +} + +// Validate validates this coordinate basic +func (m *CoordinateBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxTypes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CoordinateBasic) validateTaxTypes(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTypes) { // not required + return nil + } + + for i := 0; i < len(m.TaxTypes); i++ { + if swag.IsZero(m.TaxTypes[i]) { // not required + continue + } + + if m.TaxTypes[i] != nil { + if err := m.TaxTypes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTypes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CoordinateBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateBasic) UnmarshalBinary(b []byte) error { + var res CoordinateBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/coordinate_basic_response.go b/api/geo/geo_models/coordinate_basic_response.go new file mode 100644 index 0000000..70f559b --- /dev/null +++ b/api/geo/geo_models/coordinate_basic_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoordinateBasicResponse An array of Coordinate objects +// +// swagger:model CoordinateBasicResponse +type CoordinateBasicResponse struct { + + // data + Data []*CoordinateBasic `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this coordinate basic response +func (m *CoordinateBasicResponse) 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 *CoordinateBasicResponse) 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 *CoordinateBasicResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CoordinateBasicResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateBasicResponse) UnmarshalBinary(b []byte) error { + var res CoordinateBasicResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/coordinate_request.go b/api/geo/geo_models/coordinate_request.go new file mode 100644 index 0000000..5e1e2b5 --- /dev/null +++ b/api/geo/geo_models/coordinate_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoordinateRequest An array of Coordinate Request Items +// +// swagger:model CoordinateRequest +type CoordinateRequest struct { + + // data + Data []*CoordinateRequestItem `json:"Data"` +} + +// Validate validates this coordinate request +func (m *CoordinateRequest) 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 *CoordinateRequest) 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 +} + +// MarshalBinary interface implementation +func (m *CoordinateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateRequest) UnmarshalBinary(b []byte) error { + var res CoordinateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/coordinate_request_item.go b/api/geo/geo_models/coordinate_request_item.go new file mode 100644 index 0000000..b8403ef --- /dev/null +++ b/api/geo/geo_models/coordinate_request_item.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoordinateRequestItem A single Coordinate Request item +// +// swagger:model CoordinateRequestItem +type CoordinateRequestItem struct { + + // The address to be translated + Address string `json:"Address,omitempty"` + + // Source record reference + Ref string `json:"Ref,omitempty"` +} + +// Validate validates this coordinate request item +func (m *CoordinateRequestItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CoordinateRequestItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateRequestItem) UnmarshalBinary(b []byte) error { + var res CoordinateRequestItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/coordinate_response.go b/api/geo/geo_models/coordinate_response.go new file mode 100644 index 0000000..7ac8881 --- /dev/null +++ b/api/geo/geo_models/coordinate_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoordinateResponse An array of Coordinate objects +// +// swagger:model CoordinateResponse +type CoordinateResponse struct { + + // data + Data []*Coordinate `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this coordinate response +func (m *CoordinateResponse) 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 *CoordinateResponse) 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 *CoordinateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CoordinateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateResponse) UnmarshalBinary(b []byte) error { + var res CoordinateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/country.go b/api/geo/geo_models/country.go new file mode 100644 index 0000000..89551b1 --- /dev/null +++ b/api/geo/geo_models/country.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Country country +// +// swagger:model Country +type Country struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Rollup Amount + Amount float64 `json:"Amount,omitempty"` + + // Code + Code string `json:"Code,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Enrollment Status + EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Interest + Interest float64 `json:"Interest,omitempty"` + + // Latitude of the center of this geographic entity + Latitude float64 `json:"Latitude,omitempty"` + + // Longitude of the center of this geographic entity + Longitude float64 `json:"Longitude,omitempty"` + + // Country Name + Name string `json:"Name,omitempty"` + + // Penalty + Penalty float64 `json:"Penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Reported Adjustments + ReportedAdjustments float64 `json:"ReportedAdjustments,omitempty"` + + // Reported Deductions + ReportedDeductions float64 `json:"ReportedDeductions,omitempty"` + + // Reported Net Revenue + ReportedNetRevenue float64 `json:"ReportedNetRevenue,omitempty"` + + // Reported Rate + ReportedRate float64 `json:"ReportedRate,omitempty"` + + // Reported Revenue + ReportedRevenue float64 `json:"ReportedRevenue,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"` + + // Document Status + Status string `json:"Status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"Subtotal,omitempty"` + + // tax instances + TaxInstances []*TaxInstance `json:"TaxInstances"` + + // Template + TemplateID string `json:"TemplateID,omitempty"` + + // Total Amount + TotalAmount float64 `json:"TotalAmount,omitempty"` + + // Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` +} + +// Validate validates this country +func (m *Country) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Country) validateTaxInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxInstances) { // not required + return nil + } + + for i := 0; i < len(m.TaxInstances); i++ { + if swag.IsZero(m.TaxInstances[i]) { // not required + continue + } + + if m.TaxInstances[i] != nil { + if err := m.TaxInstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Country) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Country) UnmarshalBinary(b []byte) error { + var res Country + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/country_request.go b/api/geo/geo_models/country_request.go new file mode 100644 index 0000000..6d3e8ee --- /dev/null +++ b/api/geo/geo_models/country_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CountryRequest An array of Country objects +// +// swagger:model CountryRequest +type CountryRequest struct { + + // data + Data []*Country `json:"Data"` +} + +// Validate validates this country request +func (m *CountryRequest) 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 *CountryRequest) 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 +} + +// MarshalBinary interface implementation +func (m *CountryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CountryRequest) UnmarshalBinary(b []byte) error { + var res CountryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/country_response.go b/api/geo/geo_models/country_response.go new file mode 100644 index 0000000..dc305ce --- /dev/null +++ b/api/geo/geo_models/country_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CountryResponse An array of Country objects +// +// swagger:model CountryResponse +type CountryResponse struct { + + // data + Data []*Country `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this country response +func (m *CountryResponse) 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 *CountryResponse) 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 *CountryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CountryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CountryResponse) UnmarshalBinary(b []byte) error { + var res CountryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/county.go b/api/geo/geo_models/county.go new file mode 100644 index 0000000..50ae8b3 --- /dev/null +++ b/api/geo/geo_models/county.go @@ -0,0 +1,220 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// County county +// +// swagger:model County +type County struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Rollup Amount + Amount float64 `json:"Amount,omitempty"` + + // AreaDescription + AreaDescription string `json:"AreaDescription,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Country Taxnexus ID + CountryID string `json:"CountryID,omitempty"` + + // Enrollment Status + EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` + + // FIPS + FIPS string `json:"FIPS,omitempty"` + + // FIPS Class + FIPSclass string `json:"FIPSclass,omitempty"` + + // Functional Status + FunctionalStatus string `json:"FunctionalStatus,omitempty"` + + // GNIS Code + GNIS int64 `json:"GNIS,omitempty"` + + // Geocode + Geocode string `json:"Geocode,omitempty"` + + // True if this County has it's own District Sales Taxes + HasDistrictTaxes bool `json:"HasDistrictTaxes,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Interest + Interest float64 `json:"Interest,omitempty"` + + // Land Area + LandArea int64 `json:"LandArea,omitempty"` + + // Latitude of the center of this geographic entity + Latitude float64 `json:"Latitude,omitempty"` + + // Legal Name + LegalName string `json:"LegalName,omitempty"` + + // Longitude of the center of this geographic entity + Longitude float64 `json:"Longitude,omitempty"` + + // County Name + Name string `json:"Name,omitempty"` + + // Penalty + Penalty float64 `json:"Penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Reported Adjustments + ReportedAdjustments float64 `json:"ReportedAdjustments,omitempty"` + + // Reported Deductions + ReportedDeductions float64 `json:"ReportedDeductions,omitempty"` + + // Reported Net Revenue + ReportedNetRevenue float64 `json:"ReportedNetRevenue,omitempty"` + + // Reported Rate + ReportedRate float64 `json:"ReportedRate,omitempty"` + + // Reported Revenue + ReportedRevenue float64 `json:"ReportedRevenue,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"` + + // sales tax rate + SalesTaxRate *TaxRate `json:"SalesTaxRate,omitempty"` + + // State + StateID string `json:"StateID,omitempty"` + + // Document Status + Status string `json:"Status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"Subtotal,omitempty"` + + // tax instances + TaxInstances []*TaxInstance `json:"TaxInstances"` + + // Print Template ID + TemplateID string `json:"TemplateID,omitempty"` + + // Total Amount + TotalAmount float64 `json:"TotalAmount,omitempty"` + + // Total Area + TotalArea int64 `json:"TotalArea,omitempty"` + + // Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` + + // Water Area + WaterArea int64 `json:"WaterArea,omitempty"` +} + +// Validate validates this county +func (m *County) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSalesTaxRate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *County) validateSalesTaxRate(formats strfmt.Registry) error { + + if swag.IsZero(m.SalesTaxRate) { // not required + return nil + } + + if m.SalesTaxRate != nil { + if err := m.SalesTaxRate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SalesTaxRate") + } + return err + } + } + + return nil +} + +func (m *County) validateTaxInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxInstances) { // not required + return nil + } + + for i := 0; i < len(m.TaxInstances); i++ { + if swag.IsZero(m.TaxInstances[i]) { // not required + continue + } + + if m.TaxInstances[i] != nil { + if err := m.TaxInstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *County) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *County) UnmarshalBinary(b []byte) error { + var res County + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/county_request.go b/api/geo/geo_models/county_request.go new file mode 100644 index 0000000..f2e14af --- /dev/null +++ b/api/geo/geo_models/county_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CountyRequest An array of County objects +// +// swagger:model CountyRequest +type CountyRequest struct { + + // data + Data []*County `json:"Data"` +} + +// Validate validates this county request +func (m *CountyRequest) 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 *CountyRequest) 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 +} + +// MarshalBinary interface implementation +func (m *CountyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CountyRequest) UnmarshalBinary(b []byte) error { + var res CountyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/county_response.go b/api/geo/geo_models/county_response.go new file mode 100644 index 0000000..b704c69 --- /dev/null +++ b/api/geo/geo_models/county_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CountyResponse An array of County objects +// +// swagger:model CountyResponse +type CountyResponse struct { + + // data + Data []*County `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this county response +func (m *CountyResponse) 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 *CountyResponse) 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 *CountyResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CountyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CountyResponse) UnmarshalBinary(b []byte) error { + var res CountyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/delete_response.go b/api/geo/geo_models/delete_response.go new file mode 100644 index 0000000..77545ca --- /dev/null +++ b/api/geo/geo_models/delete_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/geo/geo_models/domain.go b/api/geo/geo_models/domain.go new file mode 100644 index 0000000..b39a92d --- /dev/null +++ b/api/geo/geo_models/domain.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Domain domain +// +// swagger:model Domain +type Domain struct { + + // Active + Active bool `json:"Active,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Domain Name + Name string `json:"Name,omitempty"` +} + +// Validate validates this domain +func (m *Domain) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Domain) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Domain) UnmarshalBinary(b []byte) error { + var res Domain + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/domain_request.go b/api/geo/geo_models/domain_request.go new file mode 100644 index 0000000..cdf637c --- /dev/null +++ b/api/geo/geo_models/domain_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainRequest An array of Domain objects +// +// swagger:model DomainRequest +type DomainRequest struct { + + // data + Data []*Domain `json:"Data"` +} + +// Validate validates this domain request +func (m *DomainRequest) 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 *DomainRequest) 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 +} + +// MarshalBinary interface implementation +func (m *DomainRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainRequest) UnmarshalBinary(b []byte) error { + var res DomainRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/domain_response.go b/api/geo/geo_models/domain_response.go new file mode 100644 index 0000000..45ed167 --- /dev/null +++ b/api/geo/geo_models/domain_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainResponse An array of Domain objects +// +// swagger:model DomainResponse +type DomainResponse struct { + + // data + Data []*Domain `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this domain response +func (m *DomainResponse) 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 *DomainResponse) 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 *DomainResponse) 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 +} + +// MarshalBinary interface implementation +func (m *DomainResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainResponse) UnmarshalBinary(b []byte) error { + var res DomainResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/error.go b/api/geo/geo_models/error.go new file mode 100644 index 0000000..cd032f9 --- /dev/null +++ b/api/geo/geo_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/geo/geo_models/invalid_error.go b/api/geo/geo_models/invalid_error.go new file mode 100644 index 0000000..6e07eaa --- /dev/null +++ b/api/geo/geo_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/geo/geo_models/message.go b/api/geo/geo_models/message.go new file mode 100644 index 0000000..f9bb1a0 --- /dev/null +++ b/api/geo/geo_models/message.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/geo/geo_models/pagination.go b/api/geo/geo_models/pagination.go new file mode 100644 index 0000000..70bbe4d --- /dev/null +++ b/api/geo/geo_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/geo/geo_models/place.go b/api/geo/geo_models/place.go new file mode 100644 index 0000000..b8738d2 --- /dev/null +++ b/api/geo/geo_models/place.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Place place +// +// swagger:model Place +type Place struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Account Validation + AccountValidation string `json:"AccountValidation,omitempty"` + + // Rollup Amount + Amount float64 `json:"Amount,omitempty"` + + // AreaDescription + AreaDescription string `json:"AreaDescription,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // country ID + CountryID string `json:"CountryID,omitempty"` + + // County + CountyID string `json:"CountyID,omitempty"` + + // Enrollment Status + EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` + + // FIPS + FIPS string `json:"FIPS,omitempty"` + + // FIPS Class + FIPSclass string `json:"FIPSclass,omitempty"` + + // Functional Status + FunctionalStatus string `json:"FunctionalStatus,omitempty"` + + // GNIS + GNIS int64 `json:"GNIS,omitempty"` + + // Geocode + Geocode string `json:"Geocode,omitempty"` + + // True if this Place has it's own District Sales HasDistrictTaxes + HasDistrictTaxes bool `json:"HasDistrictTaxes,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Interest + Interest float64 `json:"Interest,omitempty"` + + // Land Area + LandArea int64 `json:"LandArea,omitempty"` + + // Latitude of the center of this geographic entity + Latitude float64 `json:"Latitude,omitempty"` + + // Legal Name + LegalName string `json:"LegalName,omitempty"` + + // Longitude of the center of this geographic entity + Longitude float64 `json:"Longitude,omitempty"` + + // Place Name + Name string `json:"Name,omitempty"` + + // Penalty + Penalty float64 `json:"Penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Reported Adjustments + ReportedAdjustments float64 `json:"ReportedAdjustments,omitempty"` + + // Reported Deductions + ReportedDeductions float64 `json:"ReportedDeductions,omitempty"` + + // Reported Net Revenue + ReportedNetRevenue float64 `json:"ReportedNetRevenue,omitempty"` + + // Reported Rate + ReportedRate float64 `json:"ReportedRate,omitempty"` + + // Reported Revenue + ReportedRevenue float64 `json:"ReportedRevenue,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"` + + // sales tax rate + SalesTaxRate *TaxRate `json:"SalesTaxRate,omitempty"` + + // State + StateID string `json:"StateID,omitempty"` + + // Document Status + Status string `json:"Status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"Subtotal,omitempty"` + + // tax instances + TaxInstances []*TaxInstance `json:"TaxInstances"` + + // Template + TemplateID string `json:"TemplateID,omitempty"` + + // Total Amount + TotalAmount float64 `json:"TotalAmount,omitempty"` + + // Total Area + TotalArea int64 `json:"TotalArea,omitempty"` + + // Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` + + // Water Area + WaterArea int64 `json:"WaterArea,omitempty"` +} + +// Validate validates this place +func (m *Place) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSalesTaxRate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Place) validateSalesTaxRate(formats strfmt.Registry) error { + + if swag.IsZero(m.SalesTaxRate) { // not required + return nil + } + + if m.SalesTaxRate != nil { + if err := m.SalesTaxRate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SalesTaxRate") + } + return err + } + } + + return nil +} + +func (m *Place) validateTaxInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxInstances) { // not required + return nil + } + + for i := 0; i < len(m.TaxInstances); i++ { + if swag.IsZero(m.TaxInstances[i]) { // not required + continue + } + + if m.TaxInstances[i] != nil { + if err := m.TaxInstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Place) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Place) UnmarshalBinary(b []byte) error { + var res Place + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/place_request.go b/api/geo/geo_models/place_request.go new file mode 100644 index 0000000..91e5f38 --- /dev/null +++ b/api/geo/geo_models/place_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlaceRequest An array of Place objects +// +// swagger:model PlaceRequest +type PlaceRequest struct { + + // data + Data []*Place `json:"Data"` +} + +// Validate validates this place request +func (m *PlaceRequest) 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 *PlaceRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PlaceRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlaceRequest) UnmarshalBinary(b []byte) error { + var res PlaceRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/place_response.go b/api/geo/geo_models/place_response.go new file mode 100644 index 0000000..7a0d762 --- /dev/null +++ b/api/geo/geo_models/place_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlaceResponse An array of Place objects +// +// swagger:model PlaceResponse +type PlaceResponse struct { + + // data + Data []*Place `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this place response +func (m *PlaceResponse) 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 *PlaceResponse) 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 *PlaceResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PlaceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlaceResponse) UnmarshalBinary(b []byte) error { + var res PlaceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/request_meta.go b/api/geo/geo_models/request_meta.go new file mode 100644 index 0000000..aec5265 --- /dev/null +++ b/api/geo/geo_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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/geo/geo_models/response_meta.go b/api/geo/geo_models/response_meta.go new file mode 100644 index 0000000..96a40d6 --- /dev/null +++ b/api/geo/geo_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/geo/geo_models/state.go b/api/geo/geo_models/state.go new file mode 100644 index 0000000..bedcf06 --- /dev/null +++ b/api/geo/geo_models/state.go @@ -0,0 +1,189 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// State state +// +// swagger:model State +type State struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Rollup Amount + Amount float64 `json:"Amount,omitempty"` + + // State Code + Code string `json:"Code,omitempty"` + + // Contact + ContactID string `json:"ContactID,omitempty"` + + // Country + CountryID string `json:"CountryID,omitempty"` + + // Division + Division string `json:"Division,omitempty"` + + // Enrollment Status + EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` + + // FIPS + FIPS string `json:"FIPS,omitempty"` + + // GNIS + GNIS int64 `json:"GNIS,omitempty"` + + // State Geocode + Geocode string `json:"Geocode,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Interest + Interest float64 `json:"Interest,omitempty"` + + // Land Area + LandArea int64 `json:"LandArea,omitempty"` + + // Latitude of the center of this geographic entity + Latitude float64 `json:"Latitude,omitempty"` + + // Longitude of the center of this geographic entity + Longitude float64 `json:"Longitude,omitempty"` + + // State Name + Name string `json:"Name,omitempty"` + + // Penalty + Penalty float64 `json:"Penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Region + Region string `json:"Region,omitempty"` + + // Reported Adjustments + ReportedAdjustments float64 `json:"ReportedAdjustments,omitempty"` + + // Reported Deductions + ReportedDeductions float64 `json:"ReportedDeductions,omitempty"` + + // Reported Net Revenue + ReportedNetRevenue float64 `json:"ReportedNetRevenue,omitempty"` + + // Reported Rate + ReportedRate float64 `json:"ReportedRate,omitempty"` + + // Reported Revenue + ReportedRevenue float64 `json:"ReportedRevenue,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"` + + // SGC + SGC string `json:"SGC,omitempty"` + + // Document Status + Status string `json:"Status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"Subtotal,omitempty"` + + // tax instances + TaxInstances []*TaxInstance `json:"TaxInstances"` + + // Template + TemplateID string `json:"TemplateID,omitempty"` + + // Total Amount + TotalAmount float64 `json:"TotalAmount,omitempty"` + + // Total Area + TotalArea int64 `json:"TotalArea,omitempty"` + + // Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` + + // Water Area + WaterArea int64 `json:"WaterArea,omitempty"` +} + +// Validate validates this state +func (m *State) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *State) validateTaxInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxInstances) { // not required + return nil + } + + for i := 0; i < len(m.TaxInstances); i++ { + if swag.IsZero(m.TaxInstances[i]) { // not required + continue + } + + if m.TaxInstances[i] != nil { + if err := m.TaxInstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxInstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *State) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *State) UnmarshalBinary(b []byte) error { + var res State + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/state_request.go b/api/geo/geo_models/state_request.go new file mode 100644 index 0000000..af5dd4c --- /dev/null +++ b/api/geo/geo_models/state_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StateRequest An array of State objects +// +// swagger:model StateRequest +type StateRequest struct { + + // data + Data []*State `json:"Data"` +} + +// Validate validates this state request +func (m *StateRequest) 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 *StateRequest) 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 +} + +// MarshalBinary interface implementation +func (m *StateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StateRequest) UnmarshalBinary(b []byte) error { + var res StateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/state_response.go b/api/geo/geo_models/state_response.go new file mode 100644 index 0000000..ae6e1a2 --- /dev/null +++ b/api/geo/geo_models/state_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StateResponse An array of State objects +// +// swagger:model StateResponse +type StateResponse struct { + + // data + Data []*State `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this state response +func (m *StateResponse) 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 *StateResponse) 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 *StateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *StateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StateResponse) UnmarshalBinary(b []byte) error { + var res StateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/tax_instance.go b/api/geo/geo_models/tax_instance.go new file mode 100644 index 0000000..ba11bb4 --- /dev/null +++ b/api/geo/geo_models/tax_instance.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxInstance tax instance +// +// swagger:model TaxInstance +type TaxInstance struct { + + // The Taxnexus ID of the Country that owns this instance + CountryID string `json:"CountryID,omitempty"` + + // The Taxnexus ID of the County that owns this instance + CountyID string `json:"CountyID,omitempty"` + + // The Taxnexus ID of the user who created this record + CreatedByID string `json:"CreatedByID,omitempty"` + + // The creation date of this database record + CreatedDate string `json:"CreatedDate,omitempty"` + + // last modified by ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // last modified date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The Taxnexus ID of the Place that owns this instance + PlaceID string `json:"PlaceID,omitempty"` + + // The Taxnexus ID of the State that owns this instance + StateID string `json:"StateID,omitempty"` + + // The Taxnexus Tax Type ID of this instance + TaxTypeID string `json:"TaxTypeID,omitempty"` + + // The Type of instance refers to the linking object (place, county, state, country) + Type string `json:"Type,omitempty"` +} + +// Validate validates this tax instance +func (m *TaxInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxInstance) UnmarshalBinary(b []byte) error { + var res TaxInstance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/tax_rate.go b/api/geo/geo_models/tax_rate.go new file mode 100644 index 0000000..212171b --- /dev/null +++ b/api/geo/geo_models/tax_rate.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxRate tax rate +// +// swagger:model TaxRate +type TaxRate struct { + + // Total Sales Tax Rate (use this one!) + CombinedRate float64 `json:"CombinedRate,omitempty"` + + // County full name + County string `json:"County,omitempty"` + + // County Taxnexus ID + CountyID string `json:"CountyID,omitempty"` + + // County Sales Tax Rate + CountyRate float64 `json:"CountyRate,omitempty"` + + // Date of tax situs determination + Date string `json:"Date,omitempty"` + + // Where the tax rate is focused (place or county) + Focus string `json:"Focus,omitempty"` + + // Taxnexus Geocode for this location + Geocode string `json:"Geocode,omitempty"` + + // Journal Entry Date (transaction date) + JournalDate string `json:"JournalDate,omitempty"` + + // City/Town/Village full name + Place string `json:"Place,omitempty"` + + // City/Town/Village Taxnexus ID + PlaceID string `json:"PlaceID,omitempty"` + + // City/Town/Village Tax Rate + PlaceRate float64 `json:"PlaceRate,omitempty"` + + // State full name + State string `json:"State,omitempty"` + + // State Taxnexus ID + StateID string `json:"StateID,omitempty"` + + // State Sales Tax Rate + StateRate float64 `json:"StateRate,omitempty"` +} + +// Validate validates this tax rate +func (m *TaxRate) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxRate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxRate) UnmarshalBinary(b []byte) error { + var res TaxRate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/tax_rate_response.go b/api/geo/geo_models/tax_rate_response.go new file mode 100644 index 0000000..0ca34e4 --- /dev/null +++ b/api/geo/geo_models/tax_rate_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxRateResponse An array of Tax Rate objects +// +// swagger:model TaxRateResponse +type TaxRateResponse struct { + + // data + Data []*TaxRate `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this tax rate response +func (m *TaxRateResponse) 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 *TaxRateResponse) 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 *TaxRateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxRateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxRateResponse) UnmarshalBinary(b []byte) error { + var res TaxRateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/tax_type.go b/api/geo/geo_models/tax_type.go new file mode 100644 index 0000000..60b593a --- /dev/null +++ b/api/geo/geo_models/tax_type.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxType tax type +// +// swagger:model TaxType +type TaxType struct { + + // Taxing Authority Account Id + AccountID string `json:"AccountID,omitempty"` + + // The Accounting Rule Code for this Tax Type + AccountingRuleCode string `json:"AccountingRuleCode,omitempty"` + + // Agency Type + AgencyType string `json:"AgencyType,omitempty"` + + // Collection Agent Id + AgentID string `json:"AgentID,omitempty"` + + // Category + Category string `json:"Category,omitempty"` + + // Collector Domain Id + CollectorDomainID string `json:"CollectorDomainID,omitempty"` + + // Company ID + CompanyID string `json:"CompanyID,omitempty"` + + // Authority Contact Id + ContactID string `json:"ContactID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Effective Date + EffectiveDate string `json:"EffectiveDate,omitempty"` + + // End Date + EndDate string `json:"EndDate,omitempty"` + + // Enrollment Status + EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` + + // Filing City + FilingCity string `json:"FilingCity,omitempty"` + + // Filing Country + FilingCountry string `json:"FilingCountry,omitempty"` + + // Filing Email + FilingEmail string `json:"FilingEmail,omitempty"` + + // Filing Method + FilingMethod string `json:"FilingMethod,omitempty"` + + // Filing Postal Code + FilingPostalCode string `json:"FilingPostalCode,omitempty"` + + // Filing State + FilingState string `json:"FilingState,omitempty"` + + // Filing Street + FilingStreet string `json:"FilingStreet,omitempty"` + + // Does this Tax Type use a Fractional Basis for calculation? + Fractional bool `json:"Fractional,omitempty"` + + // Frequency + Frequency string `json:"Frequency,omitempty"` + + // Geocode String + GeocodeString string `json:"GeocodeString,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Interest Rate + InterestRate float64 `json:"InterestRate,omitempty"` + + // Medicinal-use cannabis consumption exemption doesn't apply + IsMedicinal bool `json:"IsMedicinal,omitempty"` + + // For Adult-use cannabis consumption only + IsRecreational bool `json:"IsRecreational,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Wholesale markup rate used in Excise Tax (CA cannabis) + MarkupRate float64 `json:"MarkupRate,omitempty"` + + // Tax Type Name (unique) + Name string `json:"Name,omitempty"` + + // Is this tax allowed to be passed-through to retail customers? + PassThrough bool `json:"PassThrough,omitempty"` + + // Number of days until Penalty is assessed + PenaltyDays int64 `json:"PenaltyDays,omitempty"` + + // The percentage rate of a Penalty (per month) + PenaltyRate float64 `json:"PenaltyRate,omitempty"` + + // Tax Rate + Rate float64 `json:"Rate,omitempty"` + + // Tax Authority Website Reference + Reference string `json:"Reference,omitempty"` + + // Salesregulation Code for this TaxType + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // TaxType Document Status + Status string `json:"Status,omitempty"` + + // Taxnexus Code Id + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` + + // The Tax Type number assigned by Taxnexus + TaxnexusNumber string `json:"TaxnexusNumber,omitempty"` + + // Rendering Template Id + TemplateID string `json:"TemplateID,omitempty"` + + // Units + Units string `json:"Units,omitempty"` +} + +// Validate validates this tax type +func (m *TaxType) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxType) UnmarshalBinary(b []byte) error { + var res TaxType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/tax_type_id.go b/api/geo/geo_models/tax_type_id.go new file mode 100644 index 0000000..c773ce3 --- /dev/null +++ b/api/geo/geo_models/tax_type_id.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeID tax type ID +// +// swagger:model TaxTypeID +type TaxTypeID struct { + + // tax type ID + TaxTypeID string `json:"TaxTypeID,omitempty"` +} + +// Validate validates this tax type ID +func (m *TaxTypeID) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxTypeID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeID) UnmarshalBinary(b []byte) error { + var res TaxTypeID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/tax_type_request.go b/api/geo/geo_models/tax_type_request.go new file mode 100644 index 0000000..73656e9 --- /dev/null +++ b/api/geo/geo_models/tax_type_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeRequest An array of Tax Type objects +// +// swagger:model TaxTypeRequest +type TaxTypeRequest struct { + + // data + Data []*TaxType `json:"Data"` +} + +// Validate validates this tax type request +func (m *TaxTypeRequest) 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 *TaxTypeRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTypeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeRequest) UnmarshalBinary(b []byte) error { + var res TaxTypeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/tax_type_response.go b/api/geo/geo_models/tax_type_response.go new file mode 100644 index 0000000..8d4d3b2 --- /dev/null +++ b/api/geo/geo_models/tax_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeResponse An array of Tax Type objects +// +// swagger:model TaxTypeResponse +type TaxTypeResponse struct { + + // data + Data []*TaxType `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this tax type response +func (m *TaxTypeResponse) 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 *TaxTypeResponse) 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 *TaxTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeResponse) UnmarshalBinary(b []byte) error { + var res TaxTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/taxnexus_code.go b/api/geo/geo_models/taxnexus_code.go new file mode 100644 index 0000000..b517a17 --- /dev/null +++ b/api/geo/geo_models/taxnexus_code.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxnexusCode taxnexus code +// +// swagger:model TaxnexusCode +type TaxnexusCode struct { + + // Is this an active Taxnexus Code? + Active bool `json:"Active,omitempty"` + + // Taxnexus Code + Code string `json:"Code,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Taxnexus Code Description + Description string `json:"Description,omitempty"` + + // Domain ID + DomainID string `json:"DomainID,omitempty"` + + // Domain Name + DomainName string `json:"DomainName,omitempty"` + + // Taxnexus 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"` + + // Taxnexus Code Level + Level string `json:"Level,omitempty"` + + // The Taxnexus User Id that owns this Taxnexus Code + OwnerID string `json:"OwnerID,omitempty"` + + // Taxnexus Code Part 1 + Part1 string `json:"Part1,omitempty"` + + // Taxnexus Code Part 2 + Part2 string `json:"Part2,omitempty"` + + // Taxnexus Code Part 3 + Part3 string `json:"Part3,omitempty"` + + // Taxnexus Code Part 4 + Part4 string `json:"Part4,omitempty"` + + // Taxnexus Code Part 4 + Part5 string `json:"Part5,omitempty"` + + // Purchasing Ruleset AccountingRuleset Code + PurchasingRulesetCode string `json:"PurchasingRulesetCode,omitempty"` + + // Purchasing Ruleset AccountingRuleset ID + PurchasingRulesetID string `json:"PurchasingRulesetID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Revenue Ruleset AccountingRuleset Code + RevenueRulesetCode string `json:"RevenueRulesetCode,omitempty"` + + // Revenue Ruleset AccountingRuleset ID + RevenueRulesetID string `json:"RevenueRulesetID,omitempty"` +} + +// Validate validates this taxnexus code +func (m *TaxnexusCode) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxnexusCode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxnexusCode) UnmarshalBinary(b []byte) error { + var res TaxnexusCode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/taxnexus_code_request.go b/api/geo/geo_models/taxnexus_code_request.go new file mode 100644 index 0000000..da98841 --- /dev/null +++ b/api/geo/geo_models/taxnexus_code_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxnexusCodeRequest An array of Taxnexus Codes +// +// swagger:model TaxnexusCodeRequest +type TaxnexusCodeRequest struct { + + // data + Data []*TaxnexusCode `json:"Data"` +} + +// Validate validates this taxnexus code request +func (m *TaxnexusCodeRequest) 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 *TaxnexusCodeRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxnexusCodeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxnexusCodeRequest) UnmarshalBinary(b []byte) error { + var res TaxnexusCodeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/geo/geo_models/taxnexus_code_response.go b/api/geo/geo_models/taxnexus_code_response.go new file mode 100644 index 0000000..9bc3ffc --- /dev/null +++ b/api/geo/geo_models/taxnexus_code_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package geo_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxnexusCodeResponse An array of Taxnexus Codes +// +// swagger:model TaxnexusCodeResponse +type TaxnexusCodeResponse struct { + + // data + Data []*TaxnexusCode `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this taxnexus code response +func (m *TaxnexusCodeResponse) 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 *TaxnexusCodeResponse) 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 *TaxnexusCodeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxnexusCodeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxnexusCodeResponse) UnmarshalBinary(b []byte) error { + var res TaxnexusCodeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/gov-gw/gov_gw_client/gov_gw_client.go b/api/gov-gw/gov_gw_client/gov_gw_client.go new file mode 100644 index 0000000..35b2378 --- /dev/null +++ b/api/gov-gw/gov_gw_client/gov_gw_client.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_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" + + "github.com/taxnexus/go/lib/api/gov-gw/gov_gw_client/tax_rates" +) + +// Default gov gw HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // 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 gov gw HTTP client. +func NewHTTPClient(formats strfmt.Registry) *GovGw { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new gov gw HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *GovGw { + // 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 gov gw client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *GovGw { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(GovGw) + cli.Transport = transport + cli.TaxRates = tax_rates.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 +} + +// GovGw is a client for gov gw +type GovGw struct { + TaxRates tax_rates.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *GovGw) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.TaxRates.SetTransport(transport) +} diff --git a/api/gov-gw/gov_gw_client/tax_rates/get_coordinates_parameters.go b/api/gov-gw/gov_gw_client/tax_rates/get_coordinates_parameters.go new file mode 100644 index 0000000..e920a15 --- /dev/null +++ b/api/gov-gw/gov_gw_client/tax_rates/get_coordinates_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rates + +// 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" +) + +// NewGetCoordinatesParams creates a new GetCoordinatesParams object +// with the default values initialized. +func NewGetCoordinatesParams() *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCoordinatesParamsWithTimeout creates a new GetCoordinatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCoordinatesParamsWithTimeout(timeout time.Duration) *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + + timeout: timeout, + } +} + +// NewGetCoordinatesParamsWithContext creates a new GetCoordinatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCoordinatesParamsWithContext(ctx context.Context) *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + + Context: ctx, + } +} + +// NewGetCoordinatesParamsWithHTTPClient creates a new GetCoordinatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCoordinatesParamsWithHTTPClient(client *http.Client) *GetCoordinatesParams { + var () + return &GetCoordinatesParams{ + HTTPClient: client, + } +} + +/*GetCoordinatesParams contains all the parameters to send to the API endpoint +for the get coordinates operation typically these are written to a http.Request +*/ +type GetCoordinatesParams struct { + + /*Address + Postal Address URL encoded; partial addresses allowed + + */ + Address *string + /*Country + The Country abbreviation (2 char) + + */ + Country *string + /*Limit + How many objects to return at one time + + */ + Limit *int32 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int32 + /*Place + The City name (must be accompanied by State) + + */ + Place *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get coordinates params +func (o *GetCoordinatesParams) WithTimeout(timeout time.Duration) *GetCoordinatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get coordinates params +func (o *GetCoordinatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get coordinates params +func (o *GetCoordinatesParams) WithContext(ctx context.Context) *GetCoordinatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get coordinates params +func (o *GetCoordinatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get coordinates params +func (o *GetCoordinatesParams) WithHTTPClient(client *http.Client) *GetCoordinatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get coordinates params +func (o *GetCoordinatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddress adds the address to the get coordinates params +func (o *GetCoordinatesParams) WithAddress(address *string) *GetCoordinatesParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the get coordinates params +func (o *GetCoordinatesParams) SetAddress(address *string) { + o.Address = address +} + +// WithCountry adds the country to the get coordinates params +func (o *GetCoordinatesParams) WithCountry(country *string) *GetCoordinatesParams { + o.SetCountry(country) + return o +} + +// SetCountry adds the country to the get coordinates params +func (o *GetCoordinatesParams) SetCountry(country *string) { + o.Country = country +} + +// WithLimit adds the limit to the get coordinates params +func (o *GetCoordinatesParams) WithLimit(limit *int32) *GetCoordinatesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get coordinates params +func (o *GetCoordinatesParams) SetLimit(limit *int32) { + o.Limit = limit +} + +// WithOffset adds the offset to the get coordinates params +func (o *GetCoordinatesParams) WithOffset(offset *int32) *GetCoordinatesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get coordinates params +func (o *GetCoordinatesParams) SetOffset(offset *int32) { + o.Offset = offset +} + +// WithPlace adds the place to the get coordinates params +func (o *GetCoordinatesParams) WithPlace(place *string) *GetCoordinatesParams { + o.SetPlace(place) + return o +} + +// SetPlace adds the place to the get coordinates params +func (o *GetCoordinatesParams) SetPlace(place *string) { + o.Place = place +} + +// WithState adds the state to the get coordinates params +func (o *GetCoordinatesParams) WithState(state *string) *GetCoordinatesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get coordinates params +func (o *GetCoordinatesParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCoordinatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Address != nil { + + // query param address + var qrAddress string + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + + } + + if o.Country != nil { + + // query param country + var qrCountry string + if o.Country != nil { + qrCountry = *o.Country + } + qCountry := qrCountry + if qCountry != "" { + if err := r.SetQueryParam("country", qCountry); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int32 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt32(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int32 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt32(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Place != nil { + + // query param place + var qrPlace string + if o.Place != nil { + qrPlace = *o.Place + } + qPlace := qrPlace + if qPlace != "" { + if err := r.SetQueryParam("place", qPlace); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/gov-gw/gov_gw_client/tax_rates/get_coordinates_responses.go b/api/gov-gw/gov_gw_client/tax_rates/get_coordinates_responses.go new file mode 100644 index 0000000..3ebdb5d --- /dev/null +++ b/api/gov-gw/gov_gw_client/tax_rates/get_coordinates_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rates + +// 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" + + "github.com/taxnexus/go/lib/api/gov-gw/gov_gw_models" +) + +// GetCoordinatesReader is a Reader for the GetCoordinates structure. +type GetCoordinatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCoordinatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCoordinatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCoordinatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCoordinatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCoordinatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCoordinatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCoordinatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCoordinatesOK creates a GetCoordinatesOK with default headers values +func NewGetCoordinatesOK() *GetCoordinatesOK { + return &GetCoordinatesOK{} +} + +/*GetCoordinatesOK handles this case with default header values. + +Taxnexus Response +*/ +type GetCoordinatesOK struct { + Payload *gov_gw_models.CoordinateResponse +} + +func (o *GetCoordinatesOK) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesOK %+v", 200, o.Payload) +} + +func (o *GetCoordinatesOK) GetPayload() *gov_gw_models.CoordinateResponse { + return o.Payload +} + +func (o *GetCoordinatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(gov_gw_models.CoordinateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesUnauthorized creates a GetCoordinatesUnauthorized with default headers values +func NewGetCoordinatesUnauthorized() *GetCoordinatesUnauthorized { + return &GetCoordinatesUnauthorized{} +} + +/*GetCoordinatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCoordinatesUnauthorized struct { + Payload *gov_gw_models.Error +} + +func (o *GetCoordinatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCoordinatesUnauthorized) GetPayload() *gov_gw_models.Error { + return o.Payload +} + +func (o *GetCoordinatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(gov_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesForbidden creates a GetCoordinatesForbidden with default headers values +func NewGetCoordinatesForbidden() *GetCoordinatesForbidden { + return &GetCoordinatesForbidden{} +} + +/*GetCoordinatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCoordinatesForbidden struct { + Payload *gov_gw_models.Error +} + +func (o *GetCoordinatesForbidden) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesForbidden %+v", 403, o.Payload) +} + +func (o *GetCoordinatesForbidden) GetPayload() *gov_gw_models.Error { + return o.Payload +} + +func (o *GetCoordinatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(gov_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesNotFound creates a GetCoordinatesNotFound with default headers values +func NewGetCoordinatesNotFound() *GetCoordinatesNotFound { + return &GetCoordinatesNotFound{} +} + +/*GetCoordinatesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCoordinatesNotFound struct { + Payload *gov_gw_models.Error +} + +func (o *GetCoordinatesNotFound) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesNotFound %+v", 404, o.Payload) +} + +func (o *GetCoordinatesNotFound) GetPayload() *gov_gw_models.Error { + return o.Payload +} + +func (o *GetCoordinatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(gov_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesUnprocessableEntity creates a GetCoordinatesUnprocessableEntity with default headers values +func NewGetCoordinatesUnprocessableEntity() *GetCoordinatesUnprocessableEntity { + return &GetCoordinatesUnprocessableEntity{} +} + +/*GetCoordinatesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCoordinatesUnprocessableEntity struct { + Payload *gov_gw_models.Error +} + +func (o *GetCoordinatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCoordinatesUnprocessableEntity) GetPayload() *gov_gw_models.Error { + return o.Payload +} + +func (o *GetCoordinatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(gov_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoordinatesInternalServerError creates a GetCoordinatesInternalServerError with default headers values +func NewGetCoordinatesInternalServerError() *GetCoordinatesInternalServerError { + return &GetCoordinatesInternalServerError{} +} + +/*GetCoordinatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCoordinatesInternalServerError struct { + Payload *gov_gw_models.Error +} + +func (o *GetCoordinatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /coordinates][%d] getCoordinatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCoordinatesInternalServerError) GetPayload() *gov_gw_models.Error { + return o.Payload +} + +func (o *GetCoordinatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(gov_gw_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/gov-gw/gov_gw_client/tax_rates/tax_rates_client.go b/api/gov-gw/gov_gw_client/tax_rates/tax_rates_client.go new file mode 100644 index 0000000..7b286c3 --- /dev/null +++ b/api/gov-gw/gov_gw_client/tax_rates/tax_rates_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_rates + +// 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 tax rates API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax rates API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCoordinates(params *GetCoordinatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinatesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCoordinates gets current tax rates for a coordinate + + Returns full tax information for a specific point on the map (tax situs). Uses existing Taxnexus Situs for lookup information. +*/ +func (a *Client) GetCoordinates(params *GetCoordinatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoordinatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCoordinatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCoordinates", + Method: "GET", + PathPattern: "/coordinates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCoordinatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCoordinatesOK) + 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 getCoordinates: 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/gov-gw/gov_gw_models/coordinate.go b/api/gov-gw/gov_gw_models/coordinate.go new file mode 100644 index 0000000..ca5eda2 --- /dev/null +++ b/api/gov-gw/gov_gw_models/coordinate.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Coordinate coordinate +// +// swagger:model Coordinate +type Coordinate struct { + + // Geocoder Country + Country string `json:"country,omitempty"` + + // Taxnexus Country ID + Countryid string `json:"countryid,omitempty"` + + // Geocoder County + County string `json:"county,omitempty"` + + // Taxnexus County ID + Countyid string `json:"countyid,omitempty"` + + // Situs Focus for tax determination + Focus string `json:"focus,omitempty"` + + // Formatted Address from Geocoder + Formattedaddress string `json:"formattedaddress,omitempty"` + + // Taxnexus Coordinate Record Id + ID string `json:"id,omitempty"` + + // Situs Incorporated District? + Isdistrict bool `json:"isdistrict,omitempty"` + + // Latitude of coordinate + Latitude float64 `json:"latitude,omitempty"` + + // Longitude of coordinate + Longitude float64 `json:"longitude,omitempty"` + + // Coordinate Name from Search Text + Name string `json:"name,omitempty"` + + // Geocoder Neighborhood + Neighborhood string `json:"neighborhood,omitempty"` + + // Geocoder Place + Place string `json:"place,omitempty"` + + // The Taxnexus Geocode for this rated location (place or county) + Placegeocode string `json:"placegeocode,omitempty"` + + // Taxnexus Place ID + Placeid string `json:"placeid,omitempty"` + + // Geocoder Postal Code + Postalcode string `json:"postalcode,omitempty"` + + // External System reference ID + Ref string `json:"ref,omitempty"` + + // Geocoder State/Province name + State string `json:"state,omitempty"` + + // Taxnexus State ID + Stateid string `json:"stateid,omitempty"` + + // The status of the coordinate in Taxnexus + Status string `json:"status,omitempty"` + + // Geocoder Street Name (only) + Street string `json:"street,omitempty"` + + // Geocoder Streen number + Streetnumber string `json:"streetnumber,omitempty"` + + // taxtypes + Taxtypes []*TaxTypeID `json:"taxtypes"` + + // Unique identifier assigned at creation + UUID string `json:"uuid,omitempty"` +} + +// Validate validates this coordinate +func (m *Coordinate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxtypes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Coordinate) validateTaxtypes(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxtypes) { // not required + return nil + } + + for i := 0; i < len(m.Taxtypes); i++ { + if swag.IsZero(m.Taxtypes[i]) { // not required + continue + } + + if m.Taxtypes[i] != nil { + if err := m.Taxtypes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxtypes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Coordinate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Coordinate) UnmarshalBinary(b []byte) error { + var res Coordinate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/gov-gw/gov_gw_models/coordinate_request.go b/api/gov-gw/gov_gw_models/coordinate_request.go new file mode 100644 index 0000000..266ab0c --- /dev/null +++ b/api/gov-gw/gov_gw_models/coordinate_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CoordinateRequest An array of Coordinate Request Items +// +// swagger:model CoordinateRequest +type CoordinateRequest struct { + + // data + // Required: true + Data []*CoordinateRequestItem `json:"data"` + + // meta + // Required: true + Meta *RequestMeta `json:"meta"` +} + +// Validate validates this coordinate request +func (m *CoordinateRequest) 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 *CoordinateRequest) validateData(formats strfmt.Registry) error { + + if err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + 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 *CoordinateRequest) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + 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 +} + +// MarshalBinary interface implementation +func (m *CoordinateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateRequest) UnmarshalBinary(b []byte) error { + var res CoordinateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/gov-gw/gov_gw_models/coordinate_request_item.go b/api/gov-gw/gov_gw_models/coordinate_request_item.go new file mode 100644 index 0000000..83c3a6f --- /dev/null +++ b/api/gov-gw/gov_gw_models/coordinate_request_item.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoordinateRequestItem A single Coordinate Request item +// +// swagger:model CoordinateRequestItem +type CoordinateRequestItem struct { + + // The address to be translated + Address string `json:"address,omitempty"` + + // Source record reference + Ref string `json:"ref,omitempty"` +} + +// Validate validates this coordinate request item +func (m *CoordinateRequestItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CoordinateRequestItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateRequestItem) UnmarshalBinary(b []byte) error { + var res CoordinateRequestItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/gov-gw/gov_gw_models/coordinate_response.go b/api/gov-gw/gov_gw_models/coordinate_response.go new file mode 100644 index 0000000..319e7cc --- /dev/null +++ b/api/gov-gw/gov_gw_models/coordinate_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoordinateResponse An array of Coordinate objects +// +// swagger:model CoordinateResponse +type CoordinateResponse struct { + + // data + Data []*Coordinate `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this coordinate response +func (m *CoordinateResponse) 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 *CoordinateResponse) 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 *CoordinateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CoordinateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoordinateResponse) UnmarshalBinary(b []byte) error { + var res CoordinateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/gov-gw/gov_gw_models/error.go b/api/gov-gw/gov_gw_models/error.go new file mode 100644 index 0000000..a154bac --- /dev/null +++ b/api/gov-gw/gov_gw_models/error.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(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/gov-gw/gov_gw_models/invalid_error.go b/api/gov-gw/gov_gw_models/invalid_error.go new file mode 100644 index 0000000..cca645e --- /dev/null +++ b/api/gov-gw/gov_gw_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/gov-gw/gov_gw_models/pagination.go b/api/gov-gw/gov_gw_models/pagination.go new file mode 100644 index 0000000..ec3fac8 --- /dev/null +++ b/api/gov-gw/gov_gw_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // limit + Limit int32 `json:"limit,omitempty"` + + // pagesize + Pagesize int32 `json:"pagesize,omitempty"` + + // poffset + Poffset int32 `json:"poffset,omitempty"` + + // setsize + Setsize int32 `json:"setsize,omitempty"` +} + +// Validate validates this pagination +func (m *Pagination) Validate(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/gov-gw/gov_gw_models/request_meta.go b/api/gov-gw/gov_gw_models/request_meta.go new file mode 100644 index 0000000..6e9f2d1 --- /dev/null +++ b/api/gov-gw/gov_gw_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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/gov-gw/gov_gw_models/response_meta.go b/api/gov-gw/gov_gw_models/response_meta.go new file mode 100644 index 0000000..fd4d842 --- /dev/null +++ b/api/gov-gw/gov_gw_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,omitempty"` + + // 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"` +} + +// 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 +} + +// 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/gov-gw/gov_gw_models/tax_type_id.go b/api/gov-gw/gov_gw_models/tax_type_id.go new file mode 100644 index 0000000..867e6d6 --- /dev/null +++ b/api/gov-gw/gov_gw_models/tax_type_id.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gov_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeID tax type ID +// +// swagger:model TaxTypeID +type TaxTypeID struct { + + // taxtypeid + Taxtypeid string `json:"taxtypeid,omitempty"` +} + +// Validate validates this tax type ID +func (m *TaxTypeID) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxTypeID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeID) UnmarshalBinary(b []byte) error { + var res TaxTypeID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_client/accounting_rule/accounting_rule_client.go b/api/ledger/ledger_client/accounting_rule/accounting_rule_client.go new file mode 100644 index 0000000..0c13314 --- /dev/null +++ b/api/ledger/ledger_client/accounting_rule/accounting_rule_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_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 accounting rule API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for accounting rule API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAccountingRules(params *GetAccountingRulesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesOK, error) + + PostAccountingRules(params *PostAccountingRulesParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountingRulesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountingRules gets a list of accounting rules + + Return a list of Accounting Rules +*/ +func (a *Client) GetAccountingRules(params *GetAccountingRulesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountingRulesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getAccountingRules", + Method: "GET", + PathPattern: "/accountingrules", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAccountingRulesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAccountingRulesOK) + 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 getAccountingRules: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostAccountingRules creates new accounting rules + + Create new Accounting Rules +*/ +func (a *Client) PostAccountingRules(params *PostAccountingRulesParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountingRulesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAccountingRulesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postAccountingRules", + Method: "POST", + PathPattern: "/accountingrules", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostAccountingRulesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostAccountingRulesOK) + 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 postAccountingRules: 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/ledger/ledger_client/accounting_rule/get_accounting_rules_parameters.go b/api/ledger/ledger_client/accounting_rule/get_accounting_rules_parameters.go new file mode 100644 index 0000000..b7dd49d --- /dev/null +++ b/api/ledger/ledger_client/accounting_rule/get_accounting_rules_parameters.go @@ -0,0 +1,240 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_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" + "github.com/go-openapi/swag" +) + +// NewGetAccountingRulesParams creates a new GetAccountingRulesParams object +// with the default values initialized. +func NewGetAccountingRulesParams() *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountingRulesParamsWithTimeout creates a new GetAccountingRulesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountingRulesParamsWithTimeout(timeout time.Duration) *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + + timeout: timeout, + } +} + +// NewGetAccountingRulesParamsWithContext creates a new GetAccountingRulesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountingRulesParamsWithContext(ctx context.Context) *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + + Context: ctx, + } +} + +// NewGetAccountingRulesParamsWithHTTPClient creates a new GetAccountingRulesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountingRulesParamsWithHTTPClient(client *http.Client) *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + HTTPClient: client, + } +} + +/*GetAccountingRulesParams contains all the parameters to send to the API endpoint +for the get accounting rules operation typically these are written to a http.Request +*/ +type GetAccountingRulesParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID string + /*ID + Taxnexus Record Id + + */ + ID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get accounting rules params +func (o *GetAccountingRulesParams) WithTimeout(timeout time.Duration) *GetAccountingRulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get accounting rules params +func (o *GetAccountingRulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get accounting rules params +func (o *GetAccountingRulesParams) WithContext(ctx context.Context) *GetAccountingRulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get accounting rules params +func (o *GetAccountingRulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get accounting rules params +func (o *GetAccountingRulesParams) WithHTTPClient(client *http.Client) *GetAccountingRulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get accounting rules params +func (o *GetAccountingRulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get accounting rules params +func (o *GetAccountingRulesParams) WithAccountID(accountID string) *GetAccountingRulesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get accounting rules params +func (o *GetAccountingRulesParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithID adds the id to the get accounting rules params +func (o *GetAccountingRulesParams) WithID(id *string) *GetAccountingRulesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get accounting rules params +func (o *GetAccountingRulesParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get accounting rules params +func (o *GetAccountingRulesParams) WithLimit(limit *int64) *GetAccountingRulesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get accounting rules params +func (o *GetAccountingRulesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get accounting rules params +func (o *GetAccountingRulesParams) WithOffset(offset *int64) *GetAccountingRulesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get accounting rules params +func (o *GetAccountingRulesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountingRulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param accountId + qrAccountID := o.AccountID + qAccountID := qrAccountID + if qAccountID != "" { + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/accounting_rule/get_accounting_rules_responses.go b/api/ledger/ledger_client/accounting_rule/get_accounting_rules_responses.go new file mode 100644 index 0000000..3794fd7 --- /dev/null +++ b/api/ledger/ledger_client/accounting_rule/get_accounting_rules_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetAccountingRulesReader is a Reader for the GetAccountingRules structure. +type GetAccountingRulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountingRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountingRulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountingRulesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAccountingRulesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountingRulesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetAccountingRulesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAccountingRulesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetAccountingRulesOK creates a GetAccountingRulesOK with default headers values +func NewGetAccountingRulesOK() *GetAccountingRulesOK { + return &GetAccountingRulesOK{} +} + +/*GetAccountingRulesOK handles this case with default header values. + +Taxnexus Response with Accounting Rule objects +*/ +type GetAccountingRulesOK struct { + Payload *ledger_models.AccountingRuleResponse +} + +func (o *GetAccountingRulesOK) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesOK %+v", 200, o.Payload) +} + +func (o *GetAccountingRulesOK) GetPayload() *ledger_models.AccountingRuleResponse { + return o.Payload +} + +func (o *GetAccountingRulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.AccountingRuleResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesUnauthorized creates a GetAccountingRulesUnauthorized with default headers values +func NewGetAccountingRulesUnauthorized() *GetAccountingRulesUnauthorized { + return &GetAccountingRulesUnauthorized{} +} + +/*GetAccountingRulesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountingRulesUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesUnauthorized) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAccountingRulesUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesForbidden creates a GetAccountingRulesForbidden with default headers values +func NewGetAccountingRulesForbidden() *GetAccountingRulesForbidden { + return &GetAccountingRulesForbidden{} +} + +/*GetAccountingRulesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountingRulesForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesForbidden) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesForbidden %+v", 403, o.Payload) +} + +func (o *GetAccountingRulesForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesNotFound creates a GetAccountingRulesNotFound with default headers values +func NewGetAccountingRulesNotFound() *GetAccountingRulesNotFound { + return &GetAccountingRulesNotFound{} +} + +/*GetAccountingRulesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetAccountingRulesNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesNotFound) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesNotFound %+v", 404, o.Payload) +} + +func (o *GetAccountingRulesNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesUnprocessableEntity creates a GetAccountingRulesUnprocessableEntity with default headers values +func NewGetAccountingRulesUnprocessableEntity() *GetAccountingRulesUnprocessableEntity { + return &GetAccountingRulesUnprocessableEntity{} +} + +/*GetAccountingRulesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountingRulesUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAccountingRulesUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesInternalServerError creates a GetAccountingRulesInternalServerError with default headers values +func NewGetAccountingRulesInternalServerError() *GetAccountingRulesInternalServerError { + return &GetAccountingRulesInternalServerError{} +} + +/*GetAccountingRulesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetAccountingRulesInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesInternalServerError) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAccountingRulesInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/accounting_rule/post_accounting_rules_parameters.go b/api/ledger/ledger_client/accounting_rule/post_accounting_rules_parameters.go new file mode 100644 index 0000000..4b435cf --- /dev/null +++ b/api/ledger/ledger_client/accounting_rule/post_accounting_rules_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// NewPostAccountingRulesParams creates a new PostAccountingRulesParams object +// with the default values initialized. +func NewPostAccountingRulesParams() *PostAccountingRulesParams { + var () + return &PostAccountingRulesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAccountingRulesParamsWithTimeout creates a new PostAccountingRulesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAccountingRulesParamsWithTimeout(timeout time.Duration) *PostAccountingRulesParams { + var () + return &PostAccountingRulesParams{ + + timeout: timeout, + } +} + +// NewPostAccountingRulesParamsWithContext creates a new PostAccountingRulesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAccountingRulesParamsWithContext(ctx context.Context) *PostAccountingRulesParams { + var () + return &PostAccountingRulesParams{ + + Context: ctx, + } +} + +// NewPostAccountingRulesParamsWithHTTPClient creates a new PostAccountingRulesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAccountingRulesParamsWithHTTPClient(client *http.Client) *PostAccountingRulesParams { + var () + return &PostAccountingRulesParams{ + HTTPClient: client, + } +} + +/*PostAccountingRulesParams contains all the parameters to send to the API endpoint +for the post accounting rules operation typically these are written to a http.Request +*/ +type PostAccountingRulesParams struct { + + /*AccountingRuleRequest + An array of Accounting Rule records + + */ + AccountingRuleRequest *ledger_models.AccountingRuleRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post accounting rules params +func (o *PostAccountingRulesParams) WithTimeout(timeout time.Duration) *PostAccountingRulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post accounting rules params +func (o *PostAccountingRulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post accounting rules params +func (o *PostAccountingRulesParams) WithContext(ctx context.Context) *PostAccountingRulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post accounting rules params +func (o *PostAccountingRulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post accounting rules params +func (o *PostAccountingRulesParams) WithHTTPClient(client *http.Client) *PostAccountingRulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post accounting rules params +func (o *PostAccountingRulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountingRuleRequest adds the accountingRuleRequest to the post accounting rules params +func (o *PostAccountingRulesParams) WithAccountingRuleRequest(accountingRuleRequest *ledger_models.AccountingRuleRequest) *PostAccountingRulesParams { + o.SetAccountingRuleRequest(accountingRuleRequest) + return o +} + +// SetAccountingRuleRequest adds the accountingRuleRequest to the post accounting rules params +func (o *PostAccountingRulesParams) SetAccountingRuleRequest(accountingRuleRequest *ledger_models.AccountingRuleRequest) { + o.AccountingRuleRequest = accountingRuleRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAccountingRulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountingRuleRequest != nil { + if err := r.SetBodyParam(o.AccountingRuleRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/accounting_rule/post_accounting_rules_responses.go b/api/ledger/ledger_client/accounting_rule/post_accounting_rules_responses.go new file mode 100644 index 0000000..10d7294 --- /dev/null +++ b/api/ledger/ledger_client/accounting_rule/post_accounting_rules_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// PostAccountingRulesReader is a Reader for the PostAccountingRules structure. +type PostAccountingRulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAccountingRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostAccountingRulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostAccountingRulesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostAccountingRulesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostAccountingRulesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostAccountingRulesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostAccountingRulesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostAccountingRulesOK creates a PostAccountingRulesOK with default headers values +func NewPostAccountingRulesOK() *PostAccountingRulesOK { + return &PostAccountingRulesOK{} +} + +/*PostAccountingRulesOK handles this case with default header values. + +Taxnexus Response with Accounting Rule objects +*/ +type PostAccountingRulesOK struct { + Payload *ledger_models.AccountingRuleResponse +} + +func (o *PostAccountingRulesOK) Error() string { + return fmt.Sprintf("[POST /accountingrules][%d] postAccountingRulesOK %+v", 200, o.Payload) +} + +func (o *PostAccountingRulesOK) GetPayload() *ledger_models.AccountingRuleResponse { + return o.Payload +} + +func (o *PostAccountingRulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.AccountingRuleResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesUnauthorized creates a PostAccountingRulesUnauthorized with default headers values +func NewPostAccountingRulesUnauthorized() *PostAccountingRulesUnauthorized { + return &PostAccountingRulesUnauthorized{} +} + +/*PostAccountingRulesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostAccountingRulesUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesUnauthorized) Error() string { + return fmt.Sprintf("[POST /accountingrules][%d] postAccountingRulesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostAccountingRulesUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesForbidden creates a PostAccountingRulesForbidden with default headers values +func NewPostAccountingRulesForbidden() *PostAccountingRulesForbidden { + return &PostAccountingRulesForbidden{} +} + +/*PostAccountingRulesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostAccountingRulesForbidden struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesForbidden) Error() string { + return fmt.Sprintf("[POST /accountingrules][%d] postAccountingRulesForbidden %+v", 403, o.Payload) +} + +func (o *PostAccountingRulesForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesNotFound creates a PostAccountingRulesNotFound with default headers values +func NewPostAccountingRulesNotFound() *PostAccountingRulesNotFound { + return &PostAccountingRulesNotFound{} +} + +/*PostAccountingRulesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostAccountingRulesNotFound struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesNotFound) Error() string { + return fmt.Sprintf("[POST /accountingrules][%d] postAccountingRulesNotFound %+v", 404, o.Payload) +} + +func (o *PostAccountingRulesNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesUnprocessableEntity creates a PostAccountingRulesUnprocessableEntity with default headers values +func NewPostAccountingRulesUnprocessableEntity() *PostAccountingRulesUnprocessableEntity { + return &PostAccountingRulesUnprocessableEntity{} +} + +/*PostAccountingRulesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostAccountingRulesUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /accountingrules][%d] postAccountingRulesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostAccountingRulesUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesInternalServerError creates a PostAccountingRulesInternalServerError with default headers values +func NewPostAccountingRulesInternalServerError() *PostAccountingRulesInternalServerError { + return &PostAccountingRulesInternalServerError{} +} + +/*PostAccountingRulesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostAccountingRulesInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesInternalServerError) Error() string { + return fmt.Sprintf("[POST /accountingrules][%d] postAccountingRulesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostAccountingRulesInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/accounting_ruleset/accounting_ruleset_client.go b/api/ledger/ledger_client/accounting_ruleset/accounting_ruleset_client.go new file mode 100644 index 0000000..d384eb3 --- /dev/null +++ b/api/ledger/ledger_client/accounting_ruleset/accounting_ruleset_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_ruleset + +// 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 accounting ruleset API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for accounting ruleset API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAccountingRulesets(params *GetAccountingRulesetsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesetsOK, error) + + PostAccountingRulesets(params *PostAccountingRulesetsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountingRulesetsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountingRulesets gets a list of accounting rulessets + + Return a list of available Accounting Rulessets +*/ +func (a *Client) GetAccountingRulesets(params *GetAccountingRulesetsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountingRulesetsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getAccountingRulesets", + Method: "GET", + PathPattern: "/accountingrulesets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAccountingRulesetsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAccountingRulesetsOK) + 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 getAccountingRulesets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostAccountingRulesets creates new accounting rulessets + + Create new Accounting Rulessets +*/ +func (a *Client) PostAccountingRulesets(params *PostAccountingRulesetsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountingRulesetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAccountingRulesetsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postAccountingRulesets", + Method: "POST", + PathPattern: "/accountingrulesets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostAccountingRulesetsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostAccountingRulesetsOK) + 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 postAccountingRulesets: 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/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_parameters.go b/api/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_parameters.go new file mode 100644 index 0000000..02c347e --- /dev/null +++ b/api/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_parameters.go @@ -0,0 +1,208 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_ruleset + +// 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" +) + +// NewGetAccountingRulesetsParams creates a new GetAccountingRulesetsParams object +// with the default values initialized. +func NewGetAccountingRulesetsParams() *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountingRulesetsParamsWithTimeout creates a new GetAccountingRulesetsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountingRulesetsParamsWithTimeout(timeout time.Duration) *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + + timeout: timeout, + } +} + +// NewGetAccountingRulesetsParamsWithContext creates a new GetAccountingRulesetsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountingRulesetsParamsWithContext(ctx context.Context) *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + + Context: ctx, + } +} + +// NewGetAccountingRulesetsParamsWithHTTPClient creates a new GetAccountingRulesetsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountingRulesetsParamsWithHTTPClient(client *http.Client) *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + HTTPClient: client, + } +} + +/*GetAccountingRulesetsParams contains all the parameters to send to the API endpoint +for the get accounting rulesets operation typically these are written to a http.Request +*/ +type GetAccountingRulesetsParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithTimeout(timeout time.Duration) *GetAccountingRulesetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithContext(ctx context.Context) *GetAccountingRulesetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithHTTPClient(client *http.Client) *GetAccountingRulesetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithAccountID(accountID string) *GetAccountingRulesetsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithLimit adds the limit to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithLimit(limit *int64) *GetAccountingRulesetsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithOffset(offset *int64) *GetAccountingRulesetsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountingRulesetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param accountId + qrAccountID := o.AccountID + qAccountID := qrAccountID + if qAccountID != "" { + if err := r.SetQueryParam("accountId", qAccountID); 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/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_responses.go b/api/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_responses.go new file mode 100644 index 0000000..d0ad273 --- /dev/null +++ b/api/ledger/ledger_client/accounting_ruleset/get_accounting_rulesets_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_ruleset + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetAccountingRulesetsReader is a Reader for the GetAccountingRulesets structure. +type GetAccountingRulesetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountingRulesetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountingRulesetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountingRulesetsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAccountingRulesetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountingRulesetsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetAccountingRulesetsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAccountingRulesetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetAccountingRulesetsOK creates a GetAccountingRulesetsOK with default headers values +func NewGetAccountingRulesetsOK() *GetAccountingRulesetsOK { + return &GetAccountingRulesetsOK{} +} + +/*GetAccountingRulesetsOK handles this case with default header values. + +Taxnexus Response with Accounting Ruleset objects +*/ +type GetAccountingRulesetsOK struct { + Payload *ledger_models.AccountingRulesetResponse +} + +func (o *GetAccountingRulesetsOK) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsOK %+v", 200, o.Payload) +} + +func (o *GetAccountingRulesetsOK) GetPayload() *ledger_models.AccountingRulesetResponse { + return o.Payload +} + +func (o *GetAccountingRulesetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.AccountingRulesetResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsUnauthorized creates a GetAccountingRulesetsUnauthorized with default headers values +func NewGetAccountingRulesetsUnauthorized() *GetAccountingRulesetsUnauthorized { + return &GetAccountingRulesetsUnauthorized{} +} + +/*GetAccountingRulesetsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAccountingRulesetsUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesetsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAccountingRulesetsUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsForbidden creates a GetAccountingRulesetsForbidden with default headers values +func NewGetAccountingRulesetsForbidden() *GetAccountingRulesetsForbidden { + return &GetAccountingRulesetsForbidden{} +} + +/*GetAccountingRulesetsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountingRulesetsForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesetsForbidden) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsForbidden %+v", 403, o.Payload) +} + +func (o *GetAccountingRulesetsForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsNotFound creates a GetAccountingRulesetsNotFound with default headers values +func NewGetAccountingRulesetsNotFound() *GetAccountingRulesetsNotFound { + return &GetAccountingRulesetsNotFound{} +} + +/*GetAccountingRulesetsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetAccountingRulesetsNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesetsNotFound) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsNotFound %+v", 404, o.Payload) +} + +func (o *GetAccountingRulesetsNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsUnprocessableEntity creates a GetAccountingRulesetsUnprocessableEntity with default headers values +func NewGetAccountingRulesetsUnprocessableEntity() *GetAccountingRulesetsUnprocessableEntity { + return &GetAccountingRulesetsUnprocessableEntity{} +} + +/*GetAccountingRulesetsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountingRulesetsUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesetsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAccountingRulesetsUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsInternalServerError creates a GetAccountingRulesetsInternalServerError with default headers values +func NewGetAccountingRulesetsInternalServerError() *GetAccountingRulesetsInternalServerError { + return &GetAccountingRulesetsInternalServerError{} +} + +/*GetAccountingRulesetsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetAccountingRulesetsInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetAccountingRulesetsInternalServerError) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAccountingRulesetsInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_parameters.go b/api/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_parameters.go new file mode 100644 index 0000000..742a76c --- /dev/null +++ b/api/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_ruleset + +// 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/taxnexus/go/lib/api/ledger/ledger_models" +) + +// NewPostAccountingRulesetsParams creates a new PostAccountingRulesetsParams object +// with the default values initialized. +func NewPostAccountingRulesetsParams() *PostAccountingRulesetsParams { + var () + return &PostAccountingRulesetsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAccountingRulesetsParamsWithTimeout creates a new PostAccountingRulesetsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAccountingRulesetsParamsWithTimeout(timeout time.Duration) *PostAccountingRulesetsParams { + var () + return &PostAccountingRulesetsParams{ + + timeout: timeout, + } +} + +// NewPostAccountingRulesetsParamsWithContext creates a new PostAccountingRulesetsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAccountingRulesetsParamsWithContext(ctx context.Context) *PostAccountingRulesetsParams { + var () + return &PostAccountingRulesetsParams{ + + Context: ctx, + } +} + +// NewPostAccountingRulesetsParamsWithHTTPClient creates a new PostAccountingRulesetsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAccountingRulesetsParamsWithHTTPClient(client *http.Client) *PostAccountingRulesetsParams { + var () + return &PostAccountingRulesetsParams{ + HTTPClient: client, + } +} + +/*PostAccountingRulesetsParams contains all the parameters to send to the API endpoint +for the post accounting rulesets operation typically these are written to a http.Request +*/ +type PostAccountingRulesetsParams struct { + + /*AccountingRulesetRequest + An array of Accounting Ruleset records + + */ + AccountingRulesetRequest *ledger_models.AccountingRulesetRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) WithTimeout(timeout time.Duration) *PostAccountingRulesetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) WithContext(ctx context.Context) *PostAccountingRulesetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) WithHTTPClient(client *http.Client) *PostAccountingRulesetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountingRulesetRequest adds the accountingRulesetRequest to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) WithAccountingRulesetRequest(accountingRulesetRequest *ledger_models.AccountingRulesetRequest) *PostAccountingRulesetsParams { + o.SetAccountingRulesetRequest(accountingRulesetRequest) + return o +} + +// SetAccountingRulesetRequest adds the accountingRulesetRequest to the post accounting rulesets params +func (o *PostAccountingRulesetsParams) SetAccountingRulesetRequest(accountingRulesetRequest *ledger_models.AccountingRulesetRequest) { + o.AccountingRulesetRequest = accountingRulesetRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostAccountingRulesetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AccountingRulesetRequest != nil { + if err := r.SetBodyParam(o.AccountingRulesetRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_responses.go b/api/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_responses.go new file mode 100644 index 0000000..d346946 --- /dev/null +++ b/api/ledger/ledger_client/accounting_ruleset/post_accounting_rulesets_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_ruleset + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// PostAccountingRulesetsReader is a Reader for the PostAccountingRulesets structure. +type PostAccountingRulesetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostAccountingRulesetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostAccountingRulesetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostAccountingRulesetsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostAccountingRulesetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostAccountingRulesetsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostAccountingRulesetsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostAccountingRulesetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostAccountingRulesetsOK creates a PostAccountingRulesetsOK with default headers values +func NewPostAccountingRulesetsOK() *PostAccountingRulesetsOK { + return &PostAccountingRulesetsOK{} +} + +/*PostAccountingRulesetsOK handles this case with default header values. + +Taxnexus Response with Accounting Ruleset objects +*/ +type PostAccountingRulesetsOK struct { + Payload *ledger_models.AccountingRulesetResponse +} + +func (o *PostAccountingRulesetsOK) Error() string { + return fmt.Sprintf("[POST /accountingrulesets][%d] postAccountingRulesetsOK %+v", 200, o.Payload) +} + +func (o *PostAccountingRulesetsOK) GetPayload() *ledger_models.AccountingRulesetResponse { + return o.Payload +} + +func (o *PostAccountingRulesetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.AccountingRulesetResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesetsUnauthorized creates a PostAccountingRulesetsUnauthorized with default headers values +func NewPostAccountingRulesetsUnauthorized() *PostAccountingRulesetsUnauthorized { + return &PostAccountingRulesetsUnauthorized{} +} + +/*PostAccountingRulesetsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostAccountingRulesetsUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesetsUnauthorized) Error() string { + return fmt.Sprintf("[POST /accountingrulesets][%d] postAccountingRulesetsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostAccountingRulesetsUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesetsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesetsForbidden creates a PostAccountingRulesetsForbidden with default headers values +func NewPostAccountingRulesetsForbidden() *PostAccountingRulesetsForbidden { + return &PostAccountingRulesetsForbidden{} +} + +/*PostAccountingRulesetsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostAccountingRulesetsForbidden struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesetsForbidden) Error() string { + return fmt.Sprintf("[POST /accountingrulesets][%d] postAccountingRulesetsForbidden %+v", 403, o.Payload) +} + +func (o *PostAccountingRulesetsForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesetsNotFound creates a PostAccountingRulesetsNotFound with default headers values +func NewPostAccountingRulesetsNotFound() *PostAccountingRulesetsNotFound { + return &PostAccountingRulesetsNotFound{} +} + +/*PostAccountingRulesetsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostAccountingRulesetsNotFound struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesetsNotFound) Error() string { + return fmt.Sprintf("[POST /accountingrulesets][%d] postAccountingRulesetsNotFound %+v", 404, o.Payload) +} + +func (o *PostAccountingRulesetsNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesetsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesetsUnprocessableEntity creates a PostAccountingRulesetsUnprocessableEntity with default headers values +func NewPostAccountingRulesetsUnprocessableEntity() *PostAccountingRulesetsUnprocessableEntity { + return &PostAccountingRulesetsUnprocessableEntity{} +} + +/*PostAccountingRulesetsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostAccountingRulesetsUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesetsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /accountingrulesets][%d] postAccountingRulesetsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostAccountingRulesetsUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesetsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostAccountingRulesetsInternalServerError creates a PostAccountingRulesetsInternalServerError with default headers values +func NewPostAccountingRulesetsInternalServerError() *PostAccountingRulesetsInternalServerError { + return &PostAccountingRulesetsInternalServerError{} +} + +/*PostAccountingRulesetsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostAccountingRulesetsInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *PostAccountingRulesetsInternalServerError) Error() string { + return fmt.Sprintf("[POST /accountingrulesets][%d] postAccountingRulesetsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostAccountingRulesetsInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostAccountingRulesetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/coa/coa_client.go b/api/ledger/ledger_client/coa/coa_client.go new file mode 100644 index 0000000..c49fe81 --- /dev/null +++ b/api/ledger/ledger_client/coa/coa_client.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coa + +// 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 coa API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for coa API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCoas(params *GetCoasParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoasOK, error) + + PostCoas(params *PostCoasParams, authInfo runtime.ClientAuthInfoWriter) (*PostCoasOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCoas gets chart of accounts reports +*/ +func (a *Client) GetCoas(params *GetCoasParams, authInfo runtime.ClientAuthInfoWriter) (*GetCoasOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCoasParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCoas", + Method: "GET", + PathPattern: "/coas", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCoasReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCoasOK) + 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 getCoas: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCoas creates new accounting report +*/ +func (a *Client) PostCoas(params *PostCoasParams, authInfo runtime.ClientAuthInfoWriter) (*PostCoasOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCoasParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCoas", + Method: "POST", + PathPattern: "/coas", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCoasReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCoasOK) + 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 postCoas: 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/ledger/ledger_client/coa/get_coas_parameters.go b/api/ledger/ledger_client/coa/get_coas_parameters.go new file mode 100644 index 0000000..3cd6305 --- /dev/null +++ b/api/ledger/ledger_client/coa/get_coas_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coa + +// 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" +) + +// NewGetCoasParams creates a new GetCoasParams object +// with the default values initialized. +func NewGetCoasParams() *GetCoasParams { + var () + return &GetCoasParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCoasParamsWithTimeout creates a new GetCoasParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCoasParamsWithTimeout(timeout time.Duration) *GetCoasParams { + var () + return &GetCoasParams{ + + timeout: timeout, + } +} + +// NewGetCoasParamsWithContext creates a new GetCoasParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCoasParamsWithContext(ctx context.Context) *GetCoasParams { + var () + return &GetCoasParams{ + + Context: ctx, + } +} + +// NewGetCoasParamsWithHTTPClient creates a new GetCoasParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCoasParamsWithHTTPClient(client *http.Client) *GetCoasParams { + var () + return &GetCoasParams{ + HTTPClient: client, + } +} + +/*GetCoasParams contains all the parameters to send to the API endpoint +for the get coas operation typically these are written to a http.Request +*/ +type GetCoasParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*CoaID + Taxnexus Id of the Chart of Accounts to be retrieved + + */ + CoaID *string + /*DateFrom + The Starting Date for an object retrieval + + */ + DateFrom *string + /*DateTo + The Ending Date for an object retrieval + + */ + DateTo *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get coas params +func (o *GetCoasParams) WithTimeout(timeout time.Duration) *GetCoasParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get coas params +func (o *GetCoasParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get coas params +func (o *GetCoasParams) WithContext(ctx context.Context) *GetCoasParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get coas params +func (o *GetCoasParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get coas params +func (o *GetCoasParams) WithHTTPClient(client *http.Client) *GetCoasParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get coas params +func (o *GetCoasParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get coas params +func (o *GetCoasParams) WithAccountID(accountID *string) *GetCoasParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get coas params +func (o *GetCoasParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithCoaID adds the coaID to the get coas params +func (o *GetCoasParams) WithCoaID(coaID *string) *GetCoasParams { + o.SetCoaID(coaID) + return o +} + +// SetCoaID adds the coaId to the get coas params +func (o *GetCoasParams) SetCoaID(coaID *string) { + o.CoaID = coaID +} + +// WithDateFrom adds the dateFrom to the get coas params +func (o *GetCoasParams) WithDateFrom(dateFrom *string) *GetCoasParams { + o.SetDateFrom(dateFrom) + return o +} + +// SetDateFrom adds the dateFrom to the get coas params +func (o *GetCoasParams) SetDateFrom(dateFrom *string) { + o.DateFrom = dateFrom +} + +// WithDateTo adds the dateTo to the get coas params +func (o *GetCoasParams) WithDateTo(dateTo *string) *GetCoasParams { + o.SetDateTo(dateTo) + return o +} + +// SetDateTo adds the dateTo to the get coas params +func (o *GetCoasParams) SetDateTo(dateTo *string) { + o.DateTo = dateTo +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCoasParams) 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.CoaID != nil { + + // query param coaId + var qrCoaID string + if o.CoaID != nil { + qrCoaID = *o.CoaID + } + qCoaID := qrCoaID + if qCoaID != "" { + if err := r.SetQueryParam("coaId", qCoaID); err != nil { + return err + } + } + + } + + if o.DateFrom != nil { + + // query param dateFrom + var qrDateFrom string + if o.DateFrom != nil { + qrDateFrom = *o.DateFrom + } + qDateFrom := qrDateFrom + if qDateFrom != "" { + if err := r.SetQueryParam("dateFrom", qDateFrom); err != nil { + return err + } + } + + } + + if o.DateTo != nil { + + // query param dateTo + var qrDateTo string + if o.DateTo != nil { + qrDateTo = *o.DateTo + } + qDateTo := qrDateTo + if qDateTo != "" { + if err := r.SetQueryParam("dateTo", qDateTo); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/coa/get_coas_responses.go b/api/ledger/ledger_client/coa/get_coas_responses.go new file mode 100644 index 0000000..c464556 --- /dev/null +++ b/api/ledger/ledger_client/coa/get_coas_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coa + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetCoasReader is a Reader for the GetCoas structure. +type GetCoasReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCoasReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCoasOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCoasUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCoasForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCoasNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCoasUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCoasInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCoasOK creates a GetCoasOK with default headers values +func NewGetCoasOK() *GetCoasOK { + return &GetCoasOK{} +} + +/*GetCoasOK handles this case with default header values. + +Taxnexus Response with Chart of Accounts objects +*/ +type GetCoasOK struct { + Payload *ledger_models.CoaResponse +} + +func (o *GetCoasOK) Error() string { + return fmt.Sprintf("[GET /coas][%d] getCoasOK %+v", 200, o.Payload) +} + +func (o *GetCoasOK) GetPayload() *ledger_models.CoaResponse { + return o.Payload +} + +func (o *GetCoasOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.CoaResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoasUnauthorized creates a GetCoasUnauthorized with default headers values +func NewGetCoasUnauthorized() *GetCoasUnauthorized { + return &GetCoasUnauthorized{} +} + +/*GetCoasUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetCoasUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetCoasUnauthorized) Error() string { + return fmt.Sprintf("[GET /coas][%d] getCoasUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCoasUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetCoasUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoasForbidden creates a GetCoasForbidden with default headers values +func NewGetCoasForbidden() *GetCoasForbidden { + return &GetCoasForbidden{} +} + +/*GetCoasForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCoasForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetCoasForbidden) Error() string { + return fmt.Sprintf("[GET /coas][%d] getCoasForbidden %+v", 403, o.Payload) +} + +func (o *GetCoasForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetCoasForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoasNotFound creates a GetCoasNotFound with default headers values +func NewGetCoasNotFound() *GetCoasNotFound { + return &GetCoasNotFound{} +} + +/*GetCoasNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCoasNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetCoasNotFound) Error() string { + return fmt.Sprintf("[GET /coas][%d] getCoasNotFound %+v", 404, o.Payload) +} + +func (o *GetCoasNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetCoasNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoasUnprocessableEntity creates a GetCoasUnprocessableEntity with default headers values +func NewGetCoasUnprocessableEntity() *GetCoasUnprocessableEntity { + return &GetCoasUnprocessableEntity{} +} + +/*GetCoasUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCoasUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetCoasUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /coas][%d] getCoasUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCoasUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetCoasUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCoasInternalServerError creates a GetCoasInternalServerError with default headers values +func NewGetCoasInternalServerError() *GetCoasInternalServerError { + return &GetCoasInternalServerError{} +} + +/*GetCoasInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCoasInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetCoasInternalServerError) Error() string { + return fmt.Sprintf("[GET /coas][%d] getCoasInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCoasInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetCoasInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/coa/post_coas_parameters.go b/api/ledger/ledger_client/coa/post_coas_parameters.go new file mode 100644 index 0000000..3152392 --- /dev/null +++ b/api/ledger/ledger_client/coa/post_coas_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coa + +// 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/taxnexus/go/lib/api/ledger/ledger_models" +) + +// NewPostCoasParams creates a new PostCoasParams object +// with the default values initialized. +func NewPostCoasParams() *PostCoasParams { + var () + return &PostCoasParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCoasParamsWithTimeout creates a new PostCoasParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCoasParamsWithTimeout(timeout time.Duration) *PostCoasParams { + var () + return &PostCoasParams{ + + timeout: timeout, + } +} + +// NewPostCoasParamsWithContext creates a new PostCoasParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCoasParamsWithContext(ctx context.Context) *PostCoasParams { + var () + return &PostCoasParams{ + + Context: ctx, + } +} + +// NewPostCoasParamsWithHTTPClient creates a new PostCoasParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCoasParamsWithHTTPClient(client *http.Client) *PostCoasParams { + var () + return &PostCoasParams{ + HTTPClient: client, + } +} + +/*PostCoasParams contains all the parameters to send to the API endpoint +for the post coas operation typically these are written to a http.Request +*/ +type PostCoasParams struct { + + /*CoaRequest + An array of Coa records + + */ + CoaRequest *ledger_models.CoaRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post coas params +func (o *PostCoasParams) WithTimeout(timeout time.Duration) *PostCoasParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post coas params +func (o *PostCoasParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post coas params +func (o *PostCoasParams) WithContext(ctx context.Context) *PostCoasParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post coas params +func (o *PostCoasParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post coas params +func (o *PostCoasParams) WithHTTPClient(client *http.Client) *PostCoasParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post coas params +func (o *PostCoasParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCoaRequest adds the coaRequest to the post coas params +func (o *PostCoasParams) WithCoaRequest(coaRequest *ledger_models.CoaRequest) *PostCoasParams { + o.SetCoaRequest(coaRequest) + return o +} + +// SetCoaRequest adds the coaRequest to the post coas params +func (o *PostCoasParams) SetCoaRequest(coaRequest *ledger_models.CoaRequest) { + o.CoaRequest = coaRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCoasParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CoaRequest != nil { + if err := r.SetBodyParam(o.CoaRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/coa/post_coas_responses.go b/api/ledger/ledger_client/coa/post_coas_responses.go new file mode 100644 index 0000000..65fce37 --- /dev/null +++ b/api/ledger/ledger_client/coa/post_coas_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package coa + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// PostCoasReader is a Reader for the PostCoas structure. +type PostCoasReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCoasReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCoasOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCoasUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCoasForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCoasNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostCoasUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCoasInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostCoasOK creates a PostCoasOK with default headers values +func NewPostCoasOK() *PostCoasOK { + return &PostCoasOK{} +} + +/*PostCoasOK handles this case with default header values. + +Taxnexus Response with Chart of Accounts objects +*/ +type PostCoasOK struct { + Payload *ledger_models.CoaResponse +} + +func (o *PostCoasOK) Error() string { + return fmt.Sprintf("[POST /coas][%d] postCoasOK %+v", 200, o.Payload) +} + +func (o *PostCoasOK) GetPayload() *ledger_models.CoaResponse { + return o.Payload +} + +func (o *PostCoasOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.CoaResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoasUnauthorized creates a PostCoasUnauthorized with default headers values +func NewPostCoasUnauthorized() *PostCoasUnauthorized { + return &PostCoasUnauthorized{} +} + +/*PostCoasUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostCoasUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *PostCoasUnauthorized) Error() string { + return fmt.Sprintf("[POST /coas][%d] postCoasUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCoasUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostCoasUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoasForbidden creates a PostCoasForbidden with default headers values +func NewPostCoasForbidden() *PostCoasForbidden { + return &PostCoasForbidden{} +} + +/*PostCoasForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostCoasForbidden struct { + Payload *ledger_models.Error +} + +func (o *PostCoasForbidden) Error() string { + return fmt.Sprintf("[POST /coas][%d] postCoasForbidden %+v", 403, o.Payload) +} + +func (o *PostCoasForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostCoasForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoasNotFound creates a PostCoasNotFound with default headers values +func NewPostCoasNotFound() *PostCoasNotFound { + return &PostCoasNotFound{} +} + +/*PostCoasNotFound handles this case with default header values. + +Resource was not found +*/ +type PostCoasNotFound struct { + Payload *ledger_models.Error +} + +func (o *PostCoasNotFound) Error() string { + return fmt.Sprintf("[POST /coas][%d] postCoasNotFound %+v", 404, o.Payload) +} + +func (o *PostCoasNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostCoasNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoasUnprocessableEntity creates a PostCoasUnprocessableEntity with default headers values +func NewPostCoasUnprocessableEntity() *PostCoasUnprocessableEntity { + return &PostCoasUnprocessableEntity{} +} + +/*PostCoasUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostCoasUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *PostCoasUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /coas][%d] postCoasUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostCoasUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostCoasUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCoasInternalServerError creates a PostCoasInternalServerError with default headers values +func NewPostCoasInternalServerError() *PostCoasInternalServerError { + return &PostCoasInternalServerError{} +} + +/*PostCoasInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostCoasInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *PostCoasInternalServerError) Error() string { + return fmt.Sprintf("[POST /coas][%d] postCoasInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCoasInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostCoasInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/gl_account/get_gl_accounts_parameters.go b/api/ledger/ledger_client/gl_account/get_gl_accounts_parameters.go new file mode 100644 index 0000000..17697a1 --- /dev/null +++ b/api/ledger/ledger_client/gl_account/get_gl_accounts_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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" + "github.com/go-openapi/swag" +) + +// NewGetGlAccountsParams creates a new GetGlAccountsParams object +// with the default values initialized. +func NewGetGlAccountsParams() *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetGlAccountsParamsWithTimeout creates a new GetGlAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetGlAccountsParamsWithTimeout(timeout time.Duration) *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + + timeout: timeout, + } +} + +// NewGetGlAccountsParamsWithContext creates a new GetGlAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetGlAccountsParamsWithContext(ctx context.Context) *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + + Context: ctx, + } +} + +// NewGetGlAccountsParamsWithHTTPClient creates a new GetGlAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetGlAccountsParamsWithHTTPClient(client *http.Client) *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + HTTPClient: client, + } +} + +/*GetGlAccountsParams contains all the parameters to send to the API endpoint +for the get gl accounts operation typically these are written to a http.Request +*/ +type GetGlAccountsParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*ID + Taxnexus Record Id + + */ + ID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get gl accounts params +func (o *GetGlAccountsParams) WithTimeout(timeout time.Duration) *GetGlAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get gl accounts params +func (o *GetGlAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get gl accounts params +func (o *GetGlAccountsParams) WithContext(ctx context.Context) *GetGlAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get gl accounts params +func (o *GetGlAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get gl accounts params +func (o *GetGlAccountsParams) WithHTTPClient(client *http.Client) *GetGlAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get gl accounts params +func (o *GetGlAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get gl accounts params +func (o *GetGlAccountsParams) WithAccountID(accountID *string) *GetGlAccountsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get gl accounts params +func (o *GetGlAccountsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithID adds the id to the get gl accounts params +func (o *GetGlAccountsParams) WithID(id *string) *GetGlAccountsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get gl accounts params +func (o *GetGlAccountsParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get gl accounts params +func (o *GetGlAccountsParams) WithLimit(limit *int64) *GetGlAccountsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get gl accounts params +func (o *GetGlAccountsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get gl accounts params +func (o *GetGlAccountsParams) WithOffset(offset *int64) *GetGlAccountsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get gl accounts params +func (o *GetGlAccountsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetGlAccountsParams) 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.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/gl_account/get_gl_accounts_responses.go b/api/ledger/ledger_client/gl_account/get_gl_accounts_responses.go new file mode 100644 index 0000000..20e8d9d --- /dev/null +++ b/api/ledger/ledger_client/gl_account/get_gl_accounts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetGlAccountsReader is a Reader for the GetGlAccounts structure. +type GetGlAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetGlAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetGlAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetGlAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetGlAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetGlAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetGlAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetGlAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetGlAccountsOK creates a GetGlAccountsOK with default headers values +func NewGetGlAccountsOK() *GetGlAccountsOK { + return &GetGlAccountsOK{} +} + +/*GetGlAccountsOK handles this case with default header values. + +Taxnexus Response with GL Account objects with Journal Items +*/ +type GetGlAccountsOK struct { + Payload *ledger_models.GlAccountResponse +} + +func (o *GetGlAccountsOK) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsOK %+v", 200, o.Payload) +} + +func (o *GetGlAccountsOK) GetPayload() *ledger_models.GlAccountResponse { + return o.Payload +} + +func (o *GetGlAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.GlAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsUnauthorized creates a GetGlAccountsUnauthorized with default headers values +func NewGetGlAccountsUnauthorized() *GetGlAccountsUnauthorized { + return &GetGlAccountsUnauthorized{} +} + +/*GetGlAccountsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetGlAccountsUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetGlAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetGlAccountsUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsForbidden creates a GetGlAccountsForbidden with default headers values +func NewGetGlAccountsForbidden() *GetGlAccountsForbidden { + return &GetGlAccountsForbidden{} +} + +/*GetGlAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetGlAccountsForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetGlAccountsForbidden) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsForbidden %+v", 403, o.Payload) +} + +func (o *GetGlAccountsForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsNotFound creates a GetGlAccountsNotFound with default headers values +func NewGetGlAccountsNotFound() *GetGlAccountsNotFound { + return &GetGlAccountsNotFound{} +} + +/*GetGlAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetGlAccountsNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetGlAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsNotFound %+v", 404, o.Payload) +} + +func (o *GetGlAccountsNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsUnprocessableEntity creates a GetGlAccountsUnprocessableEntity with default headers values +func NewGetGlAccountsUnprocessableEntity() *GetGlAccountsUnprocessableEntity { + return &GetGlAccountsUnprocessableEntity{} +} + +/*GetGlAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetGlAccountsUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetGlAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetGlAccountsUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsInternalServerError creates a GetGlAccountsInternalServerError with default headers values +func NewGetGlAccountsInternalServerError() *GetGlAccountsInternalServerError { + return &GetGlAccountsInternalServerError{} +} + +/*GetGlAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetGlAccountsInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetGlAccountsInternalServerError) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetGlAccountsInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/gl_account/gl_account_client.go b/api/ledger/ledger_client/gl_account/gl_account_client.go new file mode 100644 index 0000000..f2af2fa --- /dev/null +++ b/api/ledger/ledger_client/gl_account/gl_account_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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 gl account API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for gl account API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetGlAccounts(params *GetGlAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlAccountsOK, error) + + PostGlAccounts(params *PostGlAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostGlAccountsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetGlAccounts gets a list of general accounts + + Return a list of available General Accounts +*/ +func (a *Client) GetGlAccounts(params *GetGlAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetGlAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getGlAccounts", + Method: "GET", + PathPattern: "/glaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetGlAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetGlAccountsOK) + 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 getGlAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostGlAccounts creates new g l accounts + + Create new GL Accounts +*/ +func (a *Client) PostGlAccounts(params *PostGlAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostGlAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostGlAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postGlAccounts", + Method: "POST", + PathPattern: "/glaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostGlAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostGlAccountsOK) + 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 postGlAccounts: 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/ledger/ledger_client/gl_account/post_gl_accounts_parameters.go b/api/ledger/ledger_client/gl_account/post_gl_accounts_parameters.go new file mode 100644 index 0000000..f3f2249 --- /dev/null +++ b/api/ledger/ledger_client/gl_account/post_gl_accounts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// NewPostGlAccountsParams creates a new PostGlAccountsParams object +// with the default values initialized. +func NewPostGlAccountsParams() *PostGlAccountsParams { + var () + return &PostGlAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostGlAccountsParamsWithTimeout creates a new PostGlAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostGlAccountsParamsWithTimeout(timeout time.Duration) *PostGlAccountsParams { + var () + return &PostGlAccountsParams{ + + timeout: timeout, + } +} + +// NewPostGlAccountsParamsWithContext creates a new PostGlAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostGlAccountsParamsWithContext(ctx context.Context) *PostGlAccountsParams { + var () + return &PostGlAccountsParams{ + + Context: ctx, + } +} + +// NewPostGlAccountsParamsWithHTTPClient creates a new PostGlAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostGlAccountsParamsWithHTTPClient(client *http.Client) *PostGlAccountsParams { + var () + return &PostGlAccountsParams{ + HTTPClient: client, + } +} + +/*PostGlAccountsParams contains all the parameters to send to the API endpoint +for the post gl accounts operation typically these are written to a http.Request +*/ +type PostGlAccountsParams struct { + + /*GlAccountRequest + An array of new GL Account records + + */ + GlAccountRequest *ledger_models.GlAccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post gl accounts params +func (o *PostGlAccountsParams) WithTimeout(timeout time.Duration) *PostGlAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post gl accounts params +func (o *PostGlAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post gl accounts params +func (o *PostGlAccountsParams) WithContext(ctx context.Context) *PostGlAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post gl accounts params +func (o *PostGlAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post gl accounts params +func (o *PostGlAccountsParams) WithHTTPClient(client *http.Client) *PostGlAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post gl accounts params +func (o *PostGlAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGlAccountRequest adds the glAccountRequest to the post gl accounts params +func (o *PostGlAccountsParams) WithGlAccountRequest(glAccountRequest *ledger_models.GlAccountRequest) *PostGlAccountsParams { + o.SetGlAccountRequest(glAccountRequest) + return o +} + +// SetGlAccountRequest adds the glAccountRequest to the post gl accounts params +func (o *PostGlAccountsParams) SetGlAccountRequest(glAccountRequest *ledger_models.GlAccountRequest) { + o.GlAccountRequest = glAccountRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostGlAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.GlAccountRequest != nil { + if err := r.SetBodyParam(o.GlAccountRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/gl_account/post_gl_accounts_responses.go b/api/ledger/ledger_client/gl_account/post_gl_accounts_responses.go new file mode 100644 index 0000000..47b1329 --- /dev/null +++ b/api/ledger/ledger_client/gl_account/post_gl_accounts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// PostGlAccountsReader is a Reader for the PostGlAccounts structure. +type PostGlAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostGlAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostGlAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostGlAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostGlAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostGlAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostGlAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostGlAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostGlAccountsOK creates a PostGlAccountsOK with default headers values +func NewPostGlAccountsOK() *PostGlAccountsOK { + return &PostGlAccountsOK{} +} + +/*PostGlAccountsOK handles this case with default header values. + +Taxnexus Response with GL Account objects with Journal Items +*/ +type PostGlAccountsOK struct { + Payload *ledger_models.GlAccountResponse +} + +func (o *PostGlAccountsOK) Error() string { + return fmt.Sprintf("[POST /glaccounts][%d] postGlAccountsOK %+v", 200, o.Payload) +} + +func (o *PostGlAccountsOK) GetPayload() *ledger_models.GlAccountResponse { + return o.Payload +} + +func (o *PostGlAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.GlAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlAccountsUnauthorized creates a PostGlAccountsUnauthorized with default headers values +func NewPostGlAccountsUnauthorized() *PostGlAccountsUnauthorized { + return &PostGlAccountsUnauthorized{} +} + +/*PostGlAccountsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostGlAccountsUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *PostGlAccountsUnauthorized) Error() string { + return fmt.Sprintf("[POST /glaccounts][%d] postGlAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostGlAccountsUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlAccountsForbidden creates a PostGlAccountsForbidden with default headers values +func NewPostGlAccountsForbidden() *PostGlAccountsForbidden { + return &PostGlAccountsForbidden{} +} + +/*PostGlAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostGlAccountsForbidden struct { + Payload *ledger_models.Error +} + +func (o *PostGlAccountsForbidden) Error() string { + return fmt.Sprintf("[POST /glaccounts][%d] postGlAccountsForbidden %+v", 403, o.Payload) +} + +func (o *PostGlAccountsForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlAccountsNotFound creates a PostGlAccountsNotFound with default headers values +func NewPostGlAccountsNotFound() *PostGlAccountsNotFound { + return &PostGlAccountsNotFound{} +} + +/*PostGlAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostGlAccountsNotFound struct { + Payload *ledger_models.Error +} + +func (o *PostGlAccountsNotFound) Error() string { + return fmt.Sprintf("[POST /glaccounts][%d] postGlAccountsNotFound %+v", 404, o.Payload) +} + +func (o *PostGlAccountsNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlAccountsUnprocessableEntity creates a PostGlAccountsUnprocessableEntity with default headers values +func NewPostGlAccountsUnprocessableEntity() *PostGlAccountsUnprocessableEntity { + return &PostGlAccountsUnprocessableEntity{} +} + +/*PostGlAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostGlAccountsUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *PostGlAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /glaccounts][%d] postGlAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostGlAccountsUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlAccountsInternalServerError creates a PostGlAccountsInternalServerError with default headers values +func NewPostGlAccountsInternalServerError() *PostGlAccountsInternalServerError { + return &PostGlAccountsInternalServerError{} +} + +/*PostGlAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostGlAccountsInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *PostGlAccountsInternalServerError) Error() string { + return fmt.Sprintf("[POST /glaccounts][%d] postGlAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostGlAccountsInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/gl_balance/get_gl_balances_parameters.go b/api/ledger/ledger_client/gl_balance/get_gl_balances_parameters.go new file mode 100644 index 0000000..e8b1b59 --- /dev/null +++ b/api/ledger/ledger_client/gl_balance/get_gl_balances_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balance + +// 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" +) + +// NewGetGlBalancesParams creates a new GetGlBalancesParams object +// with the default values initialized. +func NewGetGlBalancesParams() *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetGlBalancesParamsWithTimeout creates a new GetGlBalancesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetGlBalancesParamsWithTimeout(timeout time.Duration) *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + + timeout: timeout, + } +} + +// NewGetGlBalancesParamsWithContext creates a new GetGlBalancesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetGlBalancesParamsWithContext(ctx context.Context) *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + + Context: ctx, + } +} + +// NewGetGlBalancesParamsWithHTTPClient creates a new GetGlBalancesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetGlBalancesParamsWithHTTPClient(client *http.Client) *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + HTTPClient: client, + } +} + +/*GetGlBalancesParams contains all the parameters to send to the API endpoint +for the get gl balances operation typically these are written to a http.Request +*/ +type GetGlBalancesParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*GlAccountID + Taxnexus Record Id of Gl Account Record + + */ + GlAccountID *string + /*ID + Taxnexus Record Id + + */ + ID *string + /*PeriodID + Taxnexus Record Id of a Period + + */ + PeriodID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get gl balances params +func (o *GetGlBalancesParams) WithTimeout(timeout time.Duration) *GetGlBalancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get gl balances params +func (o *GetGlBalancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get gl balances params +func (o *GetGlBalancesParams) WithContext(ctx context.Context) *GetGlBalancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get gl balances params +func (o *GetGlBalancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get gl balances params +func (o *GetGlBalancesParams) WithHTTPClient(client *http.Client) *GetGlBalancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get gl balances params +func (o *GetGlBalancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get gl balances params +func (o *GetGlBalancesParams) WithAccountID(accountID *string) *GetGlBalancesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get gl balances params +func (o *GetGlBalancesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithGlAccountID adds the glAccountID to the get gl balances params +func (o *GetGlBalancesParams) WithGlAccountID(glAccountID *string) *GetGlBalancesParams { + o.SetGlAccountID(glAccountID) + return o +} + +// SetGlAccountID adds the glAccountId to the get gl balances params +func (o *GetGlBalancesParams) SetGlAccountID(glAccountID *string) { + o.GlAccountID = glAccountID +} + +// WithID adds the id to the get gl balances params +func (o *GetGlBalancesParams) WithID(id *string) *GetGlBalancesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get gl balances params +func (o *GetGlBalancesParams) SetID(id *string) { + o.ID = id +} + +// WithPeriodID adds the periodID to the get gl balances params +func (o *GetGlBalancesParams) WithPeriodID(periodID *string) *GetGlBalancesParams { + o.SetPeriodID(periodID) + return o +} + +// SetPeriodID adds the periodId to the get gl balances params +func (o *GetGlBalancesParams) SetPeriodID(periodID *string) { + o.PeriodID = periodID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetGlBalancesParams) 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.GlAccountID != nil { + + // query param glAccountId + var qrGlAccountID string + if o.GlAccountID != nil { + qrGlAccountID = *o.GlAccountID + } + qGlAccountID := qrGlAccountID + if qGlAccountID != "" { + if err := r.SetQueryParam("glAccountId", qGlAccountID); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.PeriodID != nil { + + // query param periodId + var qrPeriodID string + if o.PeriodID != nil { + qrPeriodID = *o.PeriodID + } + qPeriodID := qrPeriodID + if qPeriodID != "" { + if err := r.SetQueryParam("periodId", qPeriodID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/gl_balance/get_gl_balances_responses.go b/api/ledger/ledger_client/gl_balance/get_gl_balances_responses.go new file mode 100644 index 0000000..15d7630 --- /dev/null +++ b/api/ledger/ledger_client/gl_balance/get_gl_balances_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balance + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetGlBalancesReader is a Reader for the GetGlBalances structure. +type GetGlBalancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetGlBalancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetGlBalancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetGlBalancesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetGlBalancesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetGlBalancesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetGlBalancesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetGlBalancesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetGlBalancesOK creates a GetGlBalancesOK with default headers values +func NewGetGlBalancesOK() *GetGlBalancesOK { + return &GetGlBalancesOK{} +} + +/*GetGlBalancesOK handles this case with default header values. + +Taxnexus Response with GL Account objects with Journal Items +*/ +type GetGlBalancesOK struct { + Payload *ledger_models.GlBalanceResponse +} + +func (o *GetGlBalancesOK) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesOK %+v", 200, o.Payload) +} + +func (o *GetGlBalancesOK) GetPayload() *ledger_models.GlBalanceResponse { + return o.Payload +} + +func (o *GetGlBalancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.GlBalanceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesUnauthorized creates a GetGlBalancesUnauthorized with default headers values +func NewGetGlBalancesUnauthorized() *GetGlBalancesUnauthorized { + return &GetGlBalancesUnauthorized{} +} + +/*GetGlBalancesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetGlBalancesUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetGlBalancesUnauthorized) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetGlBalancesUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlBalancesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesForbidden creates a GetGlBalancesForbidden with default headers values +func NewGetGlBalancesForbidden() *GetGlBalancesForbidden { + return &GetGlBalancesForbidden{} +} + +/*GetGlBalancesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetGlBalancesForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetGlBalancesForbidden) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesForbidden %+v", 403, o.Payload) +} + +func (o *GetGlBalancesForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlBalancesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesNotFound creates a GetGlBalancesNotFound with default headers values +func NewGetGlBalancesNotFound() *GetGlBalancesNotFound { + return &GetGlBalancesNotFound{} +} + +/*GetGlBalancesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetGlBalancesNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetGlBalancesNotFound) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesNotFound %+v", 404, o.Payload) +} + +func (o *GetGlBalancesNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlBalancesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesUnprocessableEntity creates a GetGlBalancesUnprocessableEntity with default headers values +func NewGetGlBalancesUnprocessableEntity() *GetGlBalancesUnprocessableEntity { + return &GetGlBalancesUnprocessableEntity{} +} + +/*GetGlBalancesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetGlBalancesUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetGlBalancesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetGlBalancesUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlBalancesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesInternalServerError creates a GetGlBalancesInternalServerError with default headers values +func NewGetGlBalancesInternalServerError() *GetGlBalancesInternalServerError { + return &GetGlBalancesInternalServerError{} +} + +/*GetGlBalancesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetGlBalancesInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetGlBalancesInternalServerError) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetGlBalancesInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetGlBalancesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/gl_balance/gl_balance_client.go b/api/ledger/ledger_client/gl_balance/gl_balance_client.go new file mode 100644 index 0000000..26a14a7 --- /dev/null +++ b/api/ledger/ledger_client/gl_balance/gl_balance_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balance + +// 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 gl balance API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for gl balance API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetGlBalances(params *GetGlBalancesParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlBalancesOK, error) + + PostGlBalances(params *PostGlBalancesParams, authInfo runtime.ClientAuthInfoWriter) (*PostGlBalancesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetGlBalances gets one or more general account balance records + + Return a list of General Account Balances for a Taxnexus Account +*/ +func (a *Client) GetGlBalances(params *GetGlBalancesParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlBalancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetGlBalancesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getGlBalances", + Method: "GET", + PathPattern: "/glbalances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetGlBalancesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetGlBalancesOK) + 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 getGlBalances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostGlBalances inserts a g l balance + + Insert new GL Balance records +*/ +func (a *Client) PostGlBalances(params *PostGlBalancesParams, authInfo runtime.ClientAuthInfoWriter) (*PostGlBalancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostGlBalancesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postGlBalances", + Method: "POST", + PathPattern: "/glbalances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostGlBalancesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostGlBalancesOK) + 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 postGlBalances: 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/ledger/ledger_client/gl_balance/post_gl_balances_parameters.go b/api/ledger/ledger_client/gl_balance/post_gl_balances_parameters.go new file mode 100644 index 0000000..8068469 --- /dev/null +++ b/api/ledger/ledger_client/gl_balance/post_gl_balances_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balance + +// 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/taxnexus/go/lib/api/ledger/ledger_models" +) + +// NewPostGlBalancesParams creates a new PostGlBalancesParams object +// with the default values initialized. +func NewPostGlBalancesParams() *PostGlBalancesParams { + var () + return &PostGlBalancesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostGlBalancesParamsWithTimeout creates a new PostGlBalancesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostGlBalancesParamsWithTimeout(timeout time.Duration) *PostGlBalancesParams { + var () + return &PostGlBalancesParams{ + + timeout: timeout, + } +} + +// NewPostGlBalancesParamsWithContext creates a new PostGlBalancesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostGlBalancesParamsWithContext(ctx context.Context) *PostGlBalancesParams { + var () + return &PostGlBalancesParams{ + + Context: ctx, + } +} + +// NewPostGlBalancesParamsWithHTTPClient creates a new PostGlBalancesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostGlBalancesParamsWithHTTPClient(client *http.Client) *PostGlBalancesParams { + var () + return &PostGlBalancesParams{ + HTTPClient: client, + } +} + +/*PostGlBalancesParams contains all the parameters to send to the API endpoint +for the post gl balances operation typically these are written to a http.Request +*/ +type PostGlBalancesParams struct { + + /*GlBalanceRequest + An array of new GL Balance records + + */ + GlBalanceRequest *ledger_models.GlBalanceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post gl balances params +func (o *PostGlBalancesParams) WithTimeout(timeout time.Duration) *PostGlBalancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post gl balances params +func (o *PostGlBalancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post gl balances params +func (o *PostGlBalancesParams) WithContext(ctx context.Context) *PostGlBalancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post gl balances params +func (o *PostGlBalancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post gl balances params +func (o *PostGlBalancesParams) WithHTTPClient(client *http.Client) *PostGlBalancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post gl balances params +func (o *PostGlBalancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGlBalanceRequest adds the glBalanceRequest to the post gl balances params +func (o *PostGlBalancesParams) WithGlBalanceRequest(glBalanceRequest *ledger_models.GlBalanceRequest) *PostGlBalancesParams { + o.SetGlBalanceRequest(glBalanceRequest) + return o +} + +// SetGlBalanceRequest adds the glBalanceRequest to the post gl balances params +func (o *PostGlBalancesParams) SetGlBalanceRequest(glBalanceRequest *ledger_models.GlBalanceRequest) { + o.GlBalanceRequest = glBalanceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostGlBalancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.GlBalanceRequest != nil { + if err := r.SetBodyParam(o.GlBalanceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/gl_balance/post_gl_balances_responses.go b/api/ledger/ledger_client/gl_balance/post_gl_balances_responses.go new file mode 100644 index 0000000..9636f69 --- /dev/null +++ b/api/ledger/ledger_client/gl_balance/post_gl_balances_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balance + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// PostGlBalancesReader is a Reader for the PostGlBalances structure. +type PostGlBalancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostGlBalancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostGlBalancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostGlBalancesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostGlBalancesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostGlBalancesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostGlBalancesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostGlBalancesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostGlBalancesOK creates a PostGlBalancesOK with default headers values +func NewPostGlBalancesOK() *PostGlBalancesOK { + return &PostGlBalancesOK{} +} + +/*PostGlBalancesOK handles this case with default header values. + +Taxnexus Response with GL Account objects with Journal Items +*/ +type PostGlBalancesOK struct { + Payload *ledger_models.GlBalanceResponse +} + +func (o *PostGlBalancesOK) Error() string { + return fmt.Sprintf("[POST /glbalances][%d] postGlBalancesOK %+v", 200, o.Payload) +} + +func (o *PostGlBalancesOK) GetPayload() *ledger_models.GlBalanceResponse { + return o.Payload +} + +func (o *PostGlBalancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.GlBalanceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlBalancesUnauthorized creates a PostGlBalancesUnauthorized with default headers values +func NewPostGlBalancesUnauthorized() *PostGlBalancesUnauthorized { + return &PostGlBalancesUnauthorized{} +} + +/*PostGlBalancesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostGlBalancesUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *PostGlBalancesUnauthorized) Error() string { + return fmt.Sprintf("[POST /glbalances][%d] postGlBalancesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostGlBalancesUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlBalancesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlBalancesForbidden creates a PostGlBalancesForbidden with default headers values +func NewPostGlBalancesForbidden() *PostGlBalancesForbidden { + return &PostGlBalancesForbidden{} +} + +/*PostGlBalancesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostGlBalancesForbidden struct { + Payload *ledger_models.Error +} + +func (o *PostGlBalancesForbidden) Error() string { + return fmt.Sprintf("[POST /glbalances][%d] postGlBalancesForbidden %+v", 403, o.Payload) +} + +func (o *PostGlBalancesForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlBalancesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlBalancesNotFound creates a PostGlBalancesNotFound with default headers values +func NewPostGlBalancesNotFound() *PostGlBalancesNotFound { + return &PostGlBalancesNotFound{} +} + +/*PostGlBalancesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostGlBalancesNotFound struct { + Payload *ledger_models.Error +} + +func (o *PostGlBalancesNotFound) Error() string { + return fmt.Sprintf("[POST /glbalances][%d] postGlBalancesNotFound %+v", 404, o.Payload) +} + +func (o *PostGlBalancesNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlBalancesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlBalancesUnprocessableEntity creates a PostGlBalancesUnprocessableEntity with default headers values +func NewPostGlBalancesUnprocessableEntity() *PostGlBalancesUnprocessableEntity { + return &PostGlBalancesUnprocessableEntity{} +} + +/*PostGlBalancesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostGlBalancesUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *PostGlBalancesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /glbalances][%d] postGlBalancesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostGlBalancesUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlBalancesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostGlBalancesInternalServerError creates a PostGlBalancesInternalServerError with default headers values +func NewPostGlBalancesInternalServerError() *PostGlBalancesInternalServerError { + return &PostGlBalancesInternalServerError{} +} + +/*PostGlBalancesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostGlBalancesInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *PostGlBalancesInternalServerError) Error() string { + return fmt.Sprintf("[POST /glbalances][%d] postGlBalancesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostGlBalancesInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostGlBalancesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/journal_entry/get_journal_entries_parameters.go b/api/ledger/ledger_client/journal_entry/get_journal_entries_parameters.go new file mode 100644 index 0000000..ea8e9ad --- /dev/null +++ b/api/ledger/ledger_client/journal_entry/get_journal_entries_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_entry + +// 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" +) + +// NewGetJournalEntriesParams creates a new GetJournalEntriesParams object +// with the default values initialized. +func NewGetJournalEntriesParams() *GetJournalEntriesParams { + var () + return &GetJournalEntriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetJournalEntriesParamsWithTimeout creates a new GetJournalEntriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetJournalEntriesParamsWithTimeout(timeout time.Duration) *GetJournalEntriesParams { + var () + return &GetJournalEntriesParams{ + + timeout: timeout, + } +} + +// NewGetJournalEntriesParamsWithContext creates a new GetJournalEntriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetJournalEntriesParamsWithContext(ctx context.Context) *GetJournalEntriesParams { + var () + return &GetJournalEntriesParams{ + + Context: ctx, + } +} + +// NewGetJournalEntriesParamsWithHTTPClient creates a new GetJournalEntriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetJournalEntriesParamsWithHTTPClient(client *http.Client) *GetJournalEntriesParams { + var () + return &GetJournalEntriesParams{ + HTTPClient: client, + } +} + +/*GetJournalEntriesParams contains all the parameters to send to the API endpoint +for the get journal entries operation typically these are written to a http.Request +*/ +type GetJournalEntriesParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*DateFrom + The Starting Date for an object retrieval + + */ + DateFrom *string + /*DateTo + The Ending Date for an object retrieval + + */ + DateTo *string + /*ID + Taxnexus Record Id + + */ + ID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get journal entries params +func (o *GetJournalEntriesParams) WithTimeout(timeout time.Duration) *GetJournalEntriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get journal entries params +func (o *GetJournalEntriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get journal entries params +func (o *GetJournalEntriesParams) WithContext(ctx context.Context) *GetJournalEntriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get journal entries params +func (o *GetJournalEntriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get journal entries params +func (o *GetJournalEntriesParams) WithHTTPClient(client *http.Client) *GetJournalEntriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get journal entries params +func (o *GetJournalEntriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get journal entries params +func (o *GetJournalEntriesParams) WithAccountID(accountID *string) *GetJournalEntriesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get journal entries params +func (o *GetJournalEntriesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithDateFrom adds the dateFrom to the get journal entries params +func (o *GetJournalEntriesParams) WithDateFrom(dateFrom *string) *GetJournalEntriesParams { + o.SetDateFrom(dateFrom) + return o +} + +// SetDateFrom adds the dateFrom to the get journal entries params +func (o *GetJournalEntriesParams) SetDateFrom(dateFrom *string) { + o.DateFrom = dateFrom +} + +// WithDateTo adds the dateTo to the get journal entries params +func (o *GetJournalEntriesParams) WithDateTo(dateTo *string) *GetJournalEntriesParams { + o.SetDateTo(dateTo) + return o +} + +// SetDateTo adds the dateTo to the get journal entries params +func (o *GetJournalEntriesParams) SetDateTo(dateTo *string) { + o.DateTo = dateTo +} + +// WithID adds the id to the get journal entries params +func (o *GetJournalEntriesParams) WithID(id *string) *GetJournalEntriesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get journal entries params +func (o *GetJournalEntriesParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get journal entries params +func (o *GetJournalEntriesParams) WithLimit(limit *int64) *GetJournalEntriesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get journal entries params +func (o *GetJournalEntriesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get journal entries params +func (o *GetJournalEntriesParams) WithOffset(offset *int64) *GetJournalEntriesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get journal entries params +func (o *GetJournalEntriesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJournalEntriesParams) 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.DateFrom != nil { + + // query param dateFrom + var qrDateFrom string + if o.DateFrom != nil { + qrDateFrom = *o.DateFrom + } + qDateFrom := qrDateFrom + if qDateFrom != "" { + if err := r.SetQueryParam("dateFrom", qDateFrom); err != nil { + return err + } + } + + } + + if o.DateTo != nil { + + // query param dateTo + var qrDateTo string + if o.DateTo != nil { + qrDateTo = *o.DateTo + } + qDateTo := qrDateTo + if qDateTo != "" { + if err := r.SetQueryParam("dateTo", qDateTo); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/journal_entry/get_journal_entries_responses.go b/api/ledger/ledger_client/journal_entry/get_journal_entries_responses.go new file mode 100644 index 0000000..e3f0840 --- /dev/null +++ b/api/ledger/ledger_client/journal_entry/get_journal_entries_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_entry + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetJournalEntriesReader is a Reader for the GetJournalEntries structure. +type GetJournalEntriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJournalEntriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJournalEntriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetJournalEntriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetJournalEntriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetJournalEntriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetJournalEntriesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetJournalEntriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetJournalEntriesOK creates a GetJournalEntriesOK with default headers values +func NewGetJournalEntriesOK() *GetJournalEntriesOK { + return &GetJournalEntriesOK{} +} + +/*GetJournalEntriesOK handles this case with default header values. + +Taxnexus Response with Journal Entry objects with Journal Items +*/ +type GetJournalEntriesOK struct { + Payload *ledger_models.JournalEntryResponse +} + +func (o *GetJournalEntriesOK) Error() string { + return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesOK %+v", 200, o.Payload) +} + +func (o *GetJournalEntriesOK) GetPayload() *ledger_models.JournalEntryResponse { + return o.Payload +} + +func (o *GetJournalEntriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.JournalEntryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalEntriesUnauthorized creates a GetJournalEntriesUnauthorized with default headers values +func NewGetJournalEntriesUnauthorized() *GetJournalEntriesUnauthorized { + return &GetJournalEntriesUnauthorized{} +} + +/*GetJournalEntriesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetJournalEntriesUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetJournalEntriesUnauthorized) Error() string { + return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetJournalEntriesUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalEntriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalEntriesForbidden creates a GetJournalEntriesForbidden with default headers values +func NewGetJournalEntriesForbidden() *GetJournalEntriesForbidden { + return &GetJournalEntriesForbidden{} +} + +/*GetJournalEntriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetJournalEntriesForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetJournalEntriesForbidden) Error() string { + return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesForbidden %+v", 403, o.Payload) +} + +func (o *GetJournalEntriesForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalEntriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalEntriesNotFound creates a GetJournalEntriesNotFound with default headers values +func NewGetJournalEntriesNotFound() *GetJournalEntriesNotFound { + return &GetJournalEntriesNotFound{} +} + +/*GetJournalEntriesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetJournalEntriesNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetJournalEntriesNotFound) Error() string { + return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesNotFound %+v", 404, o.Payload) +} + +func (o *GetJournalEntriesNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalEntriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalEntriesUnprocessableEntity creates a GetJournalEntriesUnprocessableEntity with default headers values +func NewGetJournalEntriesUnprocessableEntity() *GetJournalEntriesUnprocessableEntity { + return &GetJournalEntriesUnprocessableEntity{} +} + +/*GetJournalEntriesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetJournalEntriesUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetJournalEntriesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetJournalEntriesUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalEntriesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalEntriesInternalServerError creates a GetJournalEntriesInternalServerError with default headers values +func NewGetJournalEntriesInternalServerError() *GetJournalEntriesInternalServerError { + return &GetJournalEntriesInternalServerError{} +} + +/*GetJournalEntriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetJournalEntriesInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetJournalEntriesInternalServerError) Error() string { + return fmt.Sprintf("[GET /journalentries][%d] getJournalEntriesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetJournalEntriesInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalEntriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/journal_entry/journal_entry_client.go b/api/ledger/ledger_client/journal_entry/journal_entry_client.go new file mode 100644 index 0000000..23e4c82 --- /dev/null +++ b/api/ledger/ledger_client/journal_entry/journal_entry_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_entry + +// 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 journal entry API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for journal entry API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetJournalEntries(params *GetJournalEntriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetJournalEntriesOK, error) + + PostJournalEntries(params *PostJournalEntriesParams, authInfo runtime.ClientAuthInfoWriter) (*PostJournalEntriesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetJournalEntries gets a list of journal entries + + Return a list of Journal Entries by by Journal Entry ID +*/ +func (a *Client) GetJournalEntries(params *GetJournalEntriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetJournalEntriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJournalEntriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getJournalEntries", + Method: "GET", + PathPattern: "/journalentries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetJournalEntriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetJournalEntriesOK) + 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 getJournalEntries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostJournalEntries creates new journal entry records + + Create new Journal Entry Records +*/ +func (a *Client) PostJournalEntries(params *PostJournalEntriesParams, authInfo runtime.ClientAuthInfoWriter) (*PostJournalEntriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostJournalEntriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postJournalEntries", + Method: "POST", + PathPattern: "/journalentries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostJournalEntriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostJournalEntriesOK) + 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 postJournalEntries: 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/ledger/ledger_client/journal_entry/post_journal_entries_parameters.go b/api/ledger/ledger_client/journal_entry/post_journal_entries_parameters.go new file mode 100644 index 0000000..a4d8cb9 --- /dev/null +++ b/api/ledger/ledger_client/journal_entry/post_journal_entries_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_entry + +// 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/taxnexus/go/lib/api/ledger/ledger_models" +) + +// NewPostJournalEntriesParams creates a new PostJournalEntriesParams object +// with the default values initialized. +func NewPostJournalEntriesParams() *PostJournalEntriesParams { + var () + return &PostJournalEntriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostJournalEntriesParamsWithTimeout creates a new PostJournalEntriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostJournalEntriesParamsWithTimeout(timeout time.Duration) *PostJournalEntriesParams { + var () + return &PostJournalEntriesParams{ + + timeout: timeout, + } +} + +// NewPostJournalEntriesParamsWithContext creates a new PostJournalEntriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostJournalEntriesParamsWithContext(ctx context.Context) *PostJournalEntriesParams { + var () + return &PostJournalEntriesParams{ + + Context: ctx, + } +} + +// NewPostJournalEntriesParamsWithHTTPClient creates a new PostJournalEntriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostJournalEntriesParamsWithHTTPClient(client *http.Client) *PostJournalEntriesParams { + var () + return &PostJournalEntriesParams{ + HTTPClient: client, + } +} + +/*PostJournalEntriesParams contains all the parameters to send to the API endpoint +for the post journal entries operation typically these are written to a http.Request +*/ +type PostJournalEntriesParams struct { + + /*JournalEntryRequest + An array of Journal Entry records + + */ + JournalEntryRequest *ledger_models.JournalEntryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post journal entries params +func (o *PostJournalEntriesParams) WithTimeout(timeout time.Duration) *PostJournalEntriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post journal entries params +func (o *PostJournalEntriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post journal entries params +func (o *PostJournalEntriesParams) WithContext(ctx context.Context) *PostJournalEntriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post journal entries params +func (o *PostJournalEntriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post journal entries params +func (o *PostJournalEntriesParams) WithHTTPClient(client *http.Client) *PostJournalEntriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post journal entries params +func (o *PostJournalEntriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJournalEntryRequest adds the journalEntryRequest to the post journal entries params +func (o *PostJournalEntriesParams) WithJournalEntryRequest(journalEntryRequest *ledger_models.JournalEntryRequest) *PostJournalEntriesParams { + o.SetJournalEntryRequest(journalEntryRequest) + return o +} + +// SetJournalEntryRequest adds the journalEntryRequest to the post journal entries params +func (o *PostJournalEntriesParams) SetJournalEntryRequest(journalEntryRequest *ledger_models.JournalEntryRequest) { + o.JournalEntryRequest = journalEntryRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostJournalEntriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.JournalEntryRequest != nil { + if err := r.SetBodyParam(o.JournalEntryRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/journal_entry/post_journal_entries_responses.go b/api/ledger/ledger_client/journal_entry/post_journal_entries_responses.go new file mode 100644 index 0000000..58cd1b2 --- /dev/null +++ b/api/ledger/ledger_client/journal_entry/post_journal_entries_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_entry + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// PostJournalEntriesReader is a Reader for the PostJournalEntries structure. +type PostJournalEntriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostJournalEntriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostJournalEntriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostJournalEntriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostJournalEntriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostJournalEntriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostJournalEntriesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostJournalEntriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostJournalEntriesOK creates a PostJournalEntriesOK with default headers values +func NewPostJournalEntriesOK() *PostJournalEntriesOK { + return &PostJournalEntriesOK{} +} + +/*PostJournalEntriesOK handles this case with default header values. + +Taxnexus Response with Journal Entry objects with Journal Items +*/ +type PostJournalEntriesOK struct { + Payload *ledger_models.JournalEntryResponse +} + +func (o *PostJournalEntriesOK) Error() string { + return fmt.Sprintf("[POST /journalentries][%d] postJournalEntriesOK %+v", 200, o.Payload) +} + +func (o *PostJournalEntriesOK) GetPayload() *ledger_models.JournalEntryResponse { + return o.Payload +} + +func (o *PostJournalEntriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.JournalEntryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJournalEntriesUnauthorized creates a PostJournalEntriesUnauthorized with default headers values +func NewPostJournalEntriesUnauthorized() *PostJournalEntriesUnauthorized { + return &PostJournalEntriesUnauthorized{} +} + +/*PostJournalEntriesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostJournalEntriesUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *PostJournalEntriesUnauthorized) Error() string { + return fmt.Sprintf("[POST /journalentries][%d] postJournalEntriesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostJournalEntriesUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostJournalEntriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJournalEntriesForbidden creates a PostJournalEntriesForbidden with default headers values +func NewPostJournalEntriesForbidden() *PostJournalEntriesForbidden { + return &PostJournalEntriesForbidden{} +} + +/*PostJournalEntriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostJournalEntriesForbidden struct { + Payload *ledger_models.Error +} + +func (o *PostJournalEntriesForbidden) Error() string { + return fmt.Sprintf("[POST /journalentries][%d] postJournalEntriesForbidden %+v", 403, o.Payload) +} + +func (o *PostJournalEntriesForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostJournalEntriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJournalEntriesNotFound creates a PostJournalEntriesNotFound with default headers values +func NewPostJournalEntriesNotFound() *PostJournalEntriesNotFound { + return &PostJournalEntriesNotFound{} +} + +/*PostJournalEntriesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostJournalEntriesNotFound struct { + Payload *ledger_models.Error +} + +func (o *PostJournalEntriesNotFound) Error() string { + return fmt.Sprintf("[POST /journalentries][%d] postJournalEntriesNotFound %+v", 404, o.Payload) +} + +func (o *PostJournalEntriesNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostJournalEntriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJournalEntriesUnprocessableEntity creates a PostJournalEntriesUnprocessableEntity with default headers values +func NewPostJournalEntriesUnprocessableEntity() *PostJournalEntriesUnprocessableEntity { + return &PostJournalEntriesUnprocessableEntity{} +} + +/*PostJournalEntriesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostJournalEntriesUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *PostJournalEntriesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /journalentries][%d] postJournalEntriesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostJournalEntriesUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostJournalEntriesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostJournalEntriesInternalServerError creates a PostJournalEntriesInternalServerError with default headers values +func NewPostJournalEntriesInternalServerError() *PostJournalEntriesInternalServerError { + return &PostJournalEntriesInternalServerError{} +} + +/*PostJournalEntriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostJournalEntriesInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *PostJournalEntriesInternalServerError) Error() string { + return fmt.Sprintf("[POST /journalentries][%d] postJournalEntriesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostJournalEntriesInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostJournalEntriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/journal_item/get_journal_items_parameters.go b/api/ledger/ledger_client/journal_item/get_journal_items_parameters.go new file mode 100644 index 0000000..5942dda --- /dev/null +++ b/api/ledger/ledger_client/journal_item/get_journal_items_parameters.go @@ -0,0 +1,240 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_item + +// 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" +) + +// NewGetJournalItemsParams creates a new GetJournalItemsParams object +// with the default values initialized. +func NewGetJournalItemsParams() *GetJournalItemsParams { + var () + return &GetJournalItemsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetJournalItemsParamsWithTimeout creates a new GetJournalItemsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetJournalItemsParamsWithTimeout(timeout time.Duration) *GetJournalItemsParams { + var () + return &GetJournalItemsParams{ + + timeout: timeout, + } +} + +// NewGetJournalItemsParamsWithContext creates a new GetJournalItemsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetJournalItemsParamsWithContext(ctx context.Context) *GetJournalItemsParams { + var () + return &GetJournalItemsParams{ + + Context: ctx, + } +} + +// NewGetJournalItemsParamsWithHTTPClient creates a new GetJournalItemsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetJournalItemsParamsWithHTTPClient(client *http.Client) *GetJournalItemsParams { + var () + return &GetJournalItemsParams{ + HTTPClient: client, + } +} + +/*GetJournalItemsParams contains all the parameters to send to the API endpoint +for the get journal items operation typically these are written to a http.Request +*/ +type GetJournalItemsParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get journal items params +func (o *GetJournalItemsParams) WithTimeout(timeout time.Duration) *GetJournalItemsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get journal items params +func (o *GetJournalItemsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get journal items params +func (o *GetJournalItemsParams) WithContext(ctx context.Context) *GetJournalItemsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get journal items params +func (o *GetJournalItemsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get journal items params +func (o *GetJournalItemsParams) WithHTTPClient(client *http.Client) *GetJournalItemsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get journal items params +func (o *GetJournalItemsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get journal items params +func (o *GetJournalItemsParams) WithAccountID(accountID string) *GetJournalItemsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get journal items params +func (o *GetJournalItemsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get journal items params +func (o *GetJournalItemsParams) WithMonth(month *int64) *GetJournalItemsParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get journal items params +func (o *GetJournalItemsParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get journal items params +func (o *GetJournalItemsParams) WithQuarter(quarter *int64) *GetJournalItemsParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get journal items params +func (o *GetJournalItemsParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithYear adds the year to the get journal items params +func (o *GetJournalItemsParams) WithYear(year *int64) *GetJournalItemsParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get journal items params +func (o *GetJournalItemsParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetJournalItemsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param accountId + qrAccountID := o.AccountID + qAccountID := qrAccountID + if qAccountID != "" { + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + + if o.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/journal_item/get_journal_items_responses.go b/api/ledger/ledger_client/journal_item/get_journal_items_responses.go new file mode 100644 index 0000000..23a19d8 --- /dev/null +++ b/api/ledger/ledger_client/journal_item/get_journal_items_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_item + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetJournalItemsReader is a Reader for the GetJournalItems structure. +type GetJournalItemsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetJournalItemsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetJournalItemsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetJournalItemsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetJournalItemsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetJournalItemsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetJournalItemsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetJournalItemsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetJournalItemsOK creates a GetJournalItemsOK with default headers values +func NewGetJournalItemsOK() *GetJournalItemsOK { + return &GetJournalItemsOK{} +} + +/*GetJournalItemsOK handles this case with default header values. + +Taxnexus Response with Journal Item objects +*/ +type GetJournalItemsOK struct { + Payload *ledger_models.JournalItemSummaryResponse +} + +func (o *GetJournalItemsOK) Error() string { + return fmt.Sprintf("[GET /journalitems][%d] getJournalItemsOK %+v", 200, o.Payload) +} + +func (o *GetJournalItemsOK) GetPayload() *ledger_models.JournalItemSummaryResponse { + return o.Payload +} + +func (o *GetJournalItemsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.JournalItemSummaryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalItemsUnauthorized creates a GetJournalItemsUnauthorized with default headers values +func NewGetJournalItemsUnauthorized() *GetJournalItemsUnauthorized { + return &GetJournalItemsUnauthorized{} +} + +/*GetJournalItemsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetJournalItemsUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetJournalItemsUnauthorized) Error() string { + return fmt.Sprintf("[GET /journalitems][%d] getJournalItemsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetJournalItemsUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalItemsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalItemsForbidden creates a GetJournalItemsForbidden with default headers values +func NewGetJournalItemsForbidden() *GetJournalItemsForbidden { + return &GetJournalItemsForbidden{} +} + +/*GetJournalItemsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetJournalItemsForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetJournalItemsForbidden) Error() string { + return fmt.Sprintf("[GET /journalitems][%d] getJournalItemsForbidden %+v", 403, o.Payload) +} + +func (o *GetJournalItemsForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalItemsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalItemsNotFound creates a GetJournalItemsNotFound with default headers values +func NewGetJournalItemsNotFound() *GetJournalItemsNotFound { + return &GetJournalItemsNotFound{} +} + +/*GetJournalItemsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetJournalItemsNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetJournalItemsNotFound) Error() string { + return fmt.Sprintf("[GET /journalitems][%d] getJournalItemsNotFound %+v", 404, o.Payload) +} + +func (o *GetJournalItemsNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalItemsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalItemsUnprocessableEntity creates a GetJournalItemsUnprocessableEntity with default headers values +func NewGetJournalItemsUnprocessableEntity() *GetJournalItemsUnprocessableEntity { + return &GetJournalItemsUnprocessableEntity{} +} + +/*GetJournalItemsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetJournalItemsUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetJournalItemsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /journalitems][%d] getJournalItemsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetJournalItemsUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalItemsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetJournalItemsInternalServerError creates a GetJournalItemsInternalServerError with default headers values +func NewGetJournalItemsInternalServerError() *GetJournalItemsInternalServerError { + return &GetJournalItemsInternalServerError{} +} + +/*GetJournalItemsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetJournalItemsInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetJournalItemsInternalServerError) Error() string { + return fmt.Sprintf("[GET /journalitems][%d] getJournalItemsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetJournalItemsInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetJournalItemsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/journal_item/journal_item_client.go b/api/ledger/ledger_client/journal_item/journal_item_client.go new file mode 100644 index 0000000..21a89fa --- /dev/null +++ b/api/ledger/ledger_client/journal_item/journal_item_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package journal_item + +// 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 journal item API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for journal item API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetJournalItems(params *GetJournalItemsParams, authInfo runtime.ClientAuthInfoWriter) (*GetJournalItemsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetJournalItems gets a journal item report + + Get summaries of Journal Items by year, month and Quarter +*/ +func (a *Client) GetJournalItems(params *GetJournalItemsParams, authInfo runtime.ClientAuthInfoWriter) (*GetJournalItemsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJournalItemsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getJournalItems", + Method: "GET", + PathPattern: "/journalitems", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetJournalItemsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetJournalItemsOK) + 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 getJournalItems: 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/ledger/ledger_client/ledger_client.go b/api/ledger/ledger_client/ledger_client.go new file mode 100644 index 0000000..ae7e4c7 --- /dev/null +++ b/api/ledger/ledger_client/ledger_client.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_client/accounting_rule" + "github.com/taxnexus/go/lib/api/ledger/ledger_client/accounting_ruleset" + "github.com/taxnexus/go/lib/api/ledger/ledger_client/coa" + "github.com/taxnexus/go/lib/api/ledger/ledger_client/gl_account" + "github.com/taxnexus/go/lib/api/ledger/ledger_client/gl_balance" + "github.com/taxnexus/go/lib/api/ledger/ledger_client/journal_entry" + "github.com/taxnexus/go/lib/api/ledger/ledger_client/journal_item" + "github.com/taxnexus/go/lib/api/ledger/ledger_client/period" +) + +// Default ledger HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "ledger.fabric.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 ledger HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Ledger { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new ledger HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Ledger { + // 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 ledger client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Ledger { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Ledger) + cli.Transport = transport + cli.AccountingRule = accounting_rule.New(transport, formats) + cli.AccountingRuleset = accounting_ruleset.New(transport, formats) + cli.Coa = coa.New(transport, formats) + cli.GlAccount = gl_account.New(transport, formats) + cli.GlBalance = gl_balance.New(transport, formats) + cli.JournalEntry = journal_entry.New(transport, formats) + cli.JournalItem = journal_item.New(transport, formats) + cli.Period = period.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 +} + +// Ledger is a client for ledger +type Ledger struct { + AccountingRule accounting_rule.ClientService + + AccountingRuleset accounting_ruleset.ClientService + + Coa coa.ClientService + + GlAccount gl_account.ClientService + + GlBalance gl_balance.ClientService + + JournalEntry journal_entry.ClientService + + JournalItem journal_item.ClientService + + Period period.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Ledger) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.AccountingRule.SetTransport(transport) + c.AccountingRuleset.SetTransport(transport) + c.Coa.SetTransport(transport) + c.GlAccount.SetTransport(transport) + c.GlBalance.SetTransport(transport) + c.JournalEntry.SetTransport(transport) + c.JournalItem.SetTransport(transport) + c.Period.SetTransport(transport) +} diff --git a/api/ledger/ledger_client/period/get_periods_parameters.go b/api/ledger/ledger_client/period/get_periods_parameters.go new file mode 100644 index 0000000..bf10960 --- /dev/null +++ b/api/ledger/ledger_client/period/get_periods_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package period + +// 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" +) + +// NewGetPeriodsParams creates a new GetPeriodsParams object +// with the default values initialized. +func NewGetPeriodsParams() *GetPeriodsParams { + var () + return &GetPeriodsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPeriodsParamsWithTimeout creates a new GetPeriodsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPeriodsParamsWithTimeout(timeout time.Duration) *GetPeriodsParams { + var () + return &GetPeriodsParams{ + + timeout: timeout, + } +} + +// NewGetPeriodsParamsWithContext creates a new GetPeriodsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPeriodsParamsWithContext(ctx context.Context) *GetPeriodsParams { + var () + return &GetPeriodsParams{ + + Context: ctx, + } +} + +// NewGetPeriodsParamsWithHTTPClient creates a new GetPeriodsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPeriodsParamsWithHTTPClient(client *http.Client) *GetPeriodsParams { + var () + return &GetPeriodsParams{ + HTTPClient: client, + } +} + +/*GetPeriodsParams contains all the parameters to send to the API endpoint +for the get periods operation typically these are written to a http.Request +*/ +type GetPeriodsParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Date + The Date for an object retrieval + + */ + Date *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*PeriodID + Taxnexus Record Id of a Period + + */ + PeriodID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get periods params +func (o *GetPeriodsParams) WithTimeout(timeout time.Duration) *GetPeriodsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get periods params +func (o *GetPeriodsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get periods params +func (o *GetPeriodsParams) WithContext(ctx context.Context) *GetPeriodsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get periods params +func (o *GetPeriodsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get periods params +func (o *GetPeriodsParams) WithHTTPClient(client *http.Client) *GetPeriodsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get periods params +func (o *GetPeriodsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get periods params +func (o *GetPeriodsParams) WithAccountID(accountID *string) *GetPeriodsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get periods params +func (o *GetPeriodsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithDate adds the date to the get periods params +func (o *GetPeriodsParams) WithDate(date *string) *GetPeriodsParams { + o.SetDate(date) + return o +} + +// SetDate adds the date to the get periods params +func (o *GetPeriodsParams) SetDate(date *string) { + o.Date = date +} + +// WithLimit adds the limit to the get periods params +func (o *GetPeriodsParams) WithLimit(limit *int64) *GetPeriodsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get periods params +func (o *GetPeriodsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get periods params +func (o *GetPeriodsParams) WithOffset(offset *int64) *GetPeriodsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get periods params +func (o *GetPeriodsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPeriodID adds the periodID to the get periods params +func (o *GetPeriodsParams) WithPeriodID(periodID *string) *GetPeriodsParams { + o.SetPeriodID(periodID) + return o +} + +// SetPeriodID adds the periodId to the get periods params +func (o *GetPeriodsParams) SetPeriodID(periodID *string) { + o.PeriodID = periodID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPeriodsParams) 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.Date != nil { + + // query param date + var qrDate string + if o.Date != nil { + qrDate = *o.Date + } + qDate := qrDate + if qDate != "" { + if err := r.SetQueryParam("date", qDate); 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.PeriodID != nil { + + // query param periodId + var qrPeriodID string + if o.PeriodID != nil { + qrPeriodID = *o.PeriodID + } + qPeriodID := qrPeriodID + if qPeriodID != "" { + if err := r.SetQueryParam("periodId", qPeriodID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/period/get_periods_responses.go b/api/ledger/ledger_client/period/get_periods_responses.go new file mode 100644 index 0000000..5121737 --- /dev/null +++ b/api/ledger/ledger_client/period/get_periods_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package period + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// GetPeriodsReader is a Reader for the GetPeriods structure. +type GetPeriodsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPeriodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPeriodsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPeriodsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPeriodsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPeriodsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPeriodsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPeriodsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPeriodsOK creates a GetPeriodsOK with default headers values +func NewGetPeriodsOK() *GetPeriodsOK { + return &GetPeriodsOK{} +} + +/*GetPeriodsOK handles this case with default header values. + +Taxnexus Response with Period objects +*/ +type GetPeriodsOK struct { + Payload *ledger_models.PeriodResponse +} + +func (o *GetPeriodsOK) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsOK %+v", 200, o.Payload) +} + +func (o *GetPeriodsOK) GetPayload() *ledger_models.PeriodResponse { + return o.Payload +} + +func (o *GetPeriodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.PeriodResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsUnauthorized creates a GetPeriodsUnauthorized with default headers values +func NewGetPeriodsUnauthorized() *GetPeriodsUnauthorized { + return &GetPeriodsUnauthorized{} +} + +/*GetPeriodsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetPeriodsUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *GetPeriodsUnauthorized) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPeriodsUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetPeriodsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsForbidden creates a GetPeriodsForbidden with default headers values +func NewGetPeriodsForbidden() *GetPeriodsForbidden { + return &GetPeriodsForbidden{} +} + +/*GetPeriodsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPeriodsForbidden struct { + Payload *ledger_models.Error +} + +func (o *GetPeriodsForbidden) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsForbidden %+v", 403, o.Payload) +} + +func (o *GetPeriodsForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetPeriodsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsNotFound creates a GetPeriodsNotFound with default headers values +func NewGetPeriodsNotFound() *GetPeriodsNotFound { + return &GetPeriodsNotFound{} +} + +/*GetPeriodsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPeriodsNotFound struct { + Payload *ledger_models.Error +} + +func (o *GetPeriodsNotFound) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsNotFound %+v", 404, o.Payload) +} + +func (o *GetPeriodsNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetPeriodsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsUnprocessableEntity creates a GetPeriodsUnprocessableEntity with default headers values +func NewGetPeriodsUnprocessableEntity() *GetPeriodsUnprocessableEntity { + return &GetPeriodsUnprocessableEntity{} +} + +/*GetPeriodsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPeriodsUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *GetPeriodsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPeriodsUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetPeriodsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsInternalServerError creates a GetPeriodsInternalServerError with default headers values +func NewGetPeriodsInternalServerError() *GetPeriodsInternalServerError { + return &GetPeriodsInternalServerError{} +} + +/*GetPeriodsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPeriodsInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *GetPeriodsInternalServerError) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPeriodsInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *GetPeriodsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_client/period/period_client.go b/api/ledger/ledger_client/period/period_client.go new file mode 100644 index 0000000..5eb6b7f --- /dev/null +++ b/api/ledger/ledger_client/period/period_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package period + +// 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 period API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for period API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPeriods(params *GetPeriodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPeriodsOK, error) + + PostPeriods(params *PostPeriodsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPeriodsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPeriods gets a list of periods + + Return a list of Periods for an Account +*/ +func (a *Client) GetPeriods(params *GetPeriodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPeriodsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPeriodsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPeriods", + Method: "GET", + PathPattern: "/periods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPeriodsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPeriodsOK) + 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 getPeriods: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPeriods creates new periods + + Update Period records +*/ +func (a *Client) PostPeriods(params *PostPeriodsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPeriodsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPeriodsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPeriods", + Method: "POST", + PathPattern: "/periods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPeriodsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPeriodsOK) + 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 postPeriods: 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/ledger/ledger_client/period/post_periods_parameters.go b/api/ledger/ledger_client/period/post_periods_parameters.go new file mode 100644 index 0000000..296d353 --- /dev/null +++ b/api/ledger/ledger_client/period/post_periods_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package period + +// 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/taxnexus/go/lib/api/ledger/ledger_models" +) + +// NewPostPeriodsParams creates a new PostPeriodsParams object +// with the default values initialized. +func NewPostPeriodsParams() *PostPeriodsParams { + var () + return &PostPeriodsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPeriodsParamsWithTimeout creates a new PostPeriodsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPeriodsParamsWithTimeout(timeout time.Duration) *PostPeriodsParams { + var () + return &PostPeriodsParams{ + + timeout: timeout, + } +} + +// NewPostPeriodsParamsWithContext creates a new PostPeriodsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPeriodsParamsWithContext(ctx context.Context) *PostPeriodsParams { + var () + return &PostPeriodsParams{ + + Context: ctx, + } +} + +// NewPostPeriodsParamsWithHTTPClient creates a new PostPeriodsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPeriodsParamsWithHTTPClient(client *http.Client) *PostPeriodsParams { + var () + return &PostPeriodsParams{ + HTTPClient: client, + } +} + +/*PostPeriodsParams contains all the parameters to send to the API endpoint +for the post periods operation typically these are written to a http.Request +*/ +type PostPeriodsParams struct { + + /*PeriodRequest + An array of Period records + + */ + PeriodRequest *ledger_models.PeriodRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post periods params +func (o *PostPeriodsParams) WithTimeout(timeout time.Duration) *PostPeriodsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post periods params +func (o *PostPeriodsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post periods params +func (o *PostPeriodsParams) WithContext(ctx context.Context) *PostPeriodsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post periods params +func (o *PostPeriodsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post periods params +func (o *PostPeriodsParams) WithHTTPClient(client *http.Client) *PostPeriodsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post periods params +func (o *PostPeriodsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPeriodRequest adds the periodRequest to the post periods params +func (o *PostPeriodsParams) WithPeriodRequest(periodRequest *ledger_models.PeriodRequest) *PostPeriodsParams { + o.SetPeriodRequest(periodRequest) + return o +} + +// SetPeriodRequest adds the periodRequest to the post periods params +func (o *PostPeriodsParams) SetPeriodRequest(periodRequest *ledger_models.PeriodRequest) { + o.PeriodRequest = periodRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPeriodsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PeriodRequest != nil { + if err := r.SetBodyParam(o.PeriodRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ledger/ledger_client/period/post_periods_responses.go b/api/ledger/ledger_client/period/post_periods_responses.go new file mode 100644 index 0000000..5201002 --- /dev/null +++ b/api/ledger/ledger_client/period/post_periods_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package period + +// 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" + + "github.com/taxnexus/go/lib/api/ledger/ledger_models" +) + +// PostPeriodsReader is a Reader for the PostPeriods structure. +type PostPeriodsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPeriodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPeriodsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPeriodsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPeriodsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPeriodsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPeriodsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPeriodsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPeriodsOK creates a PostPeriodsOK with default headers values +func NewPostPeriodsOK() *PostPeriodsOK { + return &PostPeriodsOK{} +} + +/*PostPeriodsOK handles this case with default header values. + +Taxnexus Response with Period objects +*/ +type PostPeriodsOK struct { + Payload *ledger_models.PeriodResponse +} + +func (o *PostPeriodsOK) Error() string { + return fmt.Sprintf("[POST /periods][%d] postPeriodsOK %+v", 200, o.Payload) +} + +func (o *PostPeriodsOK) GetPayload() *ledger_models.PeriodResponse { + return o.Payload +} + +func (o *PostPeriodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.PeriodResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPeriodsUnauthorized creates a PostPeriodsUnauthorized with default headers values +func NewPostPeriodsUnauthorized() *PostPeriodsUnauthorized { + return &PostPeriodsUnauthorized{} +} + +/*PostPeriodsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostPeriodsUnauthorized struct { + Payload *ledger_models.Error +} + +func (o *PostPeriodsUnauthorized) Error() string { + return fmt.Sprintf("[POST /periods][%d] postPeriodsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPeriodsUnauthorized) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostPeriodsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPeriodsForbidden creates a PostPeriodsForbidden with default headers values +func NewPostPeriodsForbidden() *PostPeriodsForbidden { + return &PostPeriodsForbidden{} +} + +/*PostPeriodsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPeriodsForbidden struct { + Payload *ledger_models.Error +} + +func (o *PostPeriodsForbidden) Error() string { + return fmt.Sprintf("[POST /periods][%d] postPeriodsForbidden %+v", 403, o.Payload) +} + +func (o *PostPeriodsForbidden) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostPeriodsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPeriodsNotFound creates a PostPeriodsNotFound with default headers values +func NewPostPeriodsNotFound() *PostPeriodsNotFound { + return &PostPeriodsNotFound{} +} + +/*PostPeriodsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPeriodsNotFound struct { + Payload *ledger_models.Error +} + +func (o *PostPeriodsNotFound) Error() string { + return fmt.Sprintf("[POST /periods][%d] postPeriodsNotFound %+v", 404, o.Payload) +} + +func (o *PostPeriodsNotFound) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostPeriodsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPeriodsUnprocessableEntity creates a PostPeriodsUnprocessableEntity with default headers values +func NewPostPeriodsUnprocessableEntity() *PostPeriodsUnprocessableEntity { + return &PostPeriodsUnprocessableEntity{} +} + +/*PostPeriodsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPeriodsUnprocessableEntity struct { + Payload *ledger_models.Error +} + +func (o *PostPeriodsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /periods][%d] postPeriodsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostPeriodsUnprocessableEntity) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostPeriodsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPeriodsInternalServerError creates a PostPeriodsInternalServerError with default headers values +func NewPostPeriodsInternalServerError() *PostPeriodsInternalServerError { + return &PostPeriodsInternalServerError{} +} + +/*PostPeriodsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPeriodsInternalServerError struct { + Payload *ledger_models.Error +} + +func (o *PostPeriodsInternalServerError) Error() string { + return fmt.Sprintf("[POST /periods][%d] postPeriodsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPeriodsInternalServerError) GetPayload() *ledger_models.Error { + return o.Payload +} + +func (o *PostPeriodsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ledger_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/ledger/ledger_models/accounting_rule.go b/api/ledger/ledger_models/accounting_rule.go new file mode 100644 index 0000000..c9da1b4 --- /dev/null +++ b/api/ledger/ledger_models/accounting_rule.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRule Rules used to assign transactions to the proper GL accounts +// +// swagger:model AccountingRule +type AccountingRule struct { + + // The Account ID for whom this Account Rule exists + AcountID string `json:"AcountID,omitempty"` + + // The Taxnexus ID of the Cost of Goods Sold account to be used for this Accounting Rule + COGSAccountID string `json:"COGSAccountID,omitempty"` + + // COGS Account Name + COGSAccountName string `json:"COGSAccountName,omitempty"` + + // The Code used for Accounting Rule Lookups + Code string `json:"Code,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // The Taxnexus ID of the GL Account that is the Credit Account to be used in this Accounting Rule + CreditAccountID string `json:"CreditAccountID,omitempty"` + + // Credit Account Name + CreditAccountName string `json:"CreditAccountName,omitempty"` + + // The GL Account that is the Debit Account to be used in this Accounting Rule + DebitAccountID string `json:"DebitAccountID,omitempty"` + + // Debit Account Name + DebitAccountName string `json:"DebitAccountName,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // The Taxnexus ID of the GL Account that is the Inventory Account to be used in this Accounting Rule + InventoryAccountID string `json:"InventoryAccountID,omitempty"` + + // Inventory Account Name + InventoryAccountName string `json:"InventoryAccountName,omitempty"` + + // Is this a deferred tax, not to be charged on the invoice? + IsDeferred bool `json:"IsDeferred,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Parent Foreign Key + ParentFK string `json:"ParentFK,omitempty"` + + // The Proportion of Revenue which is governed by this Accounting Rule; used for proportional taxing of products and services + Proportion float64 `json:"Proportion,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this accounting rule +func (m *AccountingRule) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AccountingRule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRule) UnmarshalBinary(b []byte) error { + var res AccountingRule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/accounting_rule_request.go b/api/ledger/ledger_models/accounting_rule_request.go new file mode 100644 index 0000000..5c67726 --- /dev/null +++ b/api/ledger/ledger_models/accounting_rule_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRuleRequest An array of Accounting Rule objects +// +// swagger:model AccountingRuleRequest +type AccountingRuleRequest struct { + + // data + Data []*AccountingRule `json:"Data"` +} + +// Validate validates this accounting rule request +func (m *AccountingRuleRequest) 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 *AccountingRuleRequest) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRuleRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRuleRequest) UnmarshalBinary(b []byte) error { + var res AccountingRuleRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/accounting_rule_response.go b/api/ledger/ledger_models/accounting_rule_response.go new file mode 100644 index 0000000..3c44809 --- /dev/null +++ b/api/ledger/ledger_models/accounting_rule_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRuleResponse An array of Accounting Rule objects +// +// swagger:model AccountingRuleResponse +type AccountingRuleResponse struct { + + // data + Data []*AccountingRule `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this accounting rule response +func (m *AccountingRuleResponse) 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 *AccountingRuleResponse) 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 *AccountingRuleResponse) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRuleResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRuleResponse) UnmarshalBinary(b []byte) error { + var res AccountingRuleResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/accounting_ruleset.go b/api/ledger/ledger_models/accounting_ruleset.go new file mode 100644 index 0000000..fee0317 --- /dev/null +++ b/api/ledger/ledger_models/accounting_ruleset.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRuleset Master record for holding a set of accounting rules applied during GL processing +// +// swagger:model AccountingRuleset +type AccountingRuleset struct { + + // Taxnexus Account ID + AccountID string `json:"AccountID,omitempty"` + + // Accounting Ruleset Code + Code string `json:"Code,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Ruleset Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // The Accounting Rules associated with this Ruleset + Items []*AccountingRulesetItem `json:"Items"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this accounting ruleset +func (m *AccountingRuleset) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountingRuleset) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AccountingRuleset) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRuleset) UnmarshalBinary(b []byte) error { + var res AccountingRuleset + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/accounting_ruleset_item.go b/api/ledger/ledger_models/accounting_ruleset_item.go new file mode 100644 index 0000000..6c926dc --- /dev/null +++ b/api/ledger/ledger_models/accounting_ruleset_item.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRulesetItem accounting ruleset item +// +// swagger:model AccountingRulesetItem +type AccountingRulesetItem struct { + + // The code of the rule in this ruleset + AccountingRuleCode string `json:"AccountingRuleCode,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this accounting ruleset item +func (m *AccountingRulesetItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AccountingRulesetItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRulesetItem) UnmarshalBinary(b []byte) error { + var res AccountingRulesetItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/accounting_ruleset_request.go b/api/ledger/ledger_models/accounting_ruleset_request.go new file mode 100644 index 0000000..e8593d6 --- /dev/null +++ b/api/ledger/ledger_models/accounting_ruleset_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRulesetRequest An array of Accounting Ruleset objects +// +// swagger:model AccountingRulesetRequest +type AccountingRulesetRequest struct { + + // data + Data []*AccountingRuleset `json:"Data"` +} + +// Validate validates this accounting ruleset request +func (m *AccountingRulesetRequest) 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 *AccountingRulesetRequest) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRulesetRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRulesetRequest) UnmarshalBinary(b []byte) error { + var res AccountingRulesetRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/accounting_ruleset_response.go b/api/ledger/ledger_models/accounting_ruleset_response.go new file mode 100644 index 0000000..d747027 --- /dev/null +++ b/api/ledger/ledger_models/accounting_ruleset_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRulesetResponse An array of Accounting Ruleset objects +// +// swagger:model AccountingRulesetResponse +type AccountingRulesetResponse struct { + + // data + Data []*AccountingRuleset `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this accounting ruleset response +func (m *AccountingRulesetResponse) 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 *AccountingRulesetResponse) 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 *AccountingRulesetResponse) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRulesetResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRulesetResponse) UnmarshalBinary(b []byte) error { + var res AccountingRulesetResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/coa.go b/api/ledger/ledger_models/coa.go new file mode 100644 index 0000000..4a019c0 --- /dev/null +++ b/api/ledger/ledger_models/coa.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Coa Chart of Accounts Report +// +// swagger:model Coa +type Coa struct { + + // Taxnexus Account ID + AccountID string `json:"AccountID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // End Date + EndDate string `json:"EndDate,omitempty"` + + // Ending Period Taxnexus ID + EndPeriodID string `json:"EndPeriodID,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // items + Items []*CoaItem `json:"Items"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Start Date + StartDate string `json:"StartDate,omitempty"` + + // Starting Period Taxnexus ID + StartPeriodID string `json:"StartPeriodID,omitempty"` + + // CoA Status + Status string `json:"Status,omitempty"` +} + +// Validate validates this coa +func (m *Coa) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Coa) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Coa) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Coa) UnmarshalBinary(b []byte) error { + var res Coa + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/coa_item.go b/api/ledger/ledger_models/coa_item.go new file mode 100644 index 0000000..f23ca19 --- /dev/null +++ b/api/ledger/ledger_models/coa_item.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoaItem coa item +// +// swagger:model CoaItem +type CoaItem struct { + + // Parent Chart of Accounts record D + CoaID string `json:"CoaID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // The Credit Balance for this item + Credits float64 `json:"Credits,omitempty"` + + // The Debit Balance for this item + Debits float64 `json:"Debits,omitempty"` + + // The General Ledger account name + GLAccountName string `json:"GLAccountName,omitempty"` + + // 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"` + + // The name of the Period for this COA Item + PeriodName string `json:"PeriodName,omitempty"` + + // The Product Code value for this CoA Item + ProductCode string `json:"ProductCode,omitempty"` + + // The Sales Regulation value for this CoA Item + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // The Taxnexus Code value for this CoA Item + TaxnexusCode string `json:"TaxnexusCode,omitempty"` +} + +// Validate validates this coa item +func (m *CoaItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CoaItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoaItem) UnmarshalBinary(b []byte) error { + var res CoaItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/coa_request.go b/api/ledger/ledger_models/coa_request.go new file mode 100644 index 0000000..344b79b --- /dev/null +++ b/api/ledger/ledger_models/coa_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoaRequest An array of Accounting Report objects +// +// swagger:model CoaRequest +type CoaRequest struct { + + // data + Data []*Coa `json:"Data"` +} + +// Validate validates this coa request +func (m *CoaRequest) 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 *CoaRequest) 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 +} + +// MarshalBinary interface implementation +func (m *CoaRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoaRequest) UnmarshalBinary(b []byte) error { + var res CoaRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/coa_response.go b/api/ledger/ledger_models/coa_response.go new file mode 100644 index 0000000..f2c7a76 --- /dev/null +++ b/api/ledger/ledger_models/coa_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CoaResponse An array of Accounting Report objects +// +// swagger:model CoaResponse +type CoaResponse struct { + + // data + Data []*Coa `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this coa response +func (m *CoaResponse) 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 *CoaResponse) 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 *CoaResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CoaResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CoaResponse) UnmarshalBinary(b []byte) error { + var res CoaResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/delete_response.go b/api/ledger/ledger_models/delete_response.go new file mode 100644 index 0000000..524d445 --- /dev/null +++ b/api/ledger/ledger_models/delete_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/ledger/ledger_models/error.go b/api/ledger/ledger_models/error.go new file mode 100644 index 0000000..0d13403 --- /dev/null +++ b/api/ledger/ledger_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // message + Message string `json:"Message,omitempty"` + + // code + Code int64 `json:"code,omitempty"` + + // fields + Fields string `json:"fields,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(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/ledger/ledger_models/gl_account.go b/api/ledger/ledger_models/gl_account.go new file mode 100644 index 0000000..4267237 --- /dev/null +++ b/api/ledger/ledger_models/gl_account.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlAccount gl account +// +// swagger:model GlAccount +type GlAccount struct { + + // Taxnexus Account that owns ths GL account + AccountID string `json:"AccountID,omitempty"` + + // Account Level + AccountLevel float64 `json:"AccountLevel,omitempty"` + + // Account Name + AccountName string `json:"AccountName,omitempty"` + + // Account Sign + AccountSign string `json:"AccountSign,omitempty"` + + // Account Type + AccountType string `json:"AccountType,omitempty"` + + // The GL Balances associated with this GL account + Balances []*GlBalance `json:"Balances"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // Is Active? + IsActive bool `json:"IsActive,omitempty"` + + // Is Bank Account ? + IsBankAccount bool `json:"IsBankAccount,omitempty"` + + // Is Summary? + IsSummary bool `json:"IsSummary,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Display value for GL Account + Name string `json:"Name,omitempty"` + + // Parent Foreign Key + ParentFK string `json:"ParentFK,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Account Number + AccountNumber float64 `json:"accountNumber,omitempty"` + + // Parent GL Account ID + ParentGLAccountID string `json:"parentGLAccountID,omitempty"` +} + +// Validate validates this gl account +func (m *GlAccount) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBalances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GlAccount) validateBalances(formats strfmt.Registry) error { + + if swag.IsZero(m.Balances) { // not required + return nil + } + + for i := 0; i < len(m.Balances); i++ { + if swag.IsZero(m.Balances[i]) { // not required + continue + } + + if m.Balances[i] != nil { + if err := m.Balances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Balances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GlAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlAccount) UnmarshalBinary(b []byte) error { + var res GlAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/gl_account_request.go b/api/ledger/ledger_models/gl_account_request.go new file mode 100644 index 0000000..43e5398 --- /dev/null +++ b/api/ledger/ledger_models/gl_account_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlAccountRequest gl account request +// +// swagger:model GlAccountRequest +type GlAccountRequest struct { + + // data + Data []*GlAccount `json:"Data"` +} + +// Validate validates this gl account request +func (m *GlAccountRequest) 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 *GlAccountRequest) 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 +} + +// MarshalBinary interface implementation +func (m *GlAccountRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlAccountRequest) UnmarshalBinary(b []byte) error { + var res GlAccountRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/gl_account_response.go b/api/ledger/ledger_models/gl_account_response.go new file mode 100644 index 0000000..6b4c4e5 --- /dev/null +++ b/api/ledger/ledger_models/gl_account_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlAccountResponse An array of GL Account Objects +// +// swagger:model GlAccountResponse +type GlAccountResponse struct { + + // data + Data []*GlAccount `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this gl account response +func (m *GlAccountResponse) 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 *GlAccountResponse) 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 *GlAccountResponse) 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 +} + +// MarshalBinary interface implementation +func (m *GlAccountResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlAccountResponse) UnmarshalBinary(b []byte) error { + var res GlAccountResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/gl_balance.go b/api/ledger/ledger_models/gl_balance.go new file mode 100644 index 0000000..1f39f10 --- /dev/null +++ b/api/ledger/ledger_models/gl_balance.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlBalance gl balance +// +// swagger:model GlBalance +type GlBalance struct { + + // Account Name + AccountName string `json:"AccountName,omitempty"` + + // Amount + Amount float64 `json:"Amount,omitempty"` + + // Close Date + CloseDate string `json:"CloseDate,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Credits + Credits float64 `json:"Credits,omitempty"` + + // Debits + Debits float64 `json:"Debits,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // GL Account Display Value + GLAccountDisplay string `json:"GLAccountDisplay,omitempty"` + + // GL Account + GLAccountID string `json:"GLAccountID,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Period ID + PeriodID string `json:"PeriodID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Rollup Credits + RollupCredits float64 `json:"RollupCredits,omitempty"` + + // Rollup Debits + RollupDebits float64 `json:"RollupDebits,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this gl balance +func (m *GlBalance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GlBalance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlBalance) UnmarshalBinary(b []byte) error { + var res GlBalance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/gl_balance_request.go b/api/ledger/ledger_models/gl_balance_request.go new file mode 100644 index 0000000..5557fb9 --- /dev/null +++ b/api/ledger/ledger_models/gl_balance_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlBalanceRequest gl balance request +// +// swagger:model GlBalanceRequest +type GlBalanceRequest struct { + + // data + Data []*GlBalance `json:"Data"` +} + +// Validate validates this gl balance request +func (m *GlBalanceRequest) 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 *GlBalanceRequest) 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 +} + +// MarshalBinary interface implementation +func (m *GlBalanceRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlBalanceRequest) UnmarshalBinary(b []byte) error { + var res GlBalanceRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/gl_balance_response.go b/api/ledger/ledger_models/gl_balance_response.go new file mode 100644 index 0000000..448a2df --- /dev/null +++ b/api/ledger/ledger_models/gl_balance_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlBalanceResponse An array of GL Balance Objects +// +// swagger:model GlBalanceResponse +type GlBalanceResponse struct { + + // data + Data []*GlBalance `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this gl balance response +func (m *GlBalanceResponse) 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 *GlBalanceResponse) 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 *GlBalanceResponse) 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 +} + +// MarshalBinary interface implementation +func (m *GlBalanceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlBalanceResponse) UnmarshalBinary(b []byte) error { + var res GlBalanceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/invalid_error.go b/api/ledger/ledger_models/invalid_error.go new file mode 100644 index 0000000..774e315 --- /dev/null +++ b/api/ledger/ledger_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/ledger/ledger_models/journal_entry.go b/api/ledger/ledger_models/journal_entry.go new file mode 100644 index 0000000..5e2f6c7 --- /dev/null +++ b/api/ledger/ledger_models/journal_entry.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JournalEntry journal entry +// +// swagger:model JournalEntry +type JournalEntry struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Balanced? + Balanced bool `json:"Balanced,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Credits + Credits float64 `json:"Credits,omitempty"` + + // Debits + Debits float64 `json:"Debits,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Rating Ingest ID + IngestID string `json:"IngestID,omitempty"` + + // The Journal Items associated with this Journal Entry + Items []*JournalItem `json:"Items"` + + // Journal Date + JournalDate string `json:"JournalDate,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Parent Foreign Key + ParentFK string `json:"ParentFK,omitempty"` + + // The ID of the period in which this Journal Entry occurs + PeriodID string `json:"PeriodID,omitempty"` + + // Posted + Posted bool `json:"Posted,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Sales Regulation + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this journal entry +func (m *JournalEntry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JournalEntry) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *JournalEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JournalEntry) UnmarshalBinary(b []byte) error { + var res JournalEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/journal_entry_request.go b/api/ledger/ledger_models/journal_entry_request.go new file mode 100644 index 0000000..10687f2 --- /dev/null +++ b/api/ledger/ledger_models/journal_entry_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JournalEntryRequest An array of Journal Entry objects with Journal Items +// +// swagger:model JournalEntryRequest +type JournalEntryRequest struct { + + // data + Data []*JournalEntry `json:"Data"` +} + +// Validate validates this journal entry request +func (m *JournalEntryRequest) 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 *JournalEntryRequest) 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 +} + +// MarshalBinary interface implementation +func (m *JournalEntryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JournalEntryRequest) UnmarshalBinary(b []byte) error { + var res JournalEntryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/journal_entry_response.go b/api/ledger/ledger_models/journal_entry_response.go new file mode 100644 index 0000000..d245b59 --- /dev/null +++ b/api/ledger/ledger_models/journal_entry_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JournalEntryResponse An array of Journal Entry objects with Journal Items +// +// swagger:model JournalEntryResponse +type JournalEntryResponse struct { + + // data + Data []*JournalEntry `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this journal entry response +func (m *JournalEntryResponse) 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 *JournalEntryResponse) 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 *JournalEntryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *JournalEntryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JournalEntryResponse) UnmarshalBinary(b []byte) error { + var res JournalEntryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/journal_item.go b/api/ledger/ledger_models/journal_item.go new file mode 100644 index 0000000..714202b --- /dev/null +++ b/api/ledger/ledger_models/journal_item.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JournalItem journal item +// +// swagger:model JournalItem +type JournalItem struct { + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Credit value for this Journal Item + Credit float64 `json:"Credit,omitempty"` + + // Debit value for this Journal Item + Debit float64 `json:"Debit,omitempty"` + + // GL Account Display Value + GLAccountDisplay string `json:"GLAccountDisplay,omitempty"` + + // GL Account ID + GLAccountID string `json:"GLAccountID,omitempty"` + + // GL Balance ID + GLBalanceID string `json:"GLBalanceID,omitempty"` + + // Invoice Item ID + InvoiceItemID string `json:"InvoiceItemID,omitempty"` + + // Journal Entry ID + JournalEntryID string `json:"JournalEntryID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // PO Item ID + POItemID string `json:"POItemID,omitempty"` + + // Product Code + ProducCode string `json:"ProducCode,omitempty"` + + // Product ID + ProductID string `json:"ProductID,omitempty"` + + // Reference Type + ReferenceType string `json:"ReferenceType,omitempty"` + + // The Sales Regulation value for this CoA Item + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Tax Transaction ID + TaxTransactionID string `json:"TaxTransactionID,omitempty"` + + // Taxnexus Code Display Value + TaxnexusCodeDisplay string `json:"TaxnexusCodeDisplay,omitempty"` + + // Taxnexus Code ID + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` +} + +// Validate validates this journal item +func (m *JournalItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JournalItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JournalItem) UnmarshalBinary(b []byte) error { + var res JournalItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/journal_item_response.go b/api/ledger/ledger_models/journal_item_response.go new file mode 100644 index 0000000..0d3d914 --- /dev/null +++ b/api/ledger/ledger_models/journal_item_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JournalItemResponse An array of Journal Item objects +// +// swagger:model JournalItemResponse +type JournalItemResponse struct { + + // data + Data []*JournalItem `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this journal item response +func (m *JournalItemResponse) 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 *JournalItemResponse) 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 *JournalItemResponse) 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 +} + +// MarshalBinary interface implementation +func (m *JournalItemResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JournalItemResponse) UnmarshalBinary(b []byte) error { + var res JournalItemResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/journal_item_summary.go b/api/ledger/ledger_models/journal_item_summary.go new file mode 100644 index 0000000..4a270e2 --- /dev/null +++ b/api/ledger/ledger_models/journal_item_summary.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JournalItemSummary journal item summary +// +// swagger:model JournalItemSummary +type JournalItemSummary struct { + + // credits + Credits float64 `json:"Credits,omitempty"` + + // debits + Debits float64 `json:"Debits,omitempty"` + + // g l account name + GLAccountName string `json:"GLAccountName,omitempty"` + + // g l balance ID + GLBalanceID string `json:"GLBalanceID,omitempty"` + + // month number + MonthNumber int64 `json:"MonthNumber,omitempty"` + + // period name + PeriodName string `json:"PeriodName,omitempty"` + + // quarter number + QuarterNumber int64 `json:"QuarterNumber,omitempty"` + + // year number + YearNumber int64 `json:"YearNumber,omitempty"` +} + +// Validate validates this journal item summary +func (m *JournalItemSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JournalItemSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JournalItemSummary) UnmarshalBinary(b []byte) error { + var res JournalItemSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/journal_item_summary_response.go b/api/ledger/ledger_models/journal_item_summary_response.go new file mode 100644 index 0000000..aac7392 --- /dev/null +++ b/api/ledger/ledger_models/journal_item_summary_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JournalItemSummaryResponse An array of Journal Item Summary objects +// +// swagger:model JournalItemSummaryResponse +type JournalItemSummaryResponse struct { + + // data + Data []*JournalItemSummary `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this journal item summary response +func (m *JournalItemSummaryResponse) 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 *JournalItemSummaryResponse) 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 *JournalItemSummaryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *JournalItemSummaryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JournalItemSummaryResponse) UnmarshalBinary(b []byte) error { + var res JournalItemSummaryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/message.go b/api/ledger/ledger_models/message.go new file mode 100644 index 0000000..c9368bd --- /dev/null +++ b/api/ledger/ledger_models/message.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/ledger/ledger_models/pagination.go b/api/ledger/ledger_models/pagination.go new file mode 100644 index 0000000..4dcc1a0 --- /dev/null +++ b/api/ledger/ledger_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/ledger/ledger_models/period.go b/api/ledger/ledger_models/period.go new file mode 100644 index 0000000..1374101 --- /dev/null +++ b/api/ledger/ledger_models/period.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Period period +// +// swagger:model Period +type Period struct { + + // Account that owns this Period + AccountID string `json:"AccountID,omitempty"` + + // Company + CompanyID string `json:"CompanyID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Days + Days int64 `json:"Days,omitempty"` + + // End Date + EndDate string `json:"EndDate,omitempty"` + + // Taxnexus 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"` + + // Month number + Month int64 `json:"Month,omitempty"` + + // Period Name + Name string `json:"Name,omitempty"` + + // Quarter Number + Quarter int64 `json:"Quarter,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // The Semiannual period in numeric format + Semiannual int64 `json:"Semiannual,omitempty"` + + // Start Date + StartDate string `json:"StartDate,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Year number + Year int64 `json:"Year,omitempty"` +} + +// Validate validates this period +func (m *Period) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Period) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Period) UnmarshalBinary(b []byte) error { + var res Period + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/period_request.go b/api/ledger/ledger_models/period_request.go new file mode 100644 index 0000000..81ca8a4 --- /dev/null +++ b/api/ledger/ledger_models/period_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PeriodRequest period request +// +// swagger:model PeriodRequest +type PeriodRequest struct { + + // data + Data []*Period `json:"Data"` +} + +// Validate validates this period request +func (m *PeriodRequest) 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 *PeriodRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PeriodRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeriodRequest) UnmarshalBinary(b []byte) error { + var res PeriodRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/period_response.go b/api/ledger/ledger_models/period_response.go new file mode 100644 index 0000000..e01109f --- /dev/null +++ b/api/ledger/ledger_models/period_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PeriodResponse An array of period objects +// +// swagger:model PeriodResponse +type PeriodResponse struct { + + // data + Data []*Period `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this period response +func (m *PeriodResponse) 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 *PeriodResponse) 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 *PeriodResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PeriodResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeriodResponse) UnmarshalBinary(b []byte) error { + var res PeriodResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/put_response.go b/api/ledger/ledger_models/put_response.go new file mode 100644 index 0000000..70c5ecd --- /dev/null +++ b/api/ledger/ledger_models/put_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PutResponse put response +// +// swagger:model PutResponse +type PutResponse struct { + + // data + Data []*Message `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this put response +func (m *PutResponse) 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 *PutResponse) 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 *PutResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PutResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PutResponse) UnmarshalBinary(b []byte) error { + var res PutResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ledger/ledger_models/request_meta.go b/api/ledger/ledger_models/request_meta.go new file mode 100644 index 0000000..ba01163 --- /dev/null +++ b/api/ledger/ledger_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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/ledger/ledger_models/response_meta.go b/api/ledger/ledger_models/response_meta.go new file mode 100644 index 0000000..6c57e1d --- /dev/null +++ b/api/ledger/ledger_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ledger_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/metrc-gw/metrc_gw_client/facilities/facilities_client.go b/api/metrc-gw/metrc_gw_client/facilities/facilities_client.go new file mode 100644 index 0000000..da118c7 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/facilities/facilities_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package facilities + +// 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 facilities API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for facilities API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetFacilities(params *GetFacilitiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetFacilitiesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetFacilities facilities for this user + + Facilities for this User + +*/ +func (a *Client) GetFacilities(params *GetFacilitiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetFacilitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetFacilitiesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getFacilities", + Method: "GET", + PathPattern: "/facilities", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetFacilitiesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetFacilitiesOK) + 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 getFacilities: 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/metrc-gw/metrc_gw_client/facilities/get_facilities_parameters.go b/api/metrc-gw/metrc_gw_client/facilities/get_facilities_parameters.go new file mode 100644 index 0000000..04045c5 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/facilities/get_facilities_parameters.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package facilities + +// 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" +) + +// NewGetFacilitiesParams creates a new GetFacilitiesParams object +// with the default values initialized. +func NewGetFacilitiesParams() *GetFacilitiesParams { + var () + return &GetFacilitiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetFacilitiesParamsWithTimeout creates a new GetFacilitiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetFacilitiesParamsWithTimeout(timeout time.Duration) *GetFacilitiesParams { + var () + return &GetFacilitiesParams{ + + timeout: timeout, + } +} + +// NewGetFacilitiesParamsWithContext creates a new GetFacilitiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetFacilitiesParamsWithContext(ctx context.Context) *GetFacilitiesParams { + var () + return &GetFacilitiesParams{ + + Context: ctx, + } +} + +// NewGetFacilitiesParamsWithHTTPClient creates a new GetFacilitiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetFacilitiesParamsWithHTTPClient(client *http.Client) *GetFacilitiesParams { + var () + return &GetFacilitiesParams{ + HTTPClient: client, + } +} + +/*GetFacilitiesParams contains all the parameters to send to the API endpoint +for the get facilities operation typically these are written to a http.Request +*/ +type GetFacilitiesParams struct { + + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get facilities params +func (o *GetFacilitiesParams) WithTimeout(timeout time.Duration) *GetFacilitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get facilities params +func (o *GetFacilitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get facilities params +func (o *GetFacilitiesParams) WithContext(ctx context.Context) *GetFacilitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get facilities params +func (o *GetFacilitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get facilities params +func (o *GetFacilitiesParams) WithHTTPClient(client *http.Client) *GetFacilitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get facilities params +func (o *GetFacilitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProduction adds the production to the get facilities params +func (o *GetFacilitiesParams) WithProduction(production *bool) *GetFacilitiesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get facilities params +func (o *GetFacilitiesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get facilities params +func (o *GetFacilitiesParams) WithReseller(reseller string) *GetFacilitiesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get facilities params +func (o *GetFacilitiesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get facilities params +func (o *GetFacilitiesParams) WithState(state string) *GetFacilitiesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get facilities params +func (o *GetFacilitiesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get facilities params +func (o *GetFacilitiesParams) WithUser(user string) *GetFacilitiesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get facilities params +func (o *GetFacilitiesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetFacilitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/facilities/get_facilities_responses.go b/api/metrc-gw/metrc_gw_client/facilities/get_facilities_responses.go new file mode 100644 index 0000000..b3ee5ac --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/facilities/get_facilities_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package facilities + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetFacilitiesReader is a Reader for the GetFacilities structure. +type GetFacilitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetFacilitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetFacilitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetFacilitiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetFacilitiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetFacilitiesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetFacilitiesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetFacilitiesOK creates a GetFacilitiesOK with default headers values +func NewGetFacilitiesOK() *GetFacilitiesOK { + return &GetFacilitiesOK{} +} + +/*GetFacilitiesOK handles this case with default header values. + +A list of Facilities was retrieved successfully +*/ +type GetFacilitiesOK struct { + Payload *metrc_gw_models.FacilityResponse +} + +func (o *GetFacilitiesOK) Error() string { + return fmt.Sprintf("[GET /facilities][%d] getFacilitiesOK %+v", 200, o.Payload) +} + +func (o *GetFacilitiesOK) GetPayload() *metrc_gw_models.FacilityResponse { + return o.Payload +} + +func (o *GetFacilitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.FacilityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFacilitiesUnauthorized creates a GetFacilitiesUnauthorized with default headers values +func NewGetFacilitiesUnauthorized() *GetFacilitiesUnauthorized { + return &GetFacilitiesUnauthorized{} +} + +/*GetFacilitiesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetFacilitiesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetFacilitiesUnauthorized) Error() string { + return fmt.Sprintf("[GET /facilities][%d] getFacilitiesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetFacilitiesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetFacilitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFacilitiesForbidden creates a GetFacilitiesForbidden with default headers values +func NewGetFacilitiesForbidden() *GetFacilitiesForbidden { + return &GetFacilitiesForbidden{} +} + +/*GetFacilitiesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetFacilitiesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetFacilitiesForbidden) Error() string { + return fmt.Sprintf("[GET /facilities][%d] getFacilitiesForbidden %+v", 403, o.Payload) +} + +func (o *GetFacilitiesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetFacilitiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFacilitiesNotFound creates a GetFacilitiesNotFound with default headers values +func NewGetFacilitiesNotFound() *GetFacilitiesNotFound { + return &GetFacilitiesNotFound{} +} + +/*GetFacilitiesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetFacilitiesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetFacilitiesNotFound) Error() string { + return fmt.Sprintf("[GET /facilities][%d] getFacilitiesNotFound %+v", 404, o.Payload) +} + +func (o *GetFacilitiesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetFacilitiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFacilitiesInternalServerError creates a GetFacilitiesInternalServerError with default headers values +func NewGetFacilitiesInternalServerError() *GetFacilitiesInternalServerError { + return &GetFacilitiesInternalServerError{} +} + +/*GetFacilitiesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetFacilitiesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetFacilitiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /facilities][%d] getFacilitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetFacilitiesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetFacilitiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_parameters.go b/api/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_parameters.go new file mode 100644 index 0000000..951d3aa --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_parameters.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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" +) + +// NewGetHarvestWasteTypesParams creates a new GetHarvestWasteTypesParams object +// with the default values initialized. +func NewGetHarvestWasteTypesParams() *GetHarvestWasteTypesParams { + var () + return &GetHarvestWasteTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetHarvestWasteTypesParamsWithTimeout creates a new GetHarvestWasteTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetHarvestWasteTypesParamsWithTimeout(timeout time.Duration) *GetHarvestWasteTypesParams { + var () + return &GetHarvestWasteTypesParams{ + + timeout: timeout, + } +} + +// NewGetHarvestWasteTypesParamsWithContext creates a new GetHarvestWasteTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetHarvestWasteTypesParamsWithContext(ctx context.Context) *GetHarvestWasteTypesParams { + var () + return &GetHarvestWasteTypesParams{ + + Context: ctx, + } +} + +// NewGetHarvestWasteTypesParamsWithHTTPClient creates a new GetHarvestWasteTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetHarvestWasteTypesParamsWithHTTPClient(client *http.Client) *GetHarvestWasteTypesParams { + var () + return &GetHarvestWasteTypesParams{ + HTTPClient: client, + } +} + +/*GetHarvestWasteTypesParams contains all the parameters to send to the API endpoint +for the get harvest waste types operation typically these are written to a http.Request +*/ +type GetHarvestWasteTypesParams struct { + + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) WithTimeout(timeout time.Duration) *GetHarvestWasteTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) WithContext(ctx context.Context) *GetHarvestWasteTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) WithHTTPClient(client *http.Client) *GetHarvestWasteTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReseller adds the reseller to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) WithReseller(reseller string) *GetHarvestWasteTypesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) WithState(state string) *GetHarvestWasteTypesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) WithUser(user string) *GetHarvestWasteTypesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get harvest waste types params +func (o *GetHarvestWasteTypesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetHarvestWasteTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_responses.go b/api/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_responses.go new file mode 100644 index 0000000..0c5e29a --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/get_harvest_waste_types_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetHarvestWasteTypesReader is a Reader for the GetHarvestWasteTypes structure. +type GetHarvestWasteTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetHarvestWasteTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetHarvestWasteTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetHarvestWasteTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetHarvestWasteTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetHarvestWasteTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetHarvestWasteTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetHarvestWasteTypesOK creates a GetHarvestWasteTypesOK with default headers values +func NewGetHarvestWasteTypesOK() *GetHarvestWasteTypesOK { + return &GetHarvestWasteTypesOK{} +} + +/*GetHarvestWasteTypesOK handles this case with default header values. + +A list of Harvest Waste Types was succefully retrieved +*/ +type GetHarvestWasteTypesOK struct { + Payload *metrc_gw_models.HarvestWasteTypeResponse +} + +func (o *GetHarvestWasteTypesOK) Error() string { + return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesOK %+v", 200, o.Payload) +} + +func (o *GetHarvestWasteTypesOK) GetPayload() *metrc_gw_models.HarvestWasteTypeResponse { + return o.Payload +} + +func (o *GetHarvestWasteTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.HarvestWasteTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestWasteTypesUnauthorized creates a GetHarvestWasteTypesUnauthorized with default headers values +func NewGetHarvestWasteTypesUnauthorized() *GetHarvestWasteTypesUnauthorized { + return &GetHarvestWasteTypesUnauthorized{} +} + +/*GetHarvestWasteTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetHarvestWasteTypesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestWasteTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetHarvestWasteTypesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestWasteTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestWasteTypesForbidden creates a GetHarvestWasteTypesForbidden with default headers values +func NewGetHarvestWasteTypesForbidden() *GetHarvestWasteTypesForbidden { + return &GetHarvestWasteTypesForbidden{} +} + +/*GetHarvestWasteTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetHarvestWasteTypesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestWasteTypesForbidden) Error() string { + return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetHarvestWasteTypesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestWasteTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestWasteTypesNotFound creates a GetHarvestWasteTypesNotFound with default headers values +func NewGetHarvestWasteTypesNotFound() *GetHarvestWasteTypesNotFound { + return &GetHarvestWasteTypesNotFound{} +} + +/*GetHarvestWasteTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetHarvestWasteTypesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestWasteTypesNotFound) Error() string { + return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetHarvestWasteTypesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestWasteTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestWasteTypesInternalServerError creates a GetHarvestWasteTypesInternalServerError with default headers values +func NewGetHarvestWasteTypesInternalServerError() *GetHarvestWasteTypesInternalServerError { + return &GetHarvestWasteTypesInternalServerError{} +} + +/*GetHarvestWasteTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetHarvestWasteTypesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestWasteTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetHarvestWasteTypesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestWasteTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/harvests/get_harvests_parameters.go b/api/metrc-gw/metrc_gw_client/harvests/get_harvests_parameters.go new file mode 100644 index 0000000..b7f248b --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/get_harvests_parameters.go @@ -0,0 +1,347 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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" +) + +// NewGetHarvestsParams creates a new GetHarvestsParams object +// with the default values initialized. +func NewGetHarvestsParams() *GetHarvestsParams { + var () + return &GetHarvestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetHarvestsParamsWithTimeout creates a new GetHarvestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetHarvestsParamsWithTimeout(timeout time.Duration) *GetHarvestsParams { + var () + return &GetHarvestsParams{ + + timeout: timeout, + } +} + +// NewGetHarvestsParamsWithContext creates a new GetHarvestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetHarvestsParamsWithContext(ctx context.Context) *GetHarvestsParams { + var () + return &GetHarvestsParams{ + + Context: ctx, + } +} + +// NewGetHarvestsParamsWithHTTPClient creates a new GetHarvestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetHarvestsParamsWithHTTPClient(client *http.Client) *GetHarvestsParams { + var () + return &GetHarvestsParams{ + HTTPClient: client, + } +} + +/*GetHarvestsParams contains all the parameters to send to the API endpoint +for the get harvests operation typically these are written to a http.Request +*/ +type GetHarvestsParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*ItemID + The Item Number + + */ + ItemID *float64 + /*License + The Licnese Number for the query + + */ + License string + /*Onhold + Get On Hold objects? + + */ + Onhold *bool + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get harvests params +func (o *GetHarvestsParams) WithTimeout(timeout time.Duration) *GetHarvestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get harvests params +func (o *GetHarvestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get harvests params +func (o *GetHarvestsParams) WithContext(ctx context.Context) *GetHarvestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get harvests params +func (o *GetHarvestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get harvests params +func (o *GetHarvestsParams) WithHTTPClient(client *http.Client) *GetHarvestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get harvests params +func (o *GetHarvestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get harvests params +func (o *GetHarvestsParams) WithActive(active *bool) *GetHarvestsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get harvests params +func (o *GetHarvestsParams) SetActive(active *bool) { + o.Active = active +} + +// WithItemID adds the itemID to the get harvests params +func (o *GetHarvestsParams) WithItemID(itemID *float64) *GetHarvestsParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get harvests params +func (o *GetHarvestsParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the get harvests params +func (o *GetHarvestsParams) WithLicense(license string) *GetHarvestsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get harvests params +func (o *GetHarvestsParams) SetLicense(license string) { + o.License = license +} + +// WithOnhold adds the onhold to the get harvests params +func (o *GetHarvestsParams) WithOnhold(onhold *bool) *GetHarvestsParams { + o.SetOnhold(onhold) + return o +} + +// SetOnhold adds the onhold to the get harvests params +func (o *GetHarvestsParams) SetOnhold(onhold *bool) { + o.Onhold = onhold +} + +// WithProduction adds the production to the get harvests params +func (o *GetHarvestsParams) WithProduction(production *bool) *GetHarvestsParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get harvests params +func (o *GetHarvestsParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get harvests params +func (o *GetHarvestsParams) WithReseller(reseller string) *GetHarvestsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get harvests params +func (o *GetHarvestsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get harvests params +func (o *GetHarvestsParams) WithState(state string) *GetHarvestsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get harvests params +func (o *GetHarvestsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get harvests params +func (o *GetHarvestsParams) WithUser(user string) *GetHarvestsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get harvests params +func (o *GetHarvestsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetHarvestsParams) 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.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Onhold != nil { + + // query param onhold + var qrOnhold bool + if o.Onhold != nil { + qrOnhold = *o.Onhold + } + qOnhold := swag.FormatBool(qrOnhold) + if qOnhold != "" { + if err := r.SetQueryParam("onhold", qOnhold); err != nil { + return err + } + } + + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/harvests/get_harvests_responses.go b/api/metrc-gw/metrc_gw_client/harvests/get_harvests_responses.go new file mode 100644 index 0000000..9dc22f3 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/get_harvests_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetHarvestsReader is a Reader for the GetHarvests structure. +type GetHarvestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetHarvestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetHarvestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetHarvestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetHarvestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetHarvestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetHarvestsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetHarvestsOK creates a GetHarvestsOK with default headers values +func NewGetHarvestsOK() *GetHarvestsOK { + return &GetHarvestsOK{} +} + +/*GetHarvestsOK handles this case with default header values. + +A Harvest was successfully retrieved +*/ +type GetHarvestsOK struct { + Payload *metrc_gw_models.HarvestResponse +} + +func (o *GetHarvestsOK) Error() string { + return fmt.Sprintf("[GET /harvests][%d] getHarvestsOK %+v", 200, o.Payload) +} + +func (o *GetHarvestsOK) GetPayload() *metrc_gw_models.HarvestResponse { + return o.Payload +} + +func (o *GetHarvestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.HarvestResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestsUnauthorized creates a GetHarvestsUnauthorized with default headers values +func NewGetHarvestsUnauthorized() *GetHarvestsUnauthorized { + return &GetHarvestsUnauthorized{} +} + +/*GetHarvestsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetHarvestsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestsUnauthorized) Error() string { + return fmt.Sprintf("[GET /harvests][%d] getHarvestsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetHarvestsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestsForbidden creates a GetHarvestsForbidden with default headers values +func NewGetHarvestsForbidden() *GetHarvestsForbidden { + return &GetHarvestsForbidden{} +} + +/*GetHarvestsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetHarvestsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestsForbidden) Error() string { + return fmt.Sprintf("[GET /harvests][%d] getHarvestsForbidden %+v", 403, o.Payload) +} + +func (o *GetHarvestsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestsNotFound creates a GetHarvestsNotFound with default headers values +func NewGetHarvestsNotFound() *GetHarvestsNotFound { + return &GetHarvestsNotFound{} +} + +/*GetHarvestsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetHarvestsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestsNotFound) Error() string { + return fmt.Sprintf("[GET /harvests][%d] getHarvestsNotFound %+v", 404, o.Payload) +} + +func (o *GetHarvestsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetHarvestsInternalServerError creates a GetHarvestsInternalServerError with default headers values +func NewGetHarvestsInternalServerError() *GetHarvestsInternalServerError { + return &GetHarvestsInternalServerError{} +} + +/*GetHarvestsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetHarvestsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetHarvestsInternalServerError) Error() string { + return fmt.Sprintf("[GET /harvests][%d] getHarvestsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetHarvestsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetHarvestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/harvests/harvests_client.go b/api/metrc-gw/metrc_gw_client/harvests/harvests_client.go new file mode 100644 index 0000000..fadf5e9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/harvests_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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 harvests API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for harvests API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetHarvestWasteTypes(params *GetHarvestWasteTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetHarvestWasteTypesOK, error) + + GetHarvests(params *GetHarvestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetHarvestsOK, error) + + PostHarvestPackages(params *PostHarvestPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*PostHarvestPackagesOK, error) + + PutHarvests(params *PutHarvestsParams, authInfo runtime.ClientAuthInfoWriter) (*PutHarvestsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetHarvestWasteTypes harvests waste types for user + + Harvest Waste Types for this User + +*/ +func (a *Client) GetHarvestWasteTypes(params *GetHarvestWasteTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetHarvestWasteTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetHarvestWasteTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getHarvestWasteTypes", + Method: "GET", + PathPattern: "/harvests/wastetypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetHarvestWasteTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetHarvestWasteTypesOK) + 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 getHarvestWasteTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetHarvests harvests for this user license + + Get a Harvest for this User-License + +*/ +func (a *Client) GetHarvests(params *GetHarvestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetHarvestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetHarvestsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getHarvests", + Method: "GET", + PathPattern: "/harvests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetHarvestsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetHarvestsOK) + 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 getHarvests: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostHarvestPackages creates new harvest packages + + Create new Plants +*/ +func (a *Client) PostHarvestPackages(params *PostHarvestPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*PostHarvestPackagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostHarvestPackagesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postHarvestPackages", + Method: "POST", + PathPattern: "/harvestpackages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostHarvestPackagesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostHarvestPackagesOK) + 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 postHarvestPackages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutHarvests Update Harvest Records +*/ +func (a *Client) PutHarvests(params *PutHarvestsParams, authInfo runtime.ClientAuthInfoWriter) (*PutHarvestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutHarvestsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putHarvests", + Method: "PUT", + PathPattern: "/harvests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutHarvestsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutHarvestsOK) + 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 putHarvests: 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/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_parameters.go b/api/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_parameters.go new file mode 100644 index 0000000..f45e089 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostHarvestPackagesParams creates a new PostHarvestPackagesParams object +// with the default values initialized. +func NewPostHarvestPackagesParams() *PostHarvestPackagesParams { + var () + return &PostHarvestPackagesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostHarvestPackagesParamsWithTimeout creates a new PostHarvestPackagesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostHarvestPackagesParamsWithTimeout(timeout time.Duration) *PostHarvestPackagesParams { + var () + return &PostHarvestPackagesParams{ + + timeout: timeout, + } +} + +// NewPostHarvestPackagesParamsWithContext creates a new PostHarvestPackagesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostHarvestPackagesParamsWithContext(ctx context.Context) *PostHarvestPackagesParams { + var () + return &PostHarvestPackagesParams{ + + Context: ctx, + } +} + +// NewPostHarvestPackagesParamsWithHTTPClient creates a new PostHarvestPackagesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostHarvestPackagesParamsWithHTTPClient(client *http.Client) *PostHarvestPackagesParams { + var () + return &PostHarvestPackagesParams{ + HTTPClient: client, + } +} + +/*PostHarvestPackagesParams contains all the parameters to send to the API endpoint +for the post harvest packages operation typically these are written to a http.Request +*/ +type PostHarvestPackagesParams struct { + + /*HarvestPackageRequest + The New HarvestPackages + + */ + HarvestPackageRequest *metrc_gw_models.HarvestPackageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post harvest packages params +func (o *PostHarvestPackagesParams) WithTimeout(timeout time.Duration) *PostHarvestPackagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post harvest packages params +func (o *PostHarvestPackagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post harvest packages params +func (o *PostHarvestPackagesParams) WithContext(ctx context.Context) *PostHarvestPackagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post harvest packages params +func (o *PostHarvestPackagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post harvest packages params +func (o *PostHarvestPackagesParams) WithHTTPClient(client *http.Client) *PostHarvestPackagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post harvest packages params +func (o *PostHarvestPackagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHarvestPackageRequest adds the harvestPackageRequest to the post harvest packages params +func (o *PostHarvestPackagesParams) WithHarvestPackageRequest(harvestPackageRequest *metrc_gw_models.HarvestPackageRequest) *PostHarvestPackagesParams { + o.SetHarvestPackageRequest(harvestPackageRequest) + return o +} + +// SetHarvestPackageRequest adds the harvestPackageRequest to the post harvest packages params +func (o *PostHarvestPackagesParams) SetHarvestPackageRequest(harvestPackageRequest *metrc_gw_models.HarvestPackageRequest) { + o.HarvestPackageRequest = harvestPackageRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostHarvestPackagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.HarvestPackageRequest != nil { + if err := r.SetBodyParam(o.HarvestPackageRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_responses.go b/api/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_responses.go new file mode 100644 index 0000000..0540094 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/post_harvest_packages_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostHarvestPackagesReader is a Reader for the PostHarvestPackages structure. +type PostHarvestPackagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostHarvestPackagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostHarvestPackagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostHarvestPackagesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostHarvestPackagesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostHarvestPackagesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostHarvestPackagesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostHarvestPackagesOK creates a PostHarvestPackagesOK with default headers values +func NewPostHarvestPackagesOK() *PostHarvestPackagesOK { + return &PostHarvestPackagesOK{} +} + +/*PostHarvestPackagesOK handles this case with default header values. + +An array of HarvestPackage records with the new IDs +*/ +type PostHarvestPackagesOK struct { + Payload *metrc_gw_models.PlantResponse +} + +func (o *PostHarvestPackagesOK) Error() string { + return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesOK %+v", 200, o.Payload) +} + +func (o *PostHarvestPackagesOK) GetPayload() *metrc_gw_models.PlantResponse { + return o.Payload +} + +func (o *PostHarvestPackagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHarvestPackagesUnauthorized creates a PostHarvestPackagesUnauthorized with default headers values +func NewPostHarvestPackagesUnauthorized() *PostHarvestPackagesUnauthorized { + return &PostHarvestPackagesUnauthorized{} +} + +/*PostHarvestPackagesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostHarvestPackagesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostHarvestPackagesUnauthorized) Error() string { + return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostHarvestPackagesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostHarvestPackagesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHarvestPackagesForbidden creates a PostHarvestPackagesForbidden with default headers values +func NewPostHarvestPackagesForbidden() *PostHarvestPackagesForbidden { + return &PostHarvestPackagesForbidden{} +} + +/*PostHarvestPackagesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostHarvestPackagesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostHarvestPackagesForbidden) Error() string { + return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesForbidden %+v", 403, o.Payload) +} + +func (o *PostHarvestPackagesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostHarvestPackagesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHarvestPackagesNotFound creates a PostHarvestPackagesNotFound with default headers values +func NewPostHarvestPackagesNotFound() *PostHarvestPackagesNotFound { + return &PostHarvestPackagesNotFound{} +} + +/*PostHarvestPackagesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostHarvestPackagesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostHarvestPackagesNotFound) Error() string { + return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesNotFound %+v", 404, o.Payload) +} + +func (o *PostHarvestPackagesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostHarvestPackagesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostHarvestPackagesInternalServerError creates a PostHarvestPackagesInternalServerError with default headers values +func NewPostHarvestPackagesInternalServerError() *PostHarvestPackagesInternalServerError { + return &PostHarvestPackagesInternalServerError{} +} + +/*PostHarvestPackagesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostHarvestPackagesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostHarvestPackagesInternalServerError) Error() string { + return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostHarvestPackagesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostHarvestPackagesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/harvests/put_harvests_parameters.go b/api/metrc-gw/metrc_gw_client/harvests/put_harvests_parameters.go new file mode 100644 index 0000000..8297501 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/put_harvests_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutHarvestsParams creates a new PutHarvestsParams object +// with the default values initialized. +func NewPutHarvestsParams() *PutHarvestsParams { + var () + return &PutHarvestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutHarvestsParamsWithTimeout creates a new PutHarvestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutHarvestsParamsWithTimeout(timeout time.Duration) *PutHarvestsParams { + var () + return &PutHarvestsParams{ + + timeout: timeout, + } +} + +// NewPutHarvestsParamsWithContext creates a new PutHarvestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutHarvestsParamsWithContext(ctx context.Context) *PutHarvestsParams { + var () + return &PutHarvestsParams{ + + Context: ctx, + } +} + +// NewPutHarvestsParamsWithHTTPClient creates a new PutHarvestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutHarvestsParamsWithHTTPClient(client *http.Client) *PutHarvestsParams { + var () + return &PutHarvestsParams{ + HTTPClient: client, + } +} + +/*PutHarvestsParams contains all the parameters to send to the API endpoint +for the put harvests operation typically these are written to a http.Request +*/ +type PutHarvestsParams struct { + + /*HarvestUpdateRequest + The Harvest Update records + + */ + HarvestUpdateRequest *metrc_gw_models.HarvestUpdateRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put harvests params +func (o *PutHarvestsParams) WithTimeout(timeout time.Duration) *PutHarvestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put harvests params +func (o *PutHarvestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put harvests params +func (o *PutHarvestsParams) WithContext(ctx context.Context) *PutHarvestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put harvests params +func (o *PutHarvestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put harvests params +func (o *PutHarvestsParams) WithHTTPClient(client *http.Client) *PutHarvestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put harvests params +func (o *PutHarvestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHarvestUpdateRequest adds the harvestUpdateRequest to the put harvests params +func (o *PutHarvestsParams) WithHarvestUpdateRequest(harvestUpdateRequest *metrc_gw_models.HarvestUpdateRequest) *PutHarvestsParams { + o.SetHarvestUpdateRequest(harvestUpdateRequest) + return o +} + +// SetHarvestUpdateRequest adds the harvestUpdateRequest to the put harvests params +func (o *PutHarvestsParams) SetHarvestUpdateRequest(harvestUpdateRequest *metrc_gw_models.HarvestUpdateRequest) { + o.HarvestUpdateRequest = harvestUpdateRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutHarvestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.HarvestUpdateRequest != nil { + if err := r.SetBodyParam(o.HarvestUpdateRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/harvests/put_harvests_responses.go b/api/metrc-gw/metrc_gw_client/harvests/put_harvests_responses.go new file mode 100644 index 0000000..66d2d9c --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/harvests/put_harvests_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package harvests + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutHarvestsReader is a Reader for the PutHarvests structure. +type PutHarvestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutHarvestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutHarvestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutHarvestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutHarvestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutHarvestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutHarvestsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutHarvestsOK creates a PutHarvestsOK with default headers values +func NewPutHarvestsOK() *PutHarvestsOK { + return &PutHarvestsOK{} +} + +/*PutHarvestsOK handles this case with default header values. + +An array of Harvest Update records +*/ +type PutHarvestsOK struct { + Payload *metrc_gw_models.HarvestUpdateResponse +} + +func (o *PutHarvestsOK) Error() string { + return fmt.Sprintf("[PUT /harvests][%d] putHarvestsOK %+v", 200, o.Payload) +} + +func (o *PutHarvestsOK) GetPayload() *metrc_gw_models.HarvestUpdateResponse { + return o.Payload +} + +func (o *PutHarvestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.HarvestUpdateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHarvestsUnauthorized creates a PutHarvestsUnauthorized with default headers values +func NewPutHarvestsUnauthorized() *PutHarvestsUnauthorized { + return &PutHarvestsUnauthorized{} +} + +/*PutHarvestsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutHarvestsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutHarvestsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /harvests][%d] putHarvestsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutHarvestsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutHarvestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHarvestsForbidden creates a PutHarvestsForbidden with default headers values +func NewPutHarvestsForbidden() *PutHarvestsForbidden { + return &PutHarvestsForbidden{} +} + +/*PutHarvestsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutHarvestsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutHarvestsForbidden) Error() string { + return fmt.Sprintf("[PUT /harvests][%d] putHarvestsForbidden %+v", 403, o.Payload) +} + +func (o *PutHarvestsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutHarvestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHarvestsNotFound creates a PutHarvestsNotFound with default headers values +func NewPutHarvestsNotFound() *PutHarvestsNotFound { + return &PutHarvestsNotFound{} +} + +/*PutHarvestsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutHarvestsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutHarvestsNotFound) Error() string { + return fmt.Sprintf("[PUT /harvests][%d] putHarvestsNotFound %+v", 404, o.Payload) +} + +func (o *PutHarvestsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutHarvestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutHarvestsInternalServerError creates a PutHarvestsInternalServerError with default headers values +func NewPutHarvestsInternalServerError() *PutHarvestsInternalServerError { + return &PutHarvestsInternalServerError{} +} + +/*PutHarvestsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutHarvestsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutHarvestsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /harvests][%d] putHarvestsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutHarvestsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutHarvestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/items/delete_item_parameters.go b/api/metrc-gw/metrc_gw_client/items/delete_item_parameters.go new file mode 100644 index 0000000..65c2dc4 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/delete_item_parameters.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" +) + +// NewDeleteItemParams creates a new DeleteItemParams object +// with the default values initialized. +func NewDeleteItemParams() *DeleteItemParams { + var () + return &DeleteItemParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteItemParamsWithTimeout creates a new DeleteItemParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteItemParamsWithTimeout(timeout time.Duration) *DeleteItemParams { + var () + return &DeleteItemParams{ + + timeout: timeout, + } +} + +// NewDeleteItemParamsWithContext creates a new DeleteItemParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteItemParamsWithContext(ctx context.Context) *DeleteItemParams { + var () + return &DeleteItemParams{ + + Context: ctx, + } +} + +// NewDeleteItemParamsWithHTTPClient creates a new DeleteItemParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteItemParamsWithHTTPClient(client *http.Client) *DeleteItemParams { + var () + return &DeleteItemParams{ + HTTPClient: client, + } +} + +/*DeleteItemParams contains all the parameters to send to the API endpoint +for the delete item operation typically these are written to a http.Request +*/ +type DeleteItemParams struct { + + /*ItemID + The Item Number + + */ + ItemID float64 + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete item params +func (o *DeleteItemParams) WithTimeout(timeout time.Duration) *DeleteItemParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete item params +func (o *DeleteItemParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete item params +func (o *DeleteItemParams) WithContext(ctx context.Context) *DeleteItemParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete item params +func (o *DeleteItemParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete item params +func (o *DeleteItemParams) WithHTTPClient(client *http.Client) *DeleteItemParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete item params +func (o *DeleteItemParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithItemID adds the itemID to the delete item params +func (o *DeleteItemParams) WithItemID(itemID float64) *DeleteItemParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the delete item params +func (o *DeleteItemParams) SetItemID(itemID float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the delete item params +func (o *DeleteItemParams) WithLicense(license string) *DeleteItemParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the delete item params +func (o *DeleteItemParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the delete item params +func (o *DeleteItemParams) WithReseller(reseller string) *DeleteItemParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the delete item params +func (o *DeleteItemParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the delete item params +func (o *DeleteItemParams) WithState(state string) *DeleteItemParams { + o.SetState(state) + return o +} + +// SetState adds the state to the delete item params +func (o *DeleteItemParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the delete item params +func (o *DeleteItemParams) WithUser(user string) *DeleteItemParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the delete item params +func (o *DeleteItemParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param itemId + qrItemID := o.ItemID + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/items/delete_item_responses.go b/api/metrc-gw/metrc_gw_client/items/delete_item_responses.go new file mode 100644 index 0000000..da09aa5 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/delete_item_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// DeleteItemReader is a Reader for the DeleteItem structure. +type DeleteItemReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteItemOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteItemUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteItemForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteItemNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteItemInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteItemOK creates a DeleteItemOK with default headers values +func NewDeleteItemOK() *DeleteItemOK { + return &DeleteItemOK{} +} + +/*DeleteItemOK handles this case with default header values. + +Item were successfully Deleted +*/ +type DeleteItemOK struct { + Payload *metrc_gw_models.ItemResponse +} + +func (o *DeleteItemOK) Error() string { + return fmt.Sprintf("[DELETE /items][%d] deleteItemOK %+v", 200, o.Payload) +} + +func (o *DeleteItemOK) GetPayload() *metrc_gw_models.ItemResponse { + return o.Payload +} + +func (o *DeleteItemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.ItemResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteItemUnauthorized creates a DeleteItemUnauthorized with default headers values +func NewDeleteItemUnauthorized() *DeleteItemUnauthorized { + return &DeleteItemUnauthorized{} +} + +/*DeleteItemUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteItemUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteItemUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /items][%d] deleteItemUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteItemUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteItemForbidden creates a DeleteItemForbidden with default headers values +func NewDeleteItemForbidden() *DeleteItemForbidden { + return &DeleteItemForbidden{} +} + +/*DeleteItemForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteItemForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteItemForbidden) Error() string { + return fmt.Sprintf("[DELETE /items][%d] deleteItemForbidden %+v", 403, o.Payload) +} + +func (o *DeleteItemForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteItemNotFound creates a DeleteItemNotFound with default headers values +func NewDeleteItemNotFound() *DeleteItemNotFound { + return &DeleteItemNotFound{} +} + +/*DeleteItemNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteItemNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteItemNotFound) Error() string { + return fmt.Sprintf("[DELETE /items][%d] deleteItemNotFound %+v", 404, o.Payload) +} + +func (o *DeleteItemNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteItemNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteItemInternalServerError creates a DeleteItemInternalServerError with default headers values +func NewDeleteItemInternalServerError() *DeleteItemInternalServerError { + return &DeleteItemInternalServerError{} +} + +/*DeleteItemInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteItemInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteItemInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /items][%d] deleteItemInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteItemInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/items/get_brands_parameters.go b/api/metrc-gw/metrc_gw_client/items/get_brands_parameters.go new file mode 100644 index 0000000..cba048d --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/get_brands_parameters.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" +) + +// NewGetBrandsParams creates a new GetBrandsParams object +// with the default values initialized. +func NewGetBrandsParams() *GetBrandsParams { + var () + return &GetBrandsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetBrandsParamsWithTimeout creates a new GetBrandsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetBrandsParamsWithTimeout(timeout time.Duration) *GetBrandsParams { + var () + return &GetBrandsParams{ + + timeout: timeout, + } +} + +// NewGetBrandsParamsWithContext creates a new GetBrandsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetBrandsParamsWithContext(ctx context.Context) *GetBrandsParams { + var () + return &GetBrandsParams{ + + Context: ctx, + } +} + +// NewGetBrandsParamsWithHTTPClient creates a new GetBrandsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetBrandsParamsWithHTTPClient(client *http.Client) *GetBrandsParams { + var () + return &GetBrandsParams{ + HTTPClient: client, + } +} + +/*GetBrandsParams contains all the parameters to send to the API endpoint +for the get brands operation typically these are written to a http.Request +*/ +type GetBrandsParams struct { + + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get brands params +func (o *GetBrandsParams) WithTimeout(timeout time.Duration) *GetBrandsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get brands params +func (o *GetBrandsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get brands params +func (o *GetBrandsParams) WithContext(ctx context.Context) *GetBrandsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get brands params +func (o *GetBrandsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get brands params +func (o *GetBrandsParams) WithHTTPClient(client *http.Client) *GetBrandsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get brands params +func (o *GetBrandsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReseller adds the reseller to the get brands params +func (o *GetBrandsParams) WithReseller(reseller string) *GetBrandsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get brands params +func (o *GetBrandsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get brands params +func (o *GetBrandsParams) WithState(state string) *GetBrandsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get brands params +func (o *GetBrandsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get brands params +func (o *GetBrandsParams) WithUser(user string) *GetBrandsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get brands params +func (o *GetBrandsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBrandsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/items/get_brands_responses.go b/api/metrc-gw/metrc_gw_client/items/get_brands_responses.go new file mode 100644 index 0000000..67bf3e7 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/get_brands_responses.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetBrandsReader is a Reader for the GetBrands structure. +type GetBrandsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBrandsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 401: + result := NewGetBrandsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetBrandsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetBrandsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetBrandsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetBrandsUnauthorized creates a GetBrandsUnauthorized with default headers values +func NewGetBrandsUnauthorized() *GetBrandsUnauthorized { + return &GetBrandsUnauthorized{} +} + +/*GetBrandsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetBrandsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetBrandsUnauthorized) Error() string { + return fmt.Sprintf("[GET /items/brands][%d] getBrandsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetBrandsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetBrandsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBrandsForbidden creates a GetBrandsForbidden with default headers values +func NewGetBrandsForbidden() *GetBrandsForbidden { + return &GetBrandsForbidden{} +} + +/*GetBrandsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetBrandsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetBrandsForbidden) Error() string { + return fmt.Sprintf("[GET /items/brands][%d] getBrandsForbidden %+v", 403, o.Payload) +} + +func (o *GetBrandsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetBrandsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBrandsNotFound creates a GetBrandsNotFound with default headers values +func NewGetBrandsNotFound() *GetBrandsNotFound { + return &GetBrandsNotFound{} +} + +/*GetBrandsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetBrandsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetBrandsNotFound) Error() string { + return fmt.Sprintf("[GET /items/brands][%d] getBrandsNotFound %+v", 404, o.Payload) +} + +func (o *GetBrandsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetBrandsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBrandsInternalServerError creates a GetBrandsInternalServerError with default headers values +func NewGetBrandsInternalServerError() *GetBrandsInternalServerError { + return &GetBrandsInternalServerError{} +} + +/*GetBrandsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetBrandsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetBrandsInternalServerError) Error() string { + return fmt.Sprintf("[GET /items/brands][%d] getBrandsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetBrandsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetBrandsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/items/get_item_product_categories_parameters.go b/api/metrc-gw/metrc_gw_client/items/get_item_product_categories_parameters.go new file mode 100644 index 0000000..3beb2dd --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/get_item_product_categories_parameters.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" +) + +// NewGetItemProductCategoriesParams creates a new GetItemProductCategoriesParams object +// with the default values initialized. +func NewGetItemProductCategoriesParams() *GetItemProductCategoriesParams { + var () + return &GetItemProductCategoriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetItemProductCategoriesParamsWithTimeout creates a new GetItemProductCategoriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetItemProductCategoriesParamsWithTimeout(timeout time.Duration) *GetItemProductCategoriesParams { + var () + return &GetItemProductCategoriesParams{ + + timeout: timeout, + } +} + +// NewGetItemProductCategoriesParamsWithContext creates a new GetItemProductCategoriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetItemProductCategoriesParamsWithContext(ctx context.Context) *GetItemProductCategoriesParams { + var () + return &GetItemProductCategoriesParams{ + + Context: ctx, + } +} + +// NewGetItemProductCategoriesParamsWithHTTPClient creates a new GetItemProductCategoriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetItemProductCategoriesParamsWithHTTPClient(client *http.Client) *GetItemProductCategoriesParams { + var () + return &GetItemProductCategoriesParams{ + HTTPClient: client, + } +} + +/*GetItemProductCategoriesParams contains all the parameters to send to the API endpoint +for the get item product categories operation typically these are written to a http.Request +*/ +type GetItemProductCategoriesParams struct { + + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get item product categories params +func (o *GetItemProductCategoriesParams) WithTimeout(timeout time.Duration) *GetItemProductCategoriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get item product categories params +func (o *GetItemProductCategoriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get item product categories params +func (o *GetItemProductCategoriesParams) WithContext(ctx context.Context) *GetItemProductCategoriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get item product categories params +func (o *GetItemProductCategoriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get item product categories params +func (o *GetItemProductCategoriesParams) WithHTTPClient(client *http.Client) *GetItemProductCategoriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get item product categories params +func (o *GetItemProductCategoriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReseller adds the reseller to the get item product categories params +func (o *GetItemProductCategoriesParams) WithReseller(reseller string) *GetItemProductCategoriesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get item product categories params +func (o *GetItemProductCategoriesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get item product categories params +func (o *GetItemProductCategoriesParams) WithState(state string) *GetItemProductCategoriesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get item product categories params +func (o *GetItemProductCategoriesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get item product categories params +func (o *GetItemProductCategoriesParams) WithUser(user string) *GetItemProductCategoriesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get item product categories params +func (o *GetItemProductCategoriesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetItemProductCategoriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/items/get_item_product_categories_responses.go b/api/metrc-gw/metrc_gw_client/items/get_item_product_categories_responses.go new file mode 100644 index 0000000..4c30c85 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/get_item_product_categories_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetItemProductCategoriesReader is a Reader for the GetItemProductCategories structure. +type GetItemProductCategoriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetItemProductCategoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetItemProductCategoriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetItemProductCategoriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetItemProductCategoriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetItemProductCategoriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetItemProductCategoriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetItemProductCategoriesOK creates a GetItemProductCategoriesOK with default headers values +func NewGetItemProductCategoriesOK() *GetItemProductCategoriesOK { + return &GetItemProductCategoriesOK{} +} + +/*GetItemProductCategoriesOK handles this case with default header values. + +A list of Item Product Categories was succefully retrieved +*/ +type GetItemProductCategoriesOK struct { + Payload *metrc_gw_models.ProductCategoryResponse +} + +func (o *GetItemProductCategoriesOK) Error() string { + return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesOK %+v", 200, o.Payload) +} + +func (o *GetItemProductCategoriesOK) GetPayload() *metrc_gw_models.ProductCategoryResponse { + return o.Payload +} + +func (o *GetItemProductCategoriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.ProductCategoryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemProductCategoriesUnauthorized creates a GetItemProductCategoriesUnauthorized with default headers values +func NewGetItemProductCategoriesUnauthorized() *GetItemProductCategoriesUnauthorized { + return &GetItemProductCategoriesUnauthorized{} +} + +/*GetItemProductCategoriesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetItemProductCategoriesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemProductCategoriesUnauthorized) Error() string { + return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetItemProductCategoriesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemProductCategoriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemProductCategoriesForbidden creates a GetItemProductCategoriesForbidden with default headers values +func NewGetItemProductCategoriesForbidden() *GetItemProductCategoriesForbidden { + return &GetItemProductCategoriesForbidden{} +} + +/*GetItemProductCategoriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetItemProductCategoriesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemProductCategoriesForbidden) Error() string { + return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesForbidden %+v", 403, o.Payload) +} + +func (o *GetItemProductCategoriesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemProductCategoriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemProductCategoriesNotFound creates a GetItemProductCategoriesNotFound with default headers values +func NewGetItemProductCategoriesNotFound() *GetItemProductCategoriesNotFound { + return &GetItemProductCategoriesNotFound{} +} + +/*GetItemProductCategoriesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetItemProductCategoriesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemProductCategoriesNotFound) Error() string { + return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesNotFound %+v", 404, o.Payload) +} + +func (o *GetItemProductCategoriesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemProductCategoriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemProductCategoriesInternalServerError creates a GetItemProductCategoriesInternalServerError with default headers values +func NewGetItemProductCategoriesInternalServerError() *GetItemProductCategoriesInternalServerError { + return &GetItemProductCategoriesInternalServerError{} +} + +/*GetItemProductCategoriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetItemProductCategoriesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemProductCategoriesInternalServerError) Error() string { + return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetItemProductCategoriesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemProductCategoriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/items/get_items_parameters.go b/api/metrc-gw/metrc_gw_client/items/get_items_parameters.go new file mode 100644 index 0000000..64c1795 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/get_items_parameters.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" +) + +// NewGetItemsParams creates a new GetItemsParams object +// with the default values initialized. +func NewGetItemsParams() *GetItemsParams { + var () + return &GetItemsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetItemsParamsWithTimeout creates a new GetItemsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetItemsParamsWithTimeout(timeout time.Duration) *GetItemsParams { + var () + return &GetItemsParams{ + + timeout: timeout, + } +} + +// NewGetItemsParamsWithContext creates a new GetItemsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetItemsParamsWithContext(ctx context.Context) *GetItemsParams { + var () + return &GetItemsParams{ + + Context: ctx, + } +} + +// NewGetItemsParamsWithHTTPClient creates a new GetItemsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetItemsParamsWithHTTPClient(client *http.Client) *GetItemsParams { + var () + return &GetItemsParams{ + HTTPClient: client, + } +} + +/*GetItemsParams contains all the parameters to send to the API endpoint +for the get items operation typically these are written to a http.Request +*/ +type GetItemsParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*ItemID + The Item Number + + */ + ItemID *float64 + /*LastModifiedEnd + The last modified end timestamp + + */ + LastModifiedEnd *string + /*LastModifiedStart + The last modified start timestamp + + */ + LastModifiedStart *string + /*License + The Licnese Number for the query + + */ + License string + /*Onhold + Get On Hold objects? + + */ + Onhold *bool + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get items params +func (o *GetItemsParams) WithTimeout(timeout time.Duration) *GetItemsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get items params +func (o *GetItemsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get items params +func (o *GetItemsParams) WithContext(ctx context.Context) *GetItemsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get items params +func (o *GetItemsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get items params +func (o *GetItemsParams) WithHTTPClient(client *http.Client) *GetItemsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get items params +func (o *GetItemsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get items params +func (o *GetItemsParams) WithActive(active *bool) *GetItemsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get items params +func (o *GetItemsParams) SetActive(active *bool) { + o.Active = active +} + +// WithItemID adds the itemID to the get items params +func (o *GetItemsParams) WithItemID(itemID *float64) *GetItemsParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get items params +func (o *GetItemsParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLastModifiedEnd adds the lastModifiedEnd to the get items params +func (o *GetItemsParams) WithLastModifiedEnd(lastModifiedEnd *string) *GetItemsParams { + o.SetLastModifiedEnd(lastModifiedEnd) + return o +} + +// SetLastModifiedEnd adds the lastModifiedEnd to the get items params +func (o *GetItemsParams) SetLastModifiedEnd(lastModifiedEnd *string) { + o.LastModifiedEnd = lastModifiedEnd +} + +// WithLastModifiedStart adds the lastModifiedStart to the get items params +func (o *GetItemsParams) WithLastModifiedStart(lastModifiedStart *string) *GetItemsParams { + o.SetLastModifiedStart(lastModifiedStart) + return o +} + +// SetLastModifiedStart adds the lastModifiedStart to the get items params +func (o *GetItemsParams) SetLastModifiedStart(lastModifiedStart *string) { + o.LastModifiedStart = lastModifiedStart +} + +// WithLicense adds the license to the get items params +func (o *GetItemsParams) WithLicense(license string) *GetItemsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get items params +func (o *GetItemsParams) SetLicense(license string) { + o.License = license +} + +// WithOnhold adds the onhold to the get items params +func (o *GetItemsParams) WithOnhold(onhold *bool) *GetItemsParams { + o.SetOnhold(onhold) + return o +} + +// SetOnhold adds the onhold to the get items params +func (o *GetItemsParams) SetOnhold(onhold *bool) { + o.Onhold = onhold +} + +// WithProduction adds the production to the get items params +func (o *GetItemsParams) WithProduction(production *bool) *GetItemsParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get items params +func (o *GetItemsParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get items params +func (o *GetItemsParams) WithReseller(reseller string) *GetItemsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get items params +func (o *GetItemsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get items params +func (o *GetItemsParams) WithState(state string) *GetItemsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get items params +func (o *GetItemsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get items params +func (o *GetItemsParams) WithUser(user string) *GetItemsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get items params +func (o *GetItemsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetItemsParams) 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.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + if o.LastModifiedEnd != nil { + + // query param lastModifiedEnd + var qrLastModifiedEnd string + if o.LastModifiedEnd != nil { + qrLastModifiedEnd = *o.LastModifiedEnd + } + qLastModifiedEnd := qrLastModifiedEnd + if qLastModifiedEnd != "" { + if err := r.SetQueryParam("lastModifiedEnd", qLastModifiedEnd); err != nil { + return err + } + } + + } + + if o.LastModifiedStart != nil { + + // query param lastModifiedStart + var qrLastModifiedStart string + if o.LastModifiedStart != nil { + qrLastModifiedStart = *o.LastModifiedStart + } + qLastModifiedStart := qrLastModifiedStart + if qLastModifiedStart != "" { + if err := r.SetQueryParam("lastModifiedStart", qLastModifiedStart); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Onhold != nil { + + // query param onhold + var qrOnhold bool + if o.Onhold != nil { + qrOnhold = *o.Onhold + } + qOnhold := swag.FormatBool(qrOnhold) + if qOnhold != "" { + if err := r.SetQueryParam("onhold", qOnhold); err != nil { + return err + } + } + + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/items/get_items_responses.go b/api/metrc-gw/metrc_gw_client/items/get_items_responses.go new file mode 100644 index 0000000..dbc1c67 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/get_items_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetItemsReader is a Reader for the GetItems structure. +type GetItemsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetItemsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetItemsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetItemsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetItemsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetItemsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetItemsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetItemsOK creates a GetItemsOK with default headers values +func NewGetItemsOK() *GetItemsOK { + return &GetItemsOK{} +} + +/*GetItemsOK handles this case with default header values. + +An item was successfully retrieved +*/ +type GetItemsOK struct { + Payload *metrc_gw_models.ItemResponse +} + +func (o *GetItemsOK) Error() string { + return fmt.Sprintf("[GET /items][%d] getItemsOK %+v", 200, o.Payload) +} + +func (o *GetItemsOK) GetPayload() *metrc_gw_models.ItemResponse { + return o.Payload +} + +func (o *GetItemsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.ItemResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemsUnauthorized creates a GetItemsUnauthorized with default headers values +func NewGetItemsUnauthorized() *GetItemsUnauthorized { + return &GetItemsUnauthorized{} +} + +/*GetItemsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetItemsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemsUnauthorized) Error() string { + return fmt.Sprintf("[GET /items][%d] getItemsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetItemsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemsForbidden creates a GetItemsForbidden with default headers values +func NewGetItemsForbidden() *GetItemsForbidden { + return &GetItemsForbidden{} +} + +/*GetItemsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetItemsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemsForbidden) Error() string { + return fmt.Sprintf("[GET /items][%d] getItemsForbidden %+v", 403, o.Payload) +} + +func (o *GetItemsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemsNotFound creates a GetItemsNotFound with default headers values +func NewGetItemsNotFound() *GetItemsNotFound { + return &GetItemsNotFound{} +} + +/*GetItemsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetItemsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemsNotFound) Error() string { + return fmt.Sprintf("[GET /items][%d] getItemsNotFound %+v", 404, o.Payload) +} + +func (o *GetItemsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetItemsInternalServerError creates a GetItemsInternalServerError with default headers values +func NewGetItemsInternalServerError() *GetItemsInternalServerError { + return &GetItemsInternalServerError{} +} + +/*GetItemsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetItemsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetItemsInternalServerError) Error() string { + return fmt.Sprintf("[GET /items][%d] getItemsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetItemsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetItemsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/items/items_client.go b/api/metrc-gw/metrc_gw_client/items/items_client.go new file mode 100644 index 0000000..edae4b0 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/items_client.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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 items API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for items API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteItem(params *DeleteItemParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteItemOK, error) + + GetBrands(params *GetBrandsParams, authInfo runtime.ClientAuthInfoWriter) error + + GetItemProductCategories(params *GetItemProductCategoriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetItemProductCategoriesOK, error) + + GetItems(params *GetItemsParams, authInfo runtime.ClientAuthInfoWriter) (*GetItemsOK, error) + + PostItems(params *PostItemsParams, authInfo runtime.ClientAuthInfoWriter) (*PostItemsOK, error) + + PutItems(params *PutItemsParams, authInfo runtime.ClientAuthInfoWriter) (*PutItemsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteItem items for this user license + + Delete a Item for this User-License + +*/ +func (a *Client) DeleteItem(params *DeleteItemParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteItemOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteItemParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Delete Item", + Method: "DELETE", + PathPattern: "/items", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteItemReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteItemOK) + 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 Delete Item: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetBrands items brands for user + + Get Item Brands for this User + +*/ +func (a *Client) GetBrands(params *GetBrandsParams, authInfo runtime.ClientAuthInfoWriter) error { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBrandsParams() + } + + _, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getBrands", + Method: "GET", + PathPattern: "/items/brands", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetBrandsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return err + } + return nil +} + +/* + GetItemProductCategories items product categories for user + + Item Product Categories for this User + +*/ +func (a *Client) GetItemProductCategories(params *GetItemProductCategoriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetItemProductCategoriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetItemProductCategoriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getItemProductCategories", + Method: "GET", + PathPattern: "/items/productcategories", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetItemProductCategoriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetItemProductCategoriesOK) + 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 getItemProductCategories: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetItems items for this user license + + Get one or more Items for this User-License + +*/ +func (a *Client) GetItems(params *GetItemsParams, authInfo runtime.ClientAuthInfoWriter) (*GetItemsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetItemsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getItems", + Method: "GET", + PathPattern: "/items", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetItemsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetItemsOK) + 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 getItems: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostItems creates new items + + Create new Items +*/ +func (a *Client) PostItems(params *PostItemsParams, authInfo runtime.ClientAuthInfoWriter) (*PostItemsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostItemsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postItems", + Method: "POST", + PathPattern: "/items", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostItemsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostItemsOK) + 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 postItems: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutItems updates existing items + + Update existing Items +*/ +func (a *Client) PutItems(params *PutItemsParams, authInfo runtime.ClientAuthInfoWriter) (*PutItemsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutItemsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putItems", + Method: "PUT", + PathPattern: "/items", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutItemsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutItemsOK) + 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 putItems: 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/metrc-gw/metrc_gw_client/items/post_items_parameters.go b/api/metrc-gw/metrc_gw_client/items/post_items_parameters.go new file mode 100644 index 0000000..58a5af0 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/post_items_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostItemsParams creates a new PostItemsParams object +// with the default values initialized. +func NewPostItemsParams() *PostItemsParams { + var () + return &PostItemsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostItemsParamsWithTimeout creates a new PostItemsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostItemsParamsWithTimeout(timeout time.Duration) *PostItemsParams { + var () + return &PostItemsParams{ + + timeout: timeout, + } +} + +// NewPostItemsParamsWithContext creates a new PostItemsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostItemsParamsWithContext(ctx context.Context) *PostItemsParams { + var () + return &PostItemsParams{ + + Context: ctx, + } +} + +// NewPostItemsParamsWithHTTPClient creates a new PostItemsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostItemsParamsWithHTTPClient(client *http.Client) *PostItemsParams { + var () + return &PostItemsParams{ + HTTPClient: client, + } +} + +/*PostItemsParams contains all the parameters to send to the API endpoint +for the post items operation typically these are written to a http.Request +*/ +type PostItemsParams struct { + + /*ItemRequest + The New Items + + */ + ItemRequest *metrc_gw_models.ItemRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post items params +func (o *PostItemsParams) WithTimeout(timeout time.Duration) *PostItemsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post items params +func (o *PostItemsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post items params +func (o *PostItemsParams) WithContext(ctx context.Context) *PostItemsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post items params +func (o *PostItemsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post items params +func (o *PostItemsParams) WithHTTPClient(client *http.Client) *PostItemsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post items params +func (o *PostItemsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithItemRequest adds the itemRequest to the post items params +func (o *PostItemsParams) WithItemRequest(itemRequest *metrc_gw_models.ItemRequest) *PostItemsParams { + o.SetItemRequest(itemRequest) + return o +} + +// SetItemRequest adds the itemRequest to the post items params +func (o *PostItemsParams) SetItemRequest(itemRequest *metrc_gw_models.ItemRequest) { + o.ItemRequest = itemRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostItemsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ItemRequest != nil { + if err := r.SetBodyParam(o.ItemRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/items/post_items_responses.go b/api/metrc-gw/metrc_gw_client/items/post_items_responses.go new file mode 100644 index 0000000..f969291 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/post_items_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostItemsReader is a Reader for the PostItems structure. +type PostItemsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostItemsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostItemsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostItemsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostItemsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostItemsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostItemsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostItemsOK creates a PostItemsOK with default headers values +func NewPostItemsOK() *PostItemsOK { + return &PostItemsOK{} +} + +/*PostItemsOK handles this case with default header values. + +An array of Items records with the new IDs +*/ +type PostItemsOK struct { + Payload *metrc_gw_models.ItemResponse +} + +func (o *PostItemsOK) Error() string { + return fmt.Sprintf("[POST /items][%d] postItemsOK %+v", 200, o.Payload) +} + +func (o *PostItemsOK) GetPayload() *metrc_gw_models.ItemResponse { + return o.Payload +} + +func (o *PostItemsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.ItemResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostItemsUnauthorized creates a PostItemsUnauthorized with default headers values +func NewPostItemsUnauthorized() *PostItemsUnauthorized { + return &PostItemsUnauthorized{} +} + +/*PostItemsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostItemsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostItemsUnauthorized) Error() string { + return fmt.Sprintf("[POST /items][%d] postItemsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostItemsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostItemsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostItemsForbidden creates a PostItemsForbidden with default headers values +func NewPostItemsForbidden() *PostItemsForbidden { + return &PostItemsForbidden{} +} + +/*PostItemsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostItemsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostItemsForbidden) Error() string { + return fmt.Sprintf("[POST /items][%d] postItemsForbidden %+v", 403, o.Payload) +} + +func (o *PostItemsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostItemsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostItemsNotFound creates a PostItemsNotFound with default headers values +func NewPostItemsNotFound() *PostItemsNotFound { + return &PostItemsNotFound{} +} + +/*PostItemsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostItemsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostItemsNotFound) Error() string { + return fmt.Sprintf("[POST /items][%d] postItemsNotFound %+v", 404, o.Payload) +} + +func (o *PostItemsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostItemsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostItemsInternalServerError creates a PostItemsInternalServerError with default headers values +func NewPostItemsInternalServerError() *PostItemsInternalServerError { + return &PostItemsInternalServerError{} +} + +/*PostItemsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostItemsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostItemsInternalServerError) Error() string { + return fmt.Sprintf("[POST /items][%d] postItemsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostItemsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostItemsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/items/put_items_parameters.go b/api/metrc-gw/metrc_gw_client/items/put_items_parameters.go new file mode 100644 index 0000000..5323cf7 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/put_items_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutItemsParams creates a new PutItemsParams object +// with the default values initialized. +func NewPutItemsParams() *PutItemsParams { + var () + return &PutItemsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutItemsParamsWithTimeout creates a new PutItemsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutItemsParamsWithTimeout(timeout time.Duration) *PutItemsParams { + var () + return &PutItemsParams{ + + timeout: timeout, + } +} + +// NewPutItemsParamsWithContext creates a new PutItemsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutItemsParamsWithContext(ctx context.Context) *PutItemsParams { + var () + return &PutItemsParams{ + + Context: ctx, + } +} + +// NewPutItemsParamsWithHTTPClient creates a new PutItemsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutItemsParamsWithHTTPClient(client *http.Client) *PutItemsParams { + var () + return &PutItemsParams{ + HTTPClient: client, + } +} + +/*PutItemsParams contains all the parameters to send to the API endpoint +for the put items operation typically these are written to a http.Request +*/ +type PutItemsParams struct { + + /*ItemRequest + The Existing Items with Ids + + */ + ItemRequest *metrc_gw_models.ItemRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put items params +func (o *PutItemsParams) WithTimeout(timeout time.Duration) *PutItemsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put items params +func (o *PutItemsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put items params +func (o *PutItemsParams) WithContext(ctx context.Context) *PutItemsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put items params +func (o *PutItemsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put items params +func (o *PutItemsParams) WithHTTPClient(client *http.Client) *PutItemsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put items params +func (o *PutItemsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithItemRequest adds the itemRequest to the put items params +func (o *PutItemsParams) WithItemRequest(itemRequest *metrc_gw_models.ItemRequest) *PutItemsParams { + o.SetItemRequest(itemRequest) + return o +} + +// SetItemRequest adds the itemRequest to the put items params +func (o *PutItemsParams) SetItemRequest(itemRequest *metrc_gw_models.ItemRequest) { + o.ItemRequest = itemRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutItemsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ItemRequest != nil { + if err := r.SetBodyParam(o.ItemRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/items/put_items_responses.go b/api/metrc-gw/metrc_gw_client/items/put_items_responses.go new file mode 100644 index 0000000..4fc302a --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/items/put_items_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package items + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutItemsReader is a Reader for the PutItems structure. +type PutItemsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutItemsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutItemsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutItemsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutItemsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutItemsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutItemsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutItemsOK creates a PutItemsOK with default headers values +func NewPutItemsOK() *PutItemsOK { + return &PutItemsOK{} +} + +/*PutItemsOK handles this case with default header values. + +An array of Items records +*/ +type PutItemsOK struct { + Payload *metrc_gw_models.ItemResponse +} + +func (o *PutItemsOK) Error() string { + return fmt.Sprintf("[PUT /items][%d] putItemsOK %+v", 200, o.Payload) +} + +func (o *PutItemsOK) GetPayload() *metrc_gw_models.ItemResponse { + return o.Payload +} + +func (o *PutItemsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.ItemResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutItemsUnauthorized creates a PutItemsUnauthorized with default headers values +func NewPutItemsUnauthorized() *PutItemsUnauthorized { + return &PutItemsUnauthorized{} +} + +/*PutItemsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutItemsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutItemsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /items][%d] putItemsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutItemsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutItemsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutItemsForbidden creates a PutItemsForbidden with default headers values +func NewPutItemsForbidden() *PutItemsForbidden { + return &PutItemsForbidden{} +} + +/*PutItemsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutItemsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutItemsForbidden) Error() string { + return fmt.Sprintf("[PUT /items][%d] putItemsForbidden %+v", 403, o.Payload) +} + +func (o *PutItemsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutItemsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutItemsNotFound creates a PutItemsNotFound with default headers values +func NewPutItemsNotFound() *PutItemsNotFound { + return &PutItemsNotFound{} +} + +/*PutItemsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutItemsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutItemsNotFound) Error() string { + return fmt.Sprintf("[PUT /items][%d] putItemsNotFound %+v", 404, o.Payload) +} + +func (o *PutItemsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutItemsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutItemsInternalServerError creates a PutItemsInternalServerError with default headers values +func NewPutItemsInternalServerError() *PutItemsInternalServerError { + return &PutItemsInternalServerError{} +} + +/*PutItemsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutItemsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutItemsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /items][%d] putItemsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutItemsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutItemsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_parameters.go b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_parameters.go new file mode 100644 index 0000000..d184c0e --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_parameters.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package lab_tests + +// 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" +) + +// NewGetLabtestStatesParams creates a new GetLabtestStatesParams object +// with the default values initialized. +func NewGetLabtestStatesParams() *GetLabtestStatesParams { + var () + return &GetLabtestStatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLabtestStatesParamsWithTimeout creates a new GetLabtestStatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLabtestStatesParamsWithTimeout(timeout time.Duration) *GetLabtestStatesParams { + var () + return &GetLabtestStatesParams{ + + timeout: timeout, + } +} + +// NewGetLabtestStatesParamsWithContext creates a new GetLabtestStatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLabtestStatesParamsWithContext(ctx context.Context) *GetLabtestStatesParams { + var () + return &GetLabtestStatesParams{ + + Context: ctx, + } +} + +// NewGetLabtestStatesParamsWithHTTPClient creates a new GetLabtestStatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLabtestStatesParamsWithHTTPClient(client *http.Client) *GetLabtestStatesParams { + var () + return &GetLabtestStatesParams{ + HTTPClient: client, + } +} + +/*GetLabtestStatesParams contains all the parameters to send to the API endpoint +for the get labtest states operation typically these are written to a http.Request +*/ +type GetLabtestStatesParams struct { + + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get labtest states params +func (o *GetLabtestStatesParams) WithTimeout(timeout time.Duration) *GetLabtestStatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get labtest states params +func (o *GetLabtestStatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get labtest states params +func (o *GetLabtestStatesParams) WithContext(ctx context.Context) *GetLabtestStatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get labtest states params +func (o *GetLabtestStatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get labtest states params +func (o *GetLabtestStatesParams) WithHTTPClient(client *http.Client) *GetLabtestStatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get labtest states params +func (o *GetLabtestStatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProduction adds the production to the get labtest states params +func (o *GetLabtestStatesParams) WithProduction(production *bool) *GetLabtestStatesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get labtest states params +func (o *GetLabtestStatesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get labtest states params +func (o *GetLabtestStatesParams) WithReseller(reseller string) *GetLabtestStatesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get labtest states params +func (o *GetLabtestStatesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get labtest states params +func (o *GetLabtestStatesParams) WithState(state string) *GetLabtestStatesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get labtest states params +func (o *GetLabtestStatesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get labtest states params +func (o *GetLabtestStatesParams) WithUser(user string) *GetLabtestStatesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get labtest states params +func (o *GetLabtestStatesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLabtestStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_responses.go b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_responses.go new file mode 100644 index 0000000..65b3bc9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_states_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package lab_tests + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetLabtestStatesReader is a Reader for the GetLabtestStates structure. +type GetLabtestStatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLabtestStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLabtestStatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLabtestStatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLabtestStatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLabtestStatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLabtestStatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetLabtestStatesOK creates a GetLabtestStatesOK with default headers values +func NewGetLabtestStatesOK() *GetLabtestStatesOK { + return &GetLabtestStatesOK{} +} + +/*GetLabtestStatesOK handles this case with default header values. + +A list of Item Product Categories was succefully retrieved +*/ +type GetLabtestStatesOK struct { + Payload *metrc_gw_models.LabTestStateResponse +} + +func (o *GetLabtestStatesOK) Error() string { + return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesOK %+v", 200, o.Payload) +} + +func (o *GetLabtestStatesOK) GetPayload() *metrc_gw_models.LabTestStateResponse { + return o.Payload +} + +func (o *GetLabtestStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.LabTestStateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestStatesUnauthorized creates a GetLabtestStatesUnauthorized with default headers values +func NewGetLabtestStatesUnauthorized() *GetLabtestStatesUnauthorized { + return &GetLabtestStatesUnauthorized{} +} + +/*GetLabtestStatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetLabtestStatesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestStatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetLabtestStatesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestStatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestStatesForbidden creates a GetLabtestStatesForbidden with default headers values +func NewGetLabtestStatesForbidden() *GetLabtestStatesForbidden { + return &GetLabtestStatesForbidden{} +} + +/*GetLabtestStatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetLabtestStatesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestStatesForbidden) Error() string { + return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesForbidden %+v", 403, o.Payload) +} + +func (o *GetLabtestStatesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestStatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestStatesNotFound creates a GetLabtestStatesNotFound with default headers values +func NewGetLabtestStatesNotFound() *GetLabtestStatesNotFound { + return &GetLabtestStatesNotFound{} +} + +/*GetLabtestStatesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetLabtestStatesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestStatesNotFound) Error() string { + return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesNotFound %+v", 404, o.Payload) +} + +func (o *GetLabtestStatesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestStatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestStatesInternalServerError creates a GetLabtestStatesInternalServerError with default headers values +func NewGetLabtestStatesInternalServerError() *GetLabtestStatesInternalServerError { + return &GetLabtestStatesInternalServerError{} +} + +/*GetLabtestStatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetLabtestStatesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestStatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetLabtestStatesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestStatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_parameters.go b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_parameters.go new file mode 100644 index 0000000..d94b207 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_parameters.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package lab_tests + +// 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" +) + +// NewGetLabtestTypesParams creates a new GetLabtestTypesParams object +// with the default values initialized. +func NewGetLabtestTypesParams() *GetLabtestTypesParams { + var () + return &GetLabtestTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLabtestTypesParamsWithTimeout creates a new GetLabtestTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLabtestTypesParamsWithTimeout(timeout time.Duration) *GetLabtestTypesParams { + var () + return &GetLabtestTypesParams{ + + timeout: timeout, + } +} + +// NewGetLabtestTypesParamsWithContext creates a new GetLabtestTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLabtestTypesParamsWithContext(ctx context.Context) *GetLabtestTypesParams { + var () + return &GetLabtestTypesParams{ + + Context: ctx, + } +} + +// NewGetLabtestTypesParamsWithHTTPClient creates a new GetLabtestTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLabtestTypesParamsWithHTTPClient(client *http.Client) *GetLabtestTypesParams { + var () + return &GetLabtestTypesParams{ + HTTPClient: client, + } +} + +/*GetLabtestTypesParams contains all the parameters to send to the API endpoint +for the get labtest types operation typically these are written to a http.Request +*/ +type GetLabtestTypesParams struct { + + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get labtest types params +func (o *GetLabtestTypesParams) WithTimeout(timeout time.Duration) *GetLabtestTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get labtest types params +func (o *GetLabtestTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get labtest types params +func (o *GetLabtestTypesParams) WithContext(ctx context.Context) *GetLabtestTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get labtest types params +func (o *GetLabtestTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get labtest types params +func (o *GetLabtestTypesParams) WithHTTPClient(client *http.Client) *GetLabtestTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get labtest types params +func (o *GetLabtestTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProduction adds the production to the get labtest types params +func (o *GetLabtestTypesParams) WithProduction(production *bool) *GetLabtestTypesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get labtest types params +func (o *GetLabtestTypesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get labtest types params +func (o *GetLabtestTypesParams) WithReseller(reseller string) *GetLabtestTypesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get labtest types params +func (o *GetLabtestTypesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get labtest types params +func (o *GetLabtestTypesParams) WithState(state string) *GetLabtestTypesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get labtest types params +func (o *GetLabtestTypesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get labtest types params +func (o *GetLabtestTypesParams) WithUser(user string) *GetLabtestTypesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get labtest types params +func (o *GetLabtestTypesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLabtestTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_responses.go b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_responses.go new file mode 100644 index 0000000..27e3dd7 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/lab_tests/get_labtest_types_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package lab_tests + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetLabtestTypesReader is a Reader for the GetLabtestTypes structure. +type GetLabtestTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLabtestTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLabtestTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLabtestTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLabtestTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLabtestTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLabtestTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetLabtestTypesOK creates a GetLabtestTypesOK with default headers values +func NewGetLabtestTypesOK() *GetLabtestTypesOK { + return &GetLabtestTypesOK{} +} + +/*GetLabtestTypesOK handles this case with default header values. + +A list of Item Product Categories was succefully retrieved +*/ +type GetLabtestTypesOK struct { + Payload *metrc_gw_models.LabTestTypeResponse +} + +func (o *GetLabtestTypesOK) Error() string { + return fmt.Sprintf("[GET /labtests/types][%d] getLabtestTypesOK %+v", 200, o.Payload) +} + +func (o *GetLabtestTypesOK) GetPayload() *metrc_gw_models.LabTestTypeResponse { + return o.Payload +} + +func (o *GetLabtestTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.LabTestTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestTypesUnauthorized creates a GetLabtestTypesUnauthorized with default headers values +func NewGetLabtestTypesUnauthorized() *GetLabtestTypesUnauthorized { + return &GetLabtestTypesUnauthorized{} +} + +/*GetLabtestTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetLabtestTypesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /labtests/types][%d] getLabtestTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetLabtestTypesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestTypesForbidden creates a GetLabtestTypesForbidden with default headers values +func NewGetLabtestTypesForbidden() *GetLabtestTypesForbidden { + return &GetLabtestTypesForbidden{} +} + +/*GetLabtestTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetLabtestTypesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestTypesForbidden) Error() string { + return fmt.Sprintf("[GET /labtests/types][%d] getLabtestTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetLabtestTypesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestTypesNotFound creates a GetLabtestTypesNotFound with default headers values +func NewGetLabtestTypesNotFound() *GetLabtestTypesNotFound { + return &GetLabtestTypesNotFound{} +} + +/*GetLabtestTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetLabtestTypesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestTypesNotFound) Error() string { + return fmt.Sprintf("[GET /labtests/types][%d] getLabtestTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetLabtestTypesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLabtestTypesInternalServerError creates a GetLabtestTypesInternalServerError with default headers values +func NewGetLabtestTypesInternalServerError() *GetLabtestTypesInternalServerError { + return &GetLabtestTypesInternalServerError{} +} + +/*GetLabtestTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetLabtestTypesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetLabtestTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /labtests/types][%d] getLabtestTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetLabtestTypesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetLabtestTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/lab_tests/lab_tests_client.go b/api/metrc-gw/metrc_gw_client/lab_tests/lab_tests_client.go new file mode 100644 index 0000000..321d483 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/lab_tests/lab_tests_client.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package lab_tests + +// 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 lab tests API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for lab tests API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetLabtestStates(params *GetLabtestStatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLabtestStatesOK, error) + + GetLabtestTypes(params *GetLabtestTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLabtestTypesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetLabtestStates items product categories for user + + Get The Lab Test States + +*/ +func (a *Client) GetLabtestStates(params *GetLabtestStatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLabtestStatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLabtestStatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getLabtestStates", + Method: "GET", + PathPattern: "/labtests/states", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLabtestStatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetLabtestStatesOK) + 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 getLabtestStates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetLabtestTypes items product categories for user + + Get The Lab Test States + +*/ +func (a *Client) GetLabtestTypes(params *GetLabtestTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLabtestTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLabtestTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getLabtestTypes", + Method: "GET", + PathPattern: "/labtests/types", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLabtestTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetLabtestTypesOK) + 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 getLabtestTypes: 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/metrc-gw/metrc_gw_client/metrc_gw_client.go b/api/metrc-gw/metrc_gw_client/metrc_gw_client.go new file mode 100644 index 0000000..5e85e55 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/metrc_gw_client.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/facilities" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/harvests" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/items" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/lab_tests" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/packages" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/plant_batches" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/plants" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/rooms" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/sales" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/strains" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/sys" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/transfers" + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_client/units_of_measure" +) + +// Default metrc gw HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "metrc-gw.fabric.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 metrc gw HTTP client. +func NewHTTPClient(formats strfmt.Registry) *MetrcGw { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new metrc gw HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *MetrcGw { + // 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 metrc gw client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *MetrcGw { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(MetrcGw) + cli.Transport = transport + cli.Facilities = facilities.New(transport, formats) + cli.Harvests = harvests.New(transport, formats) + cli.Items = items.New(transport, formats) + cli.LabTests = lab_tests.New(transport, formats) + cli.Packages = packages.New(transport, formats) + cli.PlantBatches = plant_batches.New(transport, formats) + cli.Plants = plants.New(transport, formats) + cli.Rooms = rooms.New(transport, formats) + cli.Sales = sales.New(transport, formats) + cli.Strains = strains.New(transport, formats) + cli.Sys = sys.New(transport, formats) + cli.Transfers = transfers.New(transport, formats) + cli.UnitsOfMeasure = units_of_measure.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 +} + +// MetrcGw is a client for metrc gw +type MetrcGw struct { + Facilities facilities.ClientService + + Harvests harvests.ClientService + + Items items.ClientService + + LabTests lab_tests.ClientService + + Packages packages.ClientService + + PlantBatches plant_batches.ClientService + + Plants plants.ClientService + + Rooms rooms.ClientService + + Sales sales.ClientService + + Strains strains.ClientService + + Sys sys.ClientService + + Transfers transfers.ClientService + + UnitsOfMeasure units_of_measure.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *MetrcGw) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Facilities.SetTransport(transport) + c.Harvests.SetTransport(transport) + c.Items.SetTransport(transport) + c.LabTests.SetTransport(transport) + c.Packages.SetTransport(transport) + c.PlantBatches.SetTransport(transport) + c.Plants.SetTransport(transport) + c.Rooms.SetTransport(transport) + c.Sales.SetTransport(transport) + c.Strains.SetTransport(transport) + c.Sys.SetTransport(transport) + c.Transfers.SetTransport(transport) + c.UnitsOfMeasure.SetTransport(transport) +} diff --git a/api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_parameters.go b/api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_parameters.go new file mode 100644 index 0000000..335c51e --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_parameters.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" +) + +// NewGetPackageAdjustmentReasonsParams creates a new GetPackageAdjustmentReasonsParams object +// with the default values initialized. +func NewGetPackageAdjustmentReasonsParams() *GetPackageAdjustmentReasonsParams { + var () + return &GetPackageAdjustmentReasonsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPackageAdjustmentReasonsParamsWithTimeout creates a new GetPackageAdjustmentReasonsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPackageAdjustmentReasonsParamsWithTimeout(timeout time.Duration) *GetPackageAdjustmentReasonsParams { + var () + return &GetPackageAdjustmentReasonsParams{ + + timeout: timeout, + } +} + +// NewGetPackageAdjustmentReasonsParamsWithContext creates a new GetPackageAdjustmentReasonsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPackageAdjustmentReasonsParamsWithContext(ctx context.Context) *GetPackageAdjustmentReasonsParams { + var () + return &GetPackageAdjustmentReasonsParams{ + + Context: ctx, + } +} + +// NewGetPackageAdjustmentReasonsParamsWithHTTPClient creates a new GetPackageAdjustmentReasonsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPackageAdjustmentReasonsParamsWithHTTPClient(client *http.Client) *GetPackageAdjustmentReasonsParams { + var () + return &GetPackageAdjustmentReasonsParams{ + HTTPClient: client, + } +} + +/*GetPackageAdjustmentReasonsParams contains all the parameters to send to the API endpoint +for the get package adjustment reasons operation typically these are written to a http.Request +*/ +type GetPackageAdjustmentReasonsParams struct { + + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) WithTimeout(timeout time.Duration) *GetPackageAdjustmentReasonsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) WithContext(ctx context.Context) *GetPackageAdjustmentReasonsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) WithHTTPClient(client *http.Client) *GetPackageAdjustmentReasonsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReseller adds the reseller to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) WithReseller(reseller string) *GetPackageAdjustmentReasonsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) WithState(state string) *GetPackageAdjustmentReasonsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) WithUser(user string) *GetPackageAdjustmentReasonsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get package adjustment reasons params +func (o *GetPackageAdjustmentReasonsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPackageAdjustmentReasonsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_responses.go b/api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_responses.go new file mode 100644 index 0000000..bb7e079 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/get_package_adjustment_reasons_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPackageAdjustmentReasonsReader is a Reader for the GetPackageAdjustmentReasons structure. +type GetPackageAdjustmentReasonsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPackageAdjustmentReasonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPackageAdjustmentReasonsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPackageAdjustmentReasonsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPackageAdjustmentReasonsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPackageAdjustmentReasonsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPackageAdjustmentReasonsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPackageAdjustmentReasonsOK creates a GetPackageAdjustmentReasonsOK with default headers values +func NewGetPackageAdjustmentReasonsOK() *GetPackageAdjustmentReasonsOK { + return &GetPackageAdjustmentReasonsOK{} +} + +/*GetPackageAdjustmentReasonsOK handles this case with default header values. + +A list of Package Types was succefully retrieved +*/ +type GetPackageAdjustmentReasonsOK struct { + Payload *metrc_gw_models.PackageAdjustmentReasonResponse +} + +func (o *GetPackageAdjustmentReasonsOK) Error() string { + return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsOK %+v", 200, o.Payload) +} + +func (o *GetPackageAdjustmentReasonsOK) GetPayload() *metrc_gw_models.PackageAdjustmentReasonResponse { + return o.Payload +} + +func (o *GetPackageAdjustmentReasonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PackageAdjustmentReasonResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageAdjustmentReasonsUnauthorized creates a GetPackageAdjustmentReasonsUnauthorized with default headers values +func NewGetPackageAdjustmentReasonsUnauthorized() *GetPackageAdjustmentReasonsUnauthorized { + return &GetPackageAdjustmentReasonsUnauthorized{} +} + +/*GetPackageAdjustmentReasonsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPackageAdjustmentReasonsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageAdjustmentReasonsUnauthorized) Error() string { + return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPackageAdjustmentReasonsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageAdjustmentReasonsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageAdjustmentReasonsForbidden creates a GetPackageAdjustmentReasonsForbidden with default headers values +func NewGetPackageAdjustmentReasonsForbidden() *GetPackageAdjustmentReasonsForbidden { + return &GetPackageAdjustmentReasonsForbidden{} +} + +/*GetPackageAdjustmentReasonsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPackageAdjustmentReasonsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageAdjustmentReasonsForbidden) Error() string { + return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsForbidden %+v", 403, o.Payload) +} + +func (o *GetPackageAdjustmentReasonsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageAdjustmentReasonsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageAdjustmentReasonsNotFound creates a GetPackageAdjustmentReasonsNotFound with default headers values +func NewGetPackageAdjustmentReasonsNotFound() *GetPackageAdjustmentReasonsNotFound { + return &GetPackageAdjustmentReasonsNotFound{} +} + +/*GetPackageAdjustmentReasonsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPackageAdjustmentReasonsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageAdjustmentReasonsNotFound) Error() string { + return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsNotFound %+v", 404, o.Payload) +} + +func (o *GetPackageAdjustmentReasonsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageAdjustmentReasonsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageAdjustmentReasonsInternalServerError creates a GetPackageAdjustmentReasonsInternalServerError with default headers values +func NewGetPackageAdjustmentReasonsInternalServerError() *GetPackageAdjustmentReasonsInternalServerError { + return &GetPackageAdjustmentReasonsInternalServerError{} +} + +/*GetPackageAdjustmentReasonsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPackageAdjustmentReasonsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageAdjustmentReasonsInternalServerError) Error() string { + return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPackageAdjustmentReasonsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageAdjustmentReasonsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/packages/get_package_types_parameters.go b/api/metrc-gw/metrc_gw_client/packages/get_package_types_parameters.go new file mode 100644 index 0000000..271346f --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/get_package_types_parameters.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" +) + +// NewGetPackageTypesParams creates a new GetPackageTypesParams object +// with the default values initialized. +func NewGetPackageTypesParams() *GetPackageTypesParams { + var () + return &GetPackageTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPackageTypesParamsWithTimeout creates a new GetPackageTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPackageTypesParamsWithTimeout(timeout time.Duration) *GetPackageTypesParams { + var () + return &GetPackageTypesParams{ + + timeout: timeout, + } +} + +// NewGetPackageTypesParamsWithContext creates a new GetPackageTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPackageTypesParamsWithContext(ctx context.Context) *GetPackageTypesParams { + var () + return &GetPackageTypesParams{ + + Context: ctx, + } +} + +// NewGetPackageTypesParamsWithHTTPClient creates a new GetPackageTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPackageTypesParamsWithHTTPClient(client *http.Client) *GetPackageTypesParams { + var () + return &GetPackageTypesParams{ + HTTPClient: client, + } +} + +/*GetPackageTypesParams contains all the parameters to send to the API endpoint +for the get package types operation typically these are written to a http.Request +*/ +type GetPackageTypesParams struct { + + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get package types params +func (o *GetPackageTypesParams) WithTimeout(timeout time.Duration) *GetPackageTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get package types params +func (o *GetPackageTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get package types params +func (o *GetPackageTypesParams) WithContext(ctx context.Context) *GetPackageTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get package types params +func (o *GetPackageTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get package types params +func (o *GetPackageTypesParams) WithHTTPClient(client *http.Client) *GetPackageTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get package types params +func (o *GetPackageTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReseller adds the reseller to the get package types params +func (o *GetPackageTypesParams) WithReseller(reseller string) *GetPackageTypesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get package types params +func (o *GetPackageTypesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get package types params +func (o *GetPackageTypesParams) WithState(state string) *GetPackageTypesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get package types params +func (o *GetPackageTypesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get package types params +func (o *GetPackageTypesParams) WithUser(user string) *GetPackageTypesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get package types params +func (o *GetPackageTypesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPackageTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/packages/get_package_types_responses.go b/api/metrc-gw/metrc_gw_client/packages/get_package_types_responses.go new file mode 100644 index 0000000..f0650c6 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/get_package_types_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPackageTypesReader is a Reader for the GetPackageTypes structure. +type GetPackageTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPackageTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPackageTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPackageTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPackageTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPackageTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPackageTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPackageTypesOK creates a GetPackageTypesOK with default headers values +func NewGetPackageTypesOK() *GetPackageTypesOK { + return &GetPackageTypesOK{} +} + +/*GetPackageTypesOK handles this case with default header values. + +A list of Package Types was succefully retrieved +*/ +type GetPackageTypesOK struct { + Payload *metrc_gw_models.PackageTypeResponse +} + +func (o *GetPackageTypesOK) Error() string { + return fmt.Sprintf("[GET /packages/types][%d] getPackageTypesOK %+v", 200, o.Payload) +} + +func (o *GetPackageTypesOK) GetPayload() *metrc_gw_models.PackageTypeResponse { + return o.Payload +} + +func (o *GetPackageTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PackageTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageTypesUnauthorized creates a GetPackageTypesUnauthorized with default headers values +func NewGetPackageTypesUnauthorized() *GetPackageTypesUnauthorized { + return &GetPackageTypesUnauthorized{} +} + +/*GetPackageTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPackageTypesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /packages/types][%d] getPackageTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPackageTypesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageTypesForbidden creates a GetPackageTypesForbidden with default headers values +func NewGetPackageTypesForbidden() *GetPackageTypesForbidden { + return &GetPackageTypesForbidden{} +} + +/*GetPackageTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPackageTypesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageTypesForbidden) Error() string { + return fmt.Sprintf("[GET /packages/types][%d] getPackageTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetPackageTypesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageTypesNotFound creates a GetPackageTypesNotFound with default headers values +func NewGetPackageTypesNotFound() *GetPackageTypesNotFound { + return &GetPackageTypesNotFound{} +} + +/*GetPackageTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPackageTypesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageTypesNotFound) Error() string { + return fmt.Sprintf("[GET /packages/types][%d] getPackageTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetPackageTypesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackageTypesInternalServerError creates a GetPackageTypesInternalServerError with default headers values +func NewGetPackageTypesInternalServerError() *GetPackageTypesInternalServerError { + return &GetPackageTypesInternalServerError{} +} + +/*GetPackageTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPackageTypesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackageTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /packages/types][%d] getPackageTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPackageTypesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackageTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/packages/get_packages_parameters.go b/api/metrc-gw/metrc_gw_client/packages/get_packages_parameters.go new file mode 100644 index 0000000..a6f3baf --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/get_packages_parameters.go @@ -0,0 +1,379 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" +) + +// NewGetPackagesParams creates a new GetPackagesParams object +// with the default values initialized. +func NewGetPackagesParams() *GetPackagesParams { + var () + return &GetPackagesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPackagesParamsWithTimeout creates a new GetPackagesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPackagesParamsWithTimeout(timeout time.Duration) *GetPackagesParams { + var () + return &GetPackagesParams{ + + timeout: timeout, + } +} + +// NewGetPackagesParamsWithContext creates a new GetPackagesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPackagesParamsWithContext(ctx context.Context) *GetPackagesParams { + var () + return &GetPackagesParams{ + + Context: ctx, + } +} + +// NewGetPackagesParamsWithHTTPClient creates a new GetPackagesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPackagesParamsWithHTTPClient(client *http.Client) *GetPackagesParams { + var () + return &GetPackagesParams{ + HTTPClient: client, + } +} + +/*GetPackagesParams contains all the parameters to send to the API endpoint +for the get packages operation typically these are written to a http.Request +*/ +type GetPackagesParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*ItemID + The Item Number + + */ + ItemID *float64 + /*Label + The METRC Package Label + + */ + Label *string + /*License + The Licnese Number for the query + + */ + License string + /*Onhold + Get On Hold objects? + + */ + Onhold *bool + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get packages params +func (o *GetPackagesParams) WithTimeout(timeout time.Duration) *GetPackagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get packages params +func (o *GetPackagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get packages params +func (o *GetPackagesParams) WithContext(ctx context.Context) *GetPackagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get packages params +func (o *GetPackagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get packages params +func (o *GetPackagesParams) WithHTTPClient(client *http.Client) *GetPackagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get packages params +func (o *GetPackagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get packages params +func (o *GetPackagesParams) WithActive(active *bool) *GetPackagesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get packages params +func (o *GetPackagesParams) SetActive(active *bool) { + o.Active = active +} + +// WithItemID adds the itemID to the get packages params +func (o *GetPackagesParams) WithItemID(itemID *float64) *GetPackagesParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get packages params +func (o *GetPackagesParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLabel adds the label to the get packages params +func (o *GetPackagesParams) WithLabel(label *string) *GetPackagesParams { + o.SetLabel(label) + return o +} + +// SetLabel adds the label to the get packages params +func (o *GetPackagesParams) SetLabel(label *string) { + o.Label = label +} + +// WithLicense adds the license to the get packages params +func (o *GetPackagesParams) WithLicense(license string) *GetPackagesParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get packages params +func (o *GetPackagesParams) SetLicense(license string) { + o.License = license +} + +// WithOnhold adds the onhold to the get packages params +func (o *GetPackagesParams) WithOnhold(onhold *bool) *GetPackagesParams { + o.SetOnhold(onhold) + return o +} + +// SetOnhold adds the onhold to the get packages params +func (o *GetPackagesParams) SetOnhold(onhold *bool) { + o.Onhold = onhold +} + +// WithProduction adds the production to the get packages params +func (o *GetPackagesParams) WithProduction(production *bool) *GetPackagesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get packages params +func (o *GetPackagesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get packages params +func (o *GetPackagesParams) WithReseller(reseller string) *GetPackagesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get packages params +func (o *GetPackagesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get packages params +func (o *GetPackagesParams) WithState(state string) *GetPackagesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get packages params +func (o *GetPackagesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get packages params +func (o *GetPackagesParams) WithUser(user string) *GetPackagesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get packages params +func (o *GetPackagesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPackagesParams) 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.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + if o.Label != nil { + + // query param label + var qrLabel string + if o.Label != nil { + qrLabel = *o.Label + } + qLabel := qrLabel + if qLabel != "" { + if err := r.SetQueryParam("label", qLabel); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Onhold != nil { + + // query param onhold + var qrOnhold bool + if o.Onhold != nil { + qrOnhold = *o.Onhold + } + qOnhold := swag.FormatBool(qrOnhold) + if qOnhold != "" { + if err := r.SetQueryParam("onhold", qOnhold); err != nil { + return err + } + } + + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/packages/get_packages_responses.go b/api/metrc-gw/metrc_gw_client/packages/get_packages_responses.go new file mode 100644 index 0000000..9cb6c60 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/get_packages_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPackagesReader is a Reader for the GetPackages structure. +type GetPackagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPackagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPackagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPackagesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPackagesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPackagesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPackagesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPackagesOK creates a GetPackagesOK with default headers values +func NewGetPackagesOK() *GetPackagesOK { + return &GetPackagesOK{} +} + +/*GetPackagesOK handles this case with default header values. + +A list of Packages was retrieved +*/ +type GetPackagesOK struct { + Payload *metrc_gw_models.PackageResponse +} + +func (o *GetPackagesOK) Error() string { + return fmt.Sprintf("[GET /packages][%d] getPackagesOK %+v", 200, o.Payload) +} + +func (o *GetPackagesOK) GetPayload() *metrc_gw_models.PackageResponse { + return o.Payload +} + +func (o *GetPackagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PackageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackagesUnauthorized creates a GetPackagesUnauthorized with default headers values +func NewGetPackagesUnauthorized() *GetPackagesUnauthorized { + return &GetPackagesUnauthorized{} +} + +/*GetPackagesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPackagesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackagesUnauthorized) Error() string { + return fmt.Sprintf("[GET /packages][%d] getPackagesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPackagesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackagesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackagesForbidden creates a GetPackagesForbidden with default headers values +func NewGetPackagesForbidden() *GetPackagesForbidden { + return &GetPackagesForbidden{} +} + +/*GetPackagesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPackagesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackagesForbidden) Error() string { + return fmt.Sprintf("[GET /packages][%d] getPackagesForbidden %+v", 403, o.Payload) +} + +func (o *GetPackagesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackagesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackagesNotFound creates a GetPackagesNotFound with default headers values +func NewGetPackagesNotFound() *GetPackagesNotFound { + return &GetPackagesNotFound{} +} + +/*GetPackagesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPackagesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackagesNotFound) Error() string { + return fmt.Sprintf("[GET /packages][%d] getPackagesNotFound %+v", 404, o.Payload) +} + +func (o *GetPackagesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackagesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPackagesInternalServerError creates a GetPackagesInternalServerError with default headers values +func NewGetPackagesInternalServerError() *GetPackagesInternalServerError { + return &GetPackagesInternalServerError{} +} + +/*GetPackagesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPackagesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPackagesInternalServerError) Error() string { + return fmt.Sprintf("[GET /packages][%d] getPackagesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPackagesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPackagesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/packages/packages_client.go b/api/metrc-gw/metrc_gw_client/packages/packages_client.go new file mode 100644 index 0000000..298dbeb --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/packages_client.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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 packages API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for packages API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPackageAdjustmentReasons(params *GetPackageAdjustmentReasonsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPackageAdjustmentReasonsOK, error) + + GetPackageTypes(params *GetPackageTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPackageTypesOK, error) + + GetPackages(params *GetPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPackagesOK, error) + + PostPackages(params *PostPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*PostPackagesOK, error) + + PutPackages(params *PutPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*PutPackagesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPackageAdjustmentReasons packages types + + Get Package Types + +*/ +func (a *Client) GetPackageAdjustmentReasons(params *GetPackageAdjustmentReasonsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPackageAdjustmentReasonsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPackageAdjustmentReasonsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPackageAdjustmentReasons", + Method: "GET", + PathPattern: "/packages/adjustmentreasons", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPackageAdjustmentReasonsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPackageAdjustmentReasonsOK) + 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 getPackageAdjustmentReasons: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPackageTypes packages types + + Get Package Types + +*/ +func (a *Client) GetPackageTypes(params *GetPackageTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPackageTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPackageTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPackageTypes", + Method: "GET", + PathPattern: "/packages/types", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPackageTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPackageTypesOK) + 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 getPackageTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPackages gets packages + + Get a single Item for this User-License + +*/ +func (a *Client) GetPackages(params *GetPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPackagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPackagesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPackages", + Method: "GET", + PathPattern: "/packages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPackagesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPackagesOK) + 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 getPackages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPackages creates new packages + + Create new Packages +*/ +func (a *Client) PostPackages(params *PostPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*PostPackagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPackagesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPackages", + Method: "POST", + PathPattern: "/packages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPackagesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPackagesOK) + 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 postPackages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPackages updates existing packages + + Update existing Packages +*/ +func (a *Client) PutPackages(params *PutPackagesParams, authInfo runtime.ClientAuthInfoWriter) (*PutPackagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPackagesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putPackages", + Method: "PUT", + PathPattern: "/packages", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPackagesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutPackagesOK) + 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 putPackages: 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/metrc-gw/metrc_gw_client/packages/post_packages_parameters.go b/api/metrc-gw/metrc_gw_client/packages/post_packages_parameters.go new file mode 100644 index 0000000..51391ad --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/post_packages_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostPackagesParams creates a new PostPackagesParams object +// with the default values initialized. +func NewPostPackagesParams() *PostPackagesParams { + var () + return &PostPackagesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPackagesParamsWithTimeout creates a new PostPackagesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPackagesParamsWithTimeout(timeout time.Duration) *PostPackagesParams { + var () + return &PostPackagesParams{ + + timeout: timeout, + } +} + +// NewPostPackagesParamsWithContext creates a new PostPackagesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPackagesParamsWithContext(ctx context.Context) *PostPackagesParams { + var () + return &PostPackagesParams{ + + Context: ctx, + } +} + +// NewPostPackagesParamsWithHTTPClient creates a new PostPackagesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPackagesParamsWithHTTPClient(client *http.Client) *PostPackagesParams { + var () + return &PostPackagesParams{ + HTTPClient: client, + } +} + +/*PostPackagesParams contains all the parameters to send to the API endpoint +for the post packages operation typically these are written to a http.Request +*/ +type PostPackagesParams struct { + + /*PackageRequest + The New Packages + + */ + PackageRequest *metrc_gw_models.PackageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post packages params +func (o *PostPackagesParams) WithTimeout(timeout time.Duration) *PostPackagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post packages params +func (o *PostPackagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post packages params +func (o *PostPackagesParams) WithContext(ctx context.Context) *PostPackagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post packages params +func (o *PostPackagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post packages params +func (o *PostPackagesParams) WithHTTPClient(client *http.Client) *PostPackagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post packages params +func (o *PostPackagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPackageRequest adds the packageRequest to the post packages params +func (o *PostPackagesParams) WithPackageRequest(packageRequest *metrc_gw_models.PackageRequest) *PostPackagesParams { + o.SetPackageRequest(packageRequest) + return o +} + +// SetPackageRequest adds the packageRequest to the post packages params +func (o *PostPackagesParams) SetPackageRequest(packageRequest *metrc_gw_models.PackageRequest) { + o.PackageRequest = packageRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPackagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PackageRequest != nil { + if err := r.SetBodyParam(o.PackageRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/packages/post_packages_responses.go b/api/metrc-gw/metrc_gw_client/packages/post_packages_responses.go new file mode 100644 index 0000000..f10922c --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/post_packages_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostPackagesReader is a Reader for the PostPackages structure. +type PostPackagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPackagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPackagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPackagesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPackagesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPackagesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPackagesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPackagesOK creates a PostPackagesOK with default headers values +func NewPostPackagesOK() *PostPackagesOK { + return &PostPackagesOK{} +} + +/*PostPackagesOK handles this case with default header values. + +An array of Items records with the new IDs +*/ +type PostPackagesOK struct { + Payload *metrc_gw_models.PackageResponse +} + +func (o *PostPackagesOK) Error() string { + return fmt.Sprintf("[POST /packages][%d] postPackagesOK %+v", 200, o.Payload) +} + +func (o *PostPackagesOK) GetPayload() *metrc_gw_models.PackageResponse { + return o.Payload +} + +func (o *PostPackagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PackageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPackagesUnauthorized creates a PostPackagesUnauthorized with default headers values +func NewPostPackagesUnauthorized() *PostPackagesUnauthorized { + return &PostPackagesUnauthorized{} +} + +/*PostPackagesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostPackagesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPackagesUnauthorized) Error() string { + return fmt.Sprintf("[POST /packages][%d] postPackagesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPackagesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPackagesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPackagesForbidden creates a PostPackagesForbidden with default headers values +func NewPostPackagesForbidden() *PostPackagesForbidden { + return &PostPackagesForbidden{} +} + +/*PostPackagesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPackagesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPackagesForbidden) Error() string { + return fmt.Sprintf("[POST /packages][%d] postPackagesForbidden %+v", 403, o.Payload) +} + +func (o *PostPackagesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPackagesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPackagesNotFound creates a PostPackagesNotFound with default headers values +func NewPostPackagesNotFound() *PostPackagesNotFound { + return &PostPackagesNotFound{} +} + +/*PostPackagesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPackagesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPackagesNotFound) Error() string { + return fmt.Sprintf("[POST /packages][%d] postPackagesNotFound %+v", 404, o.Payload) +} + +func (o *PostPackagesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPackagesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPackagesInternalServerError creates a PostPackagesInternalServerError with default headers values +func NewPostPackagesInternalServerError() *PostPackagesInternalServerError { + return &PostPackagesInternalServerError{} +} + +/*PostPackagesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPackagesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPackagesInternalServerError) Error() string { + return fmt.Sprintf("[POST /packages][%d] postPackagesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPackagesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPackagesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/packages/put_packages_parameters.go b/api/metrc-gw/metrc_gw_client/packages/put_packages_parameters.go new file mode 100644 index 0000000..ce7407d --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/put_packages_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutPackagesParams creates a new PutPackagesParams object +// with the default values initialized. +func NewPutPackagesParams() *PutPackagesParams { + var () + return &PutPackagesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutPackagesParamsWithTimeout creates a new PutPackagesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutPackagesParamsWithTimeout(timeout time.Duration) *PutPackagesParams { + var () + return &PutPackagesParams{ + + timeout: timeout, + } +} + +// NewPutPackagesParamsWithContext creates a new PutPackagesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutPackagesParamsWithContext(ctx context.Context) *PutPackagesParams { + var () + return &PutPackagesParams{ + + Context: ctx, + } +} + +// NewPutPackagesParamsWithHTTPClient creates a new PutPackagesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutPackagesParamsWithHTTPClient(client *http.Client) *PutPackagesParams { + var () + return &PutPackagesParams{ + HTTPClient: client, + } +} + +/*PutPackagesParams contains all the parameters to send to the API endpoint +for the put packages operation typically these are written to a http.Request +*/ +type PutPackagesParams struct { + + /*PackageRequest + The Existing Items with Ids + + */ + PackageRequest *metrc_gw_models.PackageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put packages params +func (o *PutPackagesParams) WithTimeout(timeout time.Duration) *PutPackagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put packages params +func (o *PutPackagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put packages params +func (o *PutPackagesParams) WithContext(ctx context.Context) *PutPackagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put packages params +func (o *PutPackagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put packages params +func (o *PutPackagesParams) WithHTTPClient(client *http.Client) *PutPackagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put packages params +func (o *PutPackagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPackageRequest adds the packageRequest to the put packages params +func (o *PutPackagesParams) WithPackageRequest(packageRequest *metrc_gw_models.PackageRequest) *PutPackagesParams { + o.SetPackageRequest(packageRequest) + return o +} + +// SetPackageRequest adds the packageRequest to the put packages params +func (o *PutPackagesParams) SetPackageRequest(packageRequest *metrc_gw_models.PackageRequest) { + o.PackageRequest = packageRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPackagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PackageRequest != nil { + if err := r.SetBodyParam(o.PackageRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/packages/put_packages_responses.go b/api/metrc-gw/metrc_gw_client/packages/put_packages_responses.go new file mode 100644 index 0000000..86e61db --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/packages/put_packages_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package packages + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutPackagesReader is a Reader for the PutPackages structure. +type PutPackagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPackagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPackagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPackagesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPackagesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPackagesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPackagesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutPackagesOK creates a PutPackagesOK with default headers values +func NewPutPackagesOK() *PutPackagesOK { + return &PutPackagesOK{} +} + +/*PutPackagesOK handles this case with default header values. + +An array of Package records +*/ +type PutPackagesOK struct { + Payload *metrc_gw_models.PackageResponse +} + +func (o *PutPackagesOK) Error() string { + return fmt.Sprintf("[PUT /packages][%d] putPackagesOK %+v", 200, o.Payload) +} + +func (o *PutPackagesOK) GetPayload() *metrc_gw_models.PackageResponse { + return o.Payload +} + +func (o *PutPackagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PackageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPackagesUnauthorized creates a PutPackagesUnauthorized with default headers values +func NewPutPackagesUnauthorized() *PutPackagesUnauthorized { + return &PutPackagesUnauthorized{} +} + +/*PutPackagesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutPackagesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPackagesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /packages][%d] putPackagesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutPackagesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPackagesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPackagesForbidden creates a PutPackagesForbidden with default headers values +func NewPutPackagesForbidden() *PutPackagesForbidden { + return &PutPackagesForbidden{} +} + +/*PutPackagesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutPackagesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPackagesForbidden) Error() string { + return fmt.Sprintf("[PUT /packages][%d] putPackagesForbidden %+v", 403, o.Payload) +} + +func (o *PutPackagesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPackagesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPackagesNotFound creates a PutPackagesNotFound with default headers values +func NewPutPackagesNotFound() *PutPackagesNotFound { + return &PutPackagesNotFound{} +} + +/*PutPackagesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutPackagesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPackagesNotFound) Error() string { + return fmt.Sprintf("[PUT /packages][%d] putPackagesNotFound %+v", 404, o.Payload) +} + +func (o *PutPackagesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPackagesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPackagesInternalServerError creates a PutPackagesInternalServerError with default headers values +func NewPutPackagesInternalServerError() *PutPackagesInternalServerError { + return &PutPackagesInternalServerError{} +} + +/*PutPackagesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutPackagesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPackagesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /packages][%d] putPackagesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutPackagesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPackagesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_parameters.go b/api/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_parameters.go new file mode 100644 index 0000000..9f2b811 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_parameters.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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" +) + +// NewDeletePlantBatchParams creates a new DeletePlantBatchParams object +// with the default values initialized. +func NewDeletePlantBatchParams() *DeletePlantBatchParams { + var () + return &DeletePlantBatchParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeletePlantBatchParamsWithTimeout creates a new DeletePlantBatchParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeletePlantBatchParamsWithTimeout(timeout time.Duration) *DeletePlantBatchParams { + var () + return &DeletePlantBatchParams{ + + timeout: timeout, + } +} + +// NewDeletePlantBatchParamsWithContext creates a new DeletePlantBatchParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeletePlantBatchParamsWithContext(ctx context.Context) *DeletePlantBatchParams { + var () + return &DeletePlantBatchParams{ + + Context: ctx, + } +} + +// NewDeletePlantBatchParamsWithHTTPClient creates a new DeletePlantBatchParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeletePlantBatchParamsWithHTTPClient(client *http.Client) *DeletePlantBatchParams { + var () + return &DeletePlantBatchParams{ + HTTPClient: client, + } +} + +/*DeletePlantBatchParams contains all the parameters to send to the API endpoint +for the delete plant batch operation typically these are written to a http.Request +*/ +type DeletePlantBatchParams struct { + + /*ItemID + The Item Number + + */ + ItemID float64 + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete plant batch params +func (o *DeletePlantBatchParams) WithTimeout(timeout time.Duration) *DeletePlantBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete plant batch params +func (o *DeletePlantBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete plant batch params +func (o *DeletePlantBatchParams) WithContext(ctx context.Context) *DeletePlantBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete plant batch params +func (o *DeletePlantBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete plant batch params +func (o *DeletePlantBatchParams) WithHTTPClient(client *http.Client) *DeletePlantBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete plant batch params +func (o *DeletePlantBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithItemID adds the itemID to the delete plant batch params +func (o *DeletePlantBatchParams) WithItemID(itemID float64) *DeletePlantBatchParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the delete plant batch params +func (o *DeletePlantBatchParams) SetItemID(itemID float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the delete plant batch params +func (o *DeletePlantBatchParams) WithLicense(license string) *DeletePlantBatchParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the delete plant batch params +func (o *DeletePlantBatchParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the delete plant batch params +func (o *DeletePlantBatchParams) WithReseller(reseller string) *DeletePlantBatchParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the delete plant batch params +func (o *DeletePlantBatchParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the delete plant batch params +func (o *DeletePlantBatchParams) WithState(state string) *DeletePlantBatchParams { + o.SetState(state) + return o +} + +// SetState adds the state to the delete plant batch params +func (o *DeletePlantBatchParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the delete plant batch params +func (o *DeletePlantBatchParams) WithUser(user string) *DeletePlantBatchParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the delete plant batch params +func (o *DeletePlantBatchParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *DeletePlantBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param itemId + qrItemID := o.ItemID + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_responses.go b/api/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_responses.go new file mode 100644 index 0000000..0fe75db --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/delete_plant_batch_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// DeletePlantBatchReader is a Reader for the DeletePlantBatch structure. +type DeletePlantBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeletePlantBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeletePlantBatchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeletePlantBatchUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeletePlantBatchForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeletePlantBatchNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeletePlantBatchInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeletePlantBatchOK creates a DeletePlantBatchOK with default headers values +func NewDeletePlantBatchOK() *DeletePlantBatchOK { + return &DeletePlantBatchOK{} +} + +/*DeletePlantBatchOK handles this case with default header values. + +Plants were successfully Deleted +*/ +type DeletePlantBatchOK struct { + Payload *metrc_gw_models.PlantBatchResponse +} + +func (o *DeletePlantBatchOK) Error() string { + return fmt.Sprintf("[DELETE /plantbatches][%d] deletePlantBatchOK %+v", 200, o.Payload) +} + +func (o *DeletePlantBatchOK) GetPayload() *metrc_gw_models.PlantBatchResponse { + return o.Payload +} + +func (o *DeletePlantBatchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantBatchResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantBatchUnauthorized creates a DeletePlantBatchUnauthorized with default headers values +func NewDeletePlantBatchUnauthorized() *DeletePlantBatchUnauthorized { + return &DeletePlantBatchUnauthorized{} +} + +/*DeletePlantBatchUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeletePlantBatchUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantBatchUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /plantbatches][%d] deletePlantBatchUnauthorized %+v", 401, o.Payload) +} + +func (o *DeletePlantBatchUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantBatchUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantBatchForbidden creates a DeletePlantBatchForbidden with default headers values +func NewDeletePlantBatchForbidden() *DeletePlantBatchForbidden { + return &DeletePlantBatchForbidden{} +} + +/*DeletePlantBatchForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeletePlantBatchForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantBatchForbidden) Error() string { + return fmt.Sprintf("[DELETE /plantbatches][%d] deletePlantBatchForbidden %+v", 403, o.Payload) +} + +func (o *DeletePlantBatchForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantBatchForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantBatchNotFound creates a DeletePlantBatchNotFound with default headers values +func NewDeletePlantBatchNotFound() *DeletePlantBatchNotFound { + return &DeletePlantBatchNotFound{} +} + +/*DeletePlantBatchNotFound handles this case with default header values. + +Resource was not found +*/ +type DeletePlantBatchNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantBatchNotFound) Error() string { + return fmt.Sprintf("[DELETE /plantbatches][%d] deletePlantBatchNotFound %+v", 404, o.Payload) +} + +func (o *DeletePlantBatchNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantBatchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantBatchInternalServerError creates a DeletePlantBatchInternalServerError with default headers values +func NewDeletePlantBatchInternalServerError() *DeletePlantBatchInternalServerError { + return &DeletePlantBatchInternalServerError{} +} + +/*DeletePlantBatchInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeletePlantBatchInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantBatchInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /plantbatches][%d] deletePlantBatchInternalServerError %+v", 500, o.Payload) +} + +func (o *DeletePlantBatchInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantBatchInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_parameters.go b/api/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_parameters.go new file mode 100644 index 0000000..175d9d9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_parameters.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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" +) + +// NewGetPlantBatchesParams creates a new GetPlantBatchesParams object +// with the default values initialized. +func NewGetPlantBatchesParams() *GetPlantBatchesParams { + var () + return &GetPlantBatchesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlantBatchesParamsWithTimeout creates a new GetPlantBatchesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlantBatchesParamsWithTimeout(timeout time.Duration) *GetPlantBatchesParams { + var () + return &GetPlantBatchesParams{ + + timeout: timeout, + } +} + +// NewGetPlantBatchesParamsWithContext creates a new GetPlantBatchesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlantBatchesParamsWithContext(ctx context.Context) *GetPlantBatchesParams { + var () + return &GetPlantBatchesParams{ + + Context: ctx, + } +} + +// NewGetPlantBatchesParamsWithHTTPClient creates a new GetPlantBatchesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlantBatchesParamsWithHTTPClient(client *http.Client) *GetPlantBatchesParams { + var () + return &GetPlantBatchesParams{ + HTTPClient: client, + } +} + +/*GetPlantBatchesParams contains all the parameters to send to the API endpoint +for the get plant batches operation typically these are written to a http.Request +*/ +type GetPlantBatchesParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*ItemID + The Item Number + + */ + ItemID *float64 + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get plant batches params +func (o *GetPlantBatchesParams) WithTimeout(timeout time.Duration) *GetPlantBatchesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get plant batches params +func (o *GetPlantBatchesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get plant batches params +func (o *GetPlantBatchesParams) WithContext(ctx context.Context) *GetPlantBatchesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get plant batches params +func (o *GetPlantBatchesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get plant batches params +func (o *GetPlantBatchesParams) WithHTTPClient(client *http.Client) *GetPlantBatchesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get plant batches params +func (o *GetPlantBatchesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get plant batches params +func (o *GetPlantBatchesParams) WithActive(active *bool) *GetPlantBatchesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get plant batches params +func (o *GetPlantBatchesParams) SetActive(active *bool) { + o.Active = active +} + +// WithItemID adds the itemID to the get plant batches params +func (o *GetPlantBatchesParams) WithItemID(itemID *float64) *GetPlantBatchesParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get plant batches params +func (o *GetPlantBatchesParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the get plant batches params +func (o *GetPlantBatchesParams) WithLicense(license string) *GetPlantBatchesParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get plant batches params +func (o *GetPlantBatchesParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get plant batches params +func (o *GetPlantBatchesParams) WithProduction(production *bool) *GetPlantBatchesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get plant batches params +func (o *GetPlantBatchesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get plant batches params +func (o *GetPlantBatchesParams) WithReseller(reseller string) *GetPlantBatchesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get plant batches params +func (o *GetPlantBatchesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get plant batches params +func (o *GetPlantBatchesParams) WithState(state string) *GetPlantBatchesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get plant batches params +func (o *GetPlantBatchesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get plant batches params +func (o *GetPlantBatchesParams) WithUser(user string) *GetPlantBatchesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get plant batches params +func (o *GetPlantBatchesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlantBatchesParams) 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.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_responses.go b/api/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_responses.go new file mode 100644 index 0000000..5b6ca8e --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/get_plant_batches_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPlantBatchesReader is a Reader for the GetPlantBatches structure. +type GetPlantBatchesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlantBatchesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlantBatchesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlantBatchesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlantBatchesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlantBatchesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlantBatchesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlantBatchesOK creates a GetPlantBatchesOK with default headers values +func NewGetPlantBatchesOK() *GetPlantBatchesOK { + return &GetPlantBatchesOK{} +} + +/*GetPlantBatchesOK handles this case with default header values. + +Plant Batches were successfully retrieved +*/ +type GetPlantBatchesOK struct { + Payload *metrc_gw_models.PlantBatchResponse +} + +func (o *GetPlantBatchesOK) Error() string { + return fmt.Sprintf("[GET /plantbatches][%d] getPlantBatchesOK %+v", 200, o.Payload) +} + +func (o *GetPlantBatchesOK) GetPayload() *metrc_gw_models.PlantBatchResponse { + return o.Payload +} + +func (o *GetPlantBatchesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantBatchResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantBatchesUnauthorized creates a GetPlantBatchesUnauthorized with default headers values +func NewGetPlantBatchesUnauthorized() *GetPlantBatchesUnauthorized { + return &GetPlantBatchesUnauthorized{} +} + +/*GetPlantBatchesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlantBatchesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantBatchesUnauthorized) Error() string { + return fmt.Sprintf("[GET /plantbatches][%d] getPlantBatchesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlantBatchesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantBatchesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantBatchesForbidden creates a GetPlantBatchesForbidden with default headers values +func NewGetPlantBatchesForbidden() *GetPlantBatchesForbidden { + return &GetPlantBatchesForbidden{} +} + +/*GetPlantBatchesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlantBatchesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantBatchesForbidden) Error() string { + return fmt.Sprintf("[GET /plantbatches][%d] getPlantBatchesForbidden %+v", 403, o.Payload) +} + +func (o *GetPlantBatchesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantBatchesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantBatchesNotFound creates a GetPlantBatchesNotFound with default headers values +func NewGetPlantBatchesNotFound() *GetPlantBatchesNotFound { + return &GetPlantBatchesNotFound{} +} + +/*GetPlantBatchesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlantBatchesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantBatchesNotFound) Error() string { + return fmt.Sprintf("[GET /plantbatches][%d] getPlantBatchesNotFound %+v", 404, o.Payload) +} + +func (o *GetPlantBatchesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantBatchesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantBatchesInternalServerError creates a GetPlantBatchesInternalServerError with default headers values +func NewGetPlantBatchesInternalServerError() *GetPlantBatchesInternalServerError { + return &GetPlantBatchesInternalServerError{} +} + +/*GetPlantBatchesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlantBatchesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantBatchesInternalServerError) Error() string { + return fmt.Sprintf("[GET /plantbatches][%d] getPlantBatchesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlantBatchesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantBatchesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plant_batches/plant_batches_client.go b/api/metrc-gw/metrc_gw_client/plant_batches/plant_batches_client.go new file mode 100644 index 0000000..02b57d7 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/plant_batches_client.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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 plant batches API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for plant batches API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeletePlantBatch(params *DeletePlantBatchParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePlantBatchOK, error) + + GetPlantBatches(params *GetPlantBatchesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantBatchesOK, error) + + PostPlantBatches(params *PostPlantBatchesParams, authInfo runtime.ClientAuthInfoWriter) (*PostPlantBatchesOK, error) + + PutPlantBatches(params *PutPlantBatchesParams, authInfo runtime.ClientAuthInfoWriter) (*PutPlantBatchesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeletePlantBatch plants for this user license + + Delete a plant for this User-License + +*/ +func (a *Client) DeletePlantBatch(params *DeletePlantBatchParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePlantBatchOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeletePlantBatchParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deletePlantBatch", + Method: "DELETE", + PathPattern: "/plantbatches", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeletePlantBatchReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeletePlantBatchOK) + 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 deletePlantBatch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlantBatches plants batches for this user license + + Get Plant Batches for this User-License + +*/ +func (a *Client) GetPlantBatches(params *GetPlantBatchesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantBatchesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlantBatchesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlantBatches", + Method: "GET", + PathPattern: "/plantbatches", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlantBatchesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlantBatchesOK) + 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 getPlantBatches: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPlantBatches creates new plant batches + + Create new Plant Batches +*/ +func (a *Client) PostPlantBatches(params *PostPlantBatchesParams, authInfo runtime.ClientAuthInfoWriter) (*PostPlantBatchesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPlantBatchesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPlantBatches", + Method: "POST", + PathPattern: "/plantbatches", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPlantBatchesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPlantBatchesOK) + 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 postPlantBatches: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPlantBatches updates existing plant batches + + Update existing Plant Batches +*/ +func (a *Client) PutPlantBatches(params *PutPlantBatchesParams, authInfo runtime.ClientAuthInfoWriter) (*PutPlantBatchesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPlantBatchesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putPlantBatches", + Method: "PUT", + PathPattern: "/plantbatches", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPlantBatchesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutPlantBatchesOK) + 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 putPlantBatches: 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/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_parameters.go b/api/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_parameters.go new file mode 100644 index 0000000..fab4137 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostPlantBatchesParams creates a new PostPlantBatchesParams object +// with the default values initialized. +func NewPostPlantBatchesParams() *PostPlantBatchesParams { + var () + return &PostPlantBatchesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPlantBatchesParamsWithTimeout creates a new PostPlantBatchesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPlantBatchesParamsWithTimeout(timeout time.Duration) *PostPlantBatchesParams { + var () + return &PostPlantBatchesParams{ + + timeout: timeout, + } +} + +// NewPostPlantBatchesParamsWithContext creates a new PostPlantBatchesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPlantBatchesParamsWithContext(ctx context.Context) *PostPlantBatchesParams { + var () + return &PostPlantBatchesParams{ + + Context: ctx, + } +} + +// NewPostPlantBatchesParamsWithHTTPClient creates a new PostPlantBatchesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPlantBatchesParamsWithHTTPClient(client *http.Client) *PostPlantBatchesParams { + var () + return &PostPlantBatchesParams{ + HTTPClient: client, + } +} + +/*PostPlantBatchesParams contains all the parameters to send to the API endpoint +for the post plant batches operation typically these are written to a http.Request +*/ +type PostPlantBatchesParams struct { + + /*PlantBatchRequest + The New Plant Batches + + */ + PlantBatchRequest *metrc_gw_models.PlantBatchRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post plant batches params +func (o *PostPlantBatchesParams) WithTimeout(timeout time.Duration) *PostPlantBatchesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post plant batches params +func (o *PostPlantBatchesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post plant batches params +func (o *PostPlantBatchesParams) WithContext(ctx context.Context) *PostPlantBatchesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post plant batches params +func (o *PostPlantBatchesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post plant batches params +func (o *PostPlantBatchesParams) WithHTTPClient(client *http.Client) *PostPlantBatchesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post plant batches params +func (o *PostPlantBatchesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPlantBatchRequest adds the plantBatchRequest to the post plant batches params +func (o *PostPlantBatchesParams) WithPlantBatchRequest(plantBatchRequest *metrc_gw_models.PlantBatchRequest) *PostPlantBatchesParams { + o.SetPlantBatchRequest(plantBatchRequest) + return o +} + +// SetPlantBatchRequest adds the plantBatchRequest to the post plant batches params +func (o *PostPlantBatchesParams) SetPlantBatchRequest(plantBatchRequest *metrc_gw_models.PlantBatchRequest) { + o.PlantBatchRequest = plantBatchRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPlantBatchesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PlantBatchRequest != nil { + if err := r.SetBodyParam(o.PlantBatchRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_responses.go b/api/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_responses.go new file mode 100644 index 0000000..87dd695 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/post_plant_batches_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostPlantBatchesReader is a Reader for the PostPlantBatches structure. +type PostPlantBatchesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPlantBatchesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPlantBatchesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPlantBatchesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPlantBatchesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPlantBatchesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPlantBatchesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPlantBatchesOK creates a PostPlantBatchesOK with default headers values +func NewPostPlantBatchesOK() *PostPlantBatchesOK { + return &PostPlantBatchesOK{} +} + +/*PostPlantBatchesOK handles this case with default header values. + +An array of Plant Batches records with the new IDs +*/ +type PostPlantBatchesOK struct { + Payload *metrc_gw_models.PlantBatchResponse +} + +func (o *PostPlantBatchesOK) Error() string { + return fmt.Sprintf("[POST /plantbatches][%d] postPlantBatchesOK %+v", 200, o.Payload) +} + +func (o *PostPlantBatchesOK) GetPayload() *metrc_gw_models.PlantBatchResponse { + return o.Payload +} + +func (o *PostPlantBatchesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantBatchResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantBatchesUnauthorized creates a PostPlantBatchesUnauthorized with default headers values +func NewPostPlantBatchesUnauthorized() *PostPlantBatchesUnauthorized { + return &PostPlantBatchesUnauthorized{} +} + +/*PostPlantBatchesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostPlantBatchesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantBatchesUnauthorized) Error() string { + return fmt.Sprintf("[POST /plantbatches][%d] postPlantBatchesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPlantBatchesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantBatchesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantBatchesForbidden creates a PostPlantBatchesForbidden with default headers values +func NewPostPlantBatchesForbidden() *PostPlantBatchesForbidden { + return &PostPlantBatchesForbidden{} +} + +/*PostPlantBatchesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPlantBatchesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantBatchesForbidden) Error() string { + return fmt.Sprintf("[POST /plantbatches][%d] postPlantBatchesForbidden %+v", 403, o.Payload) +} + +func (o *PostPlantBatchesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantBatchesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantBatchesNotFound creates a PostPlantBatchesNotFound with default headers values +func NewPostPlantBatchesNotFound() *PostPlantBatchesNotFound { + return &PostPlantBatchesNotFound{} +} + +/*PostPlantBatchesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPlantBatchesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantBatchesNotFound) Error() string { + return fmt.Sprintf("[POST /plantbatches][%d] postPlantBatchesNotFound %+v", 404, o.Payload) +} + +func (o *PostPlantBatchesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantBatchesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantBatchesInternalServerError creates a PostPlantBatchesInternalServerError with default headers values +func NewPostPlantBatchesInternalServerError() *PostPlantBatchesInternalServerError { + return &PostPlantBatchesInternalServerError{} +} + +/*PostPlantBatchesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPlantBatchesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantBatchesInternalServerError) Error() string { + return fmt.Sprintf("[POST /plantbatches][%d] postPlantBatchesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPlantBatchesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantBatchesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_parameters.go b/api/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_parameters.go new file mode 100644 index 0000000..f00e7d4 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutPlantBatchesParams creates a new PutPlantBatchesParams object +// with the default values initialized. +func NewPutPlantBatchesParams() *PutPlantBatchesParams { + var () + return &PutPlantBatchesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutPlantBatchesParamsWithTimeout creates a new PutPlantBatchesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutPlantBatchesParamsWithTimeout(timeout time.Duration) *PutPlantBatchesParams { + var () + return &PutPlantBatchesParams{ + + timeout: timeout, + } +} + +// NewPutPlantBatchesParamsWithContext creates a new PutPlantBatchesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutPlantBatchesParamsWithContext(ctx context.Context) *PutPlantBatchesParams { + var () + return &PutPlantBatchesParams{ + + Context: ctx, + } +} + +// NewPutPlantBatchesParamsWithHTTPClient creates a new PutPlantBatchesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutPlantBatchesParamsWithHTTPClient(client *http.Client) *PutPlantBatchesParams { + var () + return &PutPlantBatchesParams{ + HTTPClient: client, + } +} + +/*PutPlantBatchesParams contains all the parameters to send to the API endpoint +for the put plant batches operation typically these are written to a http.Request +*/ +type PutPlantBatchesParams struct { + + /*PlantBatchRequest + The Existing Plant Batches with Ids + + */ + PlantBatchRequest *metrc_gw_models.PlantBatchRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put plant batches params +func (o *PutPlantBatchesParams) WithTimeout(timeout time.Duration) *PutPlantBatchesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put plant batches params +func (o *PutPlantBatchesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put plant batches params +func (o *PutPlantBatchesParams) WithContext(ctx context.Context) *PutPlantBatchesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put plant batches params +func (o *PutPlantBatchesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put plant batches params +func (o *PutPlantBatchesParams) WithHTTPClient(client *http.Client) *PutPlantBatchesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put plant batches params +func (o *PutPlantBatchesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPlantBatchRequest adds the plantBatchRequest to the put plant batches params +func (o *PutPlantBatchesParams) WithPlantBatchRequest(plantBatchRequest *metrc_gw_models.PlantBatchRequest) *PutPlantBatchesParams { + o.SetPlantBatchRequest(plantBatchRequest) + return o +} + +// SetPlantBatchRequest adds the plantBatchRequest to the put plant batches params +func (o *PutPlantBatchesParams) SetPlantBatchRequest(plantBatchRequest *metrc_gw_models.PlantBatchRequest) { + o.PlantBatchRequest = plantBatchRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPlantBatchesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PlantBatchRequest != nil { + if err := r.SetBodyParam(o.PlantBatchRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_responses.go b/api/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_responses.go new file mode 100644 index 0000000..41d8479 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plant_batches/put_plant_batches_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plant_batches + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutPlantBatchesReader is a Reader for the PutPlantBatches structure. +type PutPlantBatchesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPlantBatchesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPlantBatchesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPlantBatchesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPlantBatchesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPlantBatchesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPlantBatchesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutPlantBatchesOK creates a PutPlantBatchesOK with default headers values +func NewPutPlantBatchesOK() *PutPlantBatchesOK { + return &PutPlantBatchesOK{} +} + +/*PutPlantBatchesOK handles this case with default header values. + +An array of Plant Batches records +*/ +type PutPlantBatchesOK struct { + Payload *metrc_gw_models.PlantBatchResponse +} + +func (o *PutPlantBatchesOK) Error() string { + return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesOK %+v", 200, o.Payload) +} + +func (o *PutPlantBatchesOK) GetPayload() *metrc_gw_models.PlantBatchResponse { + return o.Payload +} + +func (o *PutPlantBatchesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantBatchResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantBatchesUnauthorized creates a PutPlantBatchesUnauthorized with default headers values +func NewPutPlantBatchesUnauthorized() *PutPlantBatchesUnauthorized { + return &PutPlantBatchesUnauthorized{} +} + +/*PutPlantBatchesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutPlantBatchesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantBatchesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutPlantBatchesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantBatchesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantBatchesForbidden creates a PutPlantBatchesForbidden with default headers values +func NewPutPlantBatchesForbidden() *PutPlantBatchesForbidden { + return &PutPlantBatchesForbidden{} +} + +/*PutPlantBatchesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutPlantBatchesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantBatchesForbidden) Error() string { + return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesForbidden %+v", 403, o.Payload) +} + +func (o *PutPlantBatchesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantBatchesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantBatchesNotFound creates a PutPlantBatchesNotFound with default headers values +func NewPutPlantBatchesNotFound() *PutPlantBatchesNotFound { + return &PutPlantBatchesNotFound{} +} + +/*PutPlantBatchesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutPlantBatchesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantBatchesNotFound) Error() string { + return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesNotFound %+v", 404, o.Payload) +} + +func (o *PutPlantBatchesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantBatchesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantBatchesInternalServerError creates a PutPlantBatchesInternalServerError with default headers values +func NewPutPlantBatchesInternalServerError() *PutPlantBatchesInternalServerError { + return &PutPlantBatchesInternalServerError{} +} + +/*PutPlantBatchesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutPlantBatchesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantBatchesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutPlantBatchesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantBatchesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plants/delete_plant_parameters.go b/api/metrc-gw/metrc_gw_client/plants/delete_plant_parameters.go new file mode 100644 index 0000000..a62917d --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/delete_plant_parameters.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" +) + +// NewDeletePlantParams creates a new DeletePlantParams object +// with the default values initialized. +func NewDeletePlantParams() *DeletePlantParams { + var () + return &DeletePlantParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeletePlantParamsWithTimeout creates a new DeletePlantParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeletePlantParamsWithTimeout(timeout time.Duration) *DeletePlantParams { + var () + return &DeletePlantParams{ + + timeout: timeout, + } +} + +// NewDeletePlantParamsWithContext creates a new DeletePlantParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeletePlantParamsWithContext(ctx context.Context) *DeletePlantParams { + var () + return &DeletePlantParams{ + + Context: ctx, + } +} + +// NewDeletePlantParamsWithHTTPClient creates a new DeletePlantParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeletePlantParamsWithHTTPClient(client *http.Client) *DeletePlantParams { + var () + return &DeletePlantParams{ + HTTPClient: client, + } +} + +/*DeletePlantParams contains all the parameters to send to the API endpoint +for the delete plant operation typically these are written to a http.Request +*/ +type DeletePlantParams struct { + + /*ItemID + The Item Number + + */ + ItemID float64 + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete plant params +func (o *DeletePlantParams) WithTimeout(timeout time.Duration) *DeletePlantParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete plant params +func (o *DeletePlantParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete plant params +func (o *DeletePlantParams) WithContext(ctx context.Context) *DeletePlantParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete plant params +func (o *DeletePlantParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete plant params +func (o *DeletePlantParams) WithHTTPClient(client *http.Client) *DeletePlantParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete plant params +func (o *DeletePlantParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithItemID adds the itemID to the delete plant params +func (o *DeletePlantParams) WithItemID(itemID float64) *DeletePlantParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the delete plant params +func (o *DeletePlantParams) SetItemID(itemID float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the delete plant params +func (o *DeletePlantParams) WithLicense(license string) *DeletePlantParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the delete plant params +func (o *DeletePlantParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the delete plant params +func (o *DeletePlantParams) WithReseller(reseller string) *DeletePlantParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the delete plant params +func (o *DeletePlantParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the delete plant params +func (o *DeletePlantParams) WithState(state string) *DeletePlantParams { + o.SetState(state) + return o +} + +// SetState adds the state to the delete plant params +func (o *DeletePlantParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the delete plant params +func (o *DeletePlantParams) WithUser(user string) *DeletePlantParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the delete plant params +func (o *DeletePlantParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *DeletePlantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param itemId + qrItemID := o.ItemID + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plants/delete_plant_responses.go b/api/metrc-gw/metrc_gw_client/plants/delete_plant_responses.go new file mode 100644 index 0000000..de54414 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/delete_plant_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// DeletePlantReader is a Reader for the DeletePlant structure. +type DeletePlantReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeletePlantReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeletePlantOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeletePlantUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeletePlantForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeletePlantNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeletePlantInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeletePlantOK creates a DeletePlantOK with default headers values +func NewDeletePlantOK() *DeletePlantOK { + return &DeletePlantOK{} +} + +/*DeletePlantOK handles this case with default header values. + +Plants were successfully Deleted +*/ +type DeletePlantOK struct { + Payload *metrc_gw_models.PlantResponse +} + +func (o *DeletePlantOK) Error() string { + return fmt.Sprintf("[DELETE /plants][%d] deletePlantOK %+v", 200, o.Payload) +} + +func (o *DeletePlantOK) GetPayload() *metrc_gw_models.PlantResponse { + return o.Payload +} + +func (o *DeletePlantOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantUnauthorized creates a DeletePlantUnauthorized with default headers values +func NewDeletePlantUnauthorized() *DeletePlantUnauthorized { + return &DeletePlantUnauthorized{} +} + +/*DeletePlantUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeletePlantUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /plants][%d] deletePlantUnauthorized %+v", 401, o.Payload) +} + +func (o *DeletePlantUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantForbidden creates a DeletePlantForbidden with default headers values +func NewDeletePlantForbidden() *DeletePlantForbidden { + return &DeletePlantForbidden{} +} + +/*DeletePlantForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeletePlantForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantForbidden) Error() string { + return fmt.Sprintf("[DELETE /plants][%d] deletePlantForbidden %+v", 403, o.Payload) +} + +func (o *DeletePlantForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantNotFound creates a DeletePlantNotFound with default headers values +func NewDeletePlantNotFound() *DeletePlantNotFound { + return &DeletePlantNotFound{} +} + +/*DeletePlantNotFound handles this case with default header values. + +Resource was not found +*/ +type DeletePlantNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantNotFound) Error() string { + return fmt.Sprintf("[DELETE /plants][%d] deletePlantNotFound %+v", 404, o.Payload) +} + +func (o *DeletePlantNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePlantInternalServerError creates a DeletePlantInternalServerError with default headers values +func NewDeletePlantInternalServerError() *DeletePlantInternalServerError { + return &DeletePlantInternalServerError{} +} + +/*DeletePlantInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeletePlantInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *DeletePlantInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /plants][%d] deletePlantInternalServerError %+v", 500, o.Payload) +} + +func (o *DeletePlantInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeletePlantInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_parameters.go b/api/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_parameters.go new file mode 100644 index 0000000..9132388 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_parameters.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" +) + +// NewGetPlantGrowthPhasesParams creates a new GetPlantGrowthPhasesParams object +// with the default values initialized. +func NewGetPlantGrowthPhasesParams() *GetPlantGrowthPhasesParams { + var () + return &GetPlantGrowthPhasesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlantGrowthPhasesParamsWithTimeout creates a new GetPlantGrowthPhasesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlantGrowthPhasesParamsWithTimeout(timeout time.Duration) *GetPlantGrowthPhasesParams { + var () + return &GetPlantGrowthPhasesParams{ + + timeout: timeout, + } +} + +// NewGetPlantGrowthPhasesParamsWithContext creates a new GetPlantGrowthPhasesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlantGrowthPhasesParamsWithContext(ctx context.Context) *GetPlantGrowthPhasesParams { + var () + return &GetPlantGrowthPhasesParams{ + + Context: ctx, + } +} + +// NewGetPlantGrowthPhasesParamsWithHTTPClient creates a new GetPlantGrowthPhasesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlantGrowthPhasesParamsWithHTTPClient(client *http.Client) *GetPlantGrowthPhasesParams { + var () + return &GetPlantGrowthPhasesParams{ + HTTPClient: client, + } +} + +/*GetPlantGrowthPhasesParams contains all the parameters to send to the API endpoint +for the get plant growth phases operation typically these are written to a http.Request +*/ +type GetPlantGrowthPhasesParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithTimeout(timeout time.Duration) *GetPlantGrowthPhasesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithContext(ctx context.Context) *GetPlantGrowthPhasesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithHTTPClient(client *http.Client) *GetPlantGrowthPhasesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithLicense(license string) *GetPlantGrowthPhasesParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithProduction(production *bool) *GetPlantGrowthPhasesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithReseller(reseller string) *GetPlantGrowthPhasesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithState(state string) *GetPlantGrowthPhasesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) WithUser(user string) *GetPlantGrowthPhasesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get plant growth phases params +func (o *GetPlantGrowthPhasesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlantGrowthPhasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_responses.go b/api/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_responses.go new file mode 100644 index 0000000..dcd6e05 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plant_growth_phases_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPlantGrowthPhasesReader is a Reader for the GetPlantGrowthPhases structure. +type GetPlantGrowthPhasesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlantGrowthPhasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlantGrowthPhasesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlantGrowthPhasesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlantGrowthPhasesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlantGrowthPhasesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlantGrowthPhasesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlantGrowthPhasesOK creates a GetPlantGrowthPhasesOK with default headers values +func NewGetPlantGrowthPhasesOK() *GetPlantGrowthPhasesOK { + return &GetPlantGrowthPhasesOK{} +} + +/*GetPlantGrowthPhasesOK handles this case with default header values. + +Plant Growth Phases were successfully retrieved +*/ +type GetPlantGrowthPhasesOK struct { + Payload *metrc_gw_models.PlantGrowthPhaseResponse +} + +func (o *GetPlantGrowthPhasesOK) Error() string { + return fmt.Sprintf("[GET /plants/growthphases][%d] getPlantGrowthPhasesOK %+v", 200, o.Payload) +} + +func (o *GetPlantGrowthPhasesOK) GetPayload() *metrc_gw_models.PlantGrowthPhaseResponse { + return o.Payload +} + +func (o *GetPlantGrowthPhasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantGrowthPhaseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantGrowthPhasesUnauthorized creates a GetPlantGrowthPhasesUnauthorized with default headers values +func NewGetPlantGrowthPhasesUnauthorized() *GetPlantGrowthPhasesUnauthorized { + return &GetPlantGrowthPhasesUnauthorized{} +} + +/*GetPlantGrowthPhasesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlantGrowthPhasesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantGrowthPhasesUnauthorized) Error() string { + return fmt.Sprintf("[GET /plants/growthphases][%d] getPlantGrowthPhasesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlantGrowthPhasesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantGrowthPhasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantGrowthPhasesForbidden creates a GetPlantGrowthPhasesForbidden with default headers values +func NewGetPlantGrowthPhasesForbidden() *GetPlantGrowthPhasesForbidden { + return &GetPlantGrowthPhasesForbidden{} +} + +/*GetPlantGrowthPhasesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlantGrowthPhasesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantGrowthPhasesForbidden) Error() string { + return fmt.Sprintf("[GET /plants/growthphases][%d] getPlantGrowthPhasesForbidden %+v", 403, o.Payload) +} + +func (o *GetPlantGrowthPhasesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantGrowthPhasesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantGrowthPhasesNotFound creates a GetPlantGrowthPhasesNotFound with default headers values +func NewGetPlantGrowthPhasesNotFound() *GetPlantGrowthPhasesNotFound { + return &GetPlantGrowthPhasesNotFound{} +} + +/*GetPlantGrowthPhasesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlantGrowthPhasesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantGrowthPhasesNotFound) Error() string { + return fmt.Sprintf("[GET /plants/growthphases][%d] getPlantGrowthPhasesNotFound %+v", 404, o.Payload) +} + +func (o *GetPlantGrowthPhasesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantGrowthPhasesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantGrowthPhasesInternalServerError creates a GetPlantGrowthPhasesInternalServerError with default headers values +func NewGetPlantGrowthPhasesInternalServerError() *GetPlantGrowthPhasesInternalServerError { + return &GetPlantGrowthPhasesInternalServerError{} +} + +/*GetPlantGrowthPhasesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlantGrowthPhasesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantGrowthPhasesInternalServerError) Error() string { + return fmt.Sprintf("[GET /plants/growthphases][%d] getPlantGrowthPhasesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlantGrowthPhasesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantGrowthPhasesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_parameters.go b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_parameters.go new file mode 100644 index 0000000..8ba6fa8 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_parameters.go @@ -0,0 +1,218 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" +) + +// NewGetPlantWasteMethodsParams creates a new GetPlantWasteMethodsParams object +// with the default values initialized. +func NewGetPlantWasteMethodsParams() *GetPlantWasteMethodsParams { + var () + return &GetPlantWasteMethodsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlantWasteMethodsParamsWithTimeout creates a new GetPlantWasteMethodsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlantWasteMethodsParamsWithTimeout(timeout time.Duration) *GetPlantWasteMethodsParams { + var () + return &GetPlantWasteMethodsParams{ + + timeout: timeout, + } +} + +// NewGetPlantWasteMethodsParamsWithContext creates a new GetPlantWasteMethodsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlantWasteMethodsParamsWithContext(ctx context.Context) *GetPlantWasteMethodsParams { + var () + return &GetPlantWasteMethodsParams{ + + Context: ctx, + } +} + +// NewGetPlantWasteMethodsParamsWithHTTPClient creates a new GetPlantWasteMethodsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlantWasteMethodsParamsWithHTTPClient(client *http.Client) *GetPlantWasteMethodsParams { + var () + return &GetPlantWasteMethodsParams{ + HTTPClient: client, + } +} + +/*GetPlantWasteMethodsParams contains all the parameters to send to the API endpoint +for the get plant waste methods operation typically these are written to a http.Request +*/ +type GetPlantWasteMethodsParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) WithTimeout(timeout time.Duration) *GetPlantWasteMethodsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) WithContext(ctx context.Context) *GetPlantWasteMethodsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) WithHTTPClient(client *http.Client) *GetPlantWasteMethodsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) WithLicense(license string) *GetPlantWasteMethodsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) WithReseller(reseller string) *GetPlantWasteMethodsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) WithState(state string) *GetPlantWasteMethodsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) WithUser(user string) *GetPlantWasteMethodsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get plant waste methods params +func (o *GetPlantWasteMethodsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlantWasteMethodsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_responses.go b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_responses.go new file mode 100644 index 0000000..2a140f3 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_methods_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPlantWasteMethodsReader is a Reader for the GetPlantWasteMethods structure. +type GetPlantWasteMethodsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlantWasteMethodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlantWasteMethodsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlantWasteMethodsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlantWasteMethodsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlantWasteMethodsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlantWasteMethodsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlantWasteMethodsOK creates a GetPlantWasteMethodsOK with default headers values +func NewGetPlantWasteMethodsOK() *GetPlantWasteMethodsOK { + return &GetPlantWasteMethodsOK{} +} + +/*GetPlantWasteMethodsOK handles this case with default header values. + +Plant Waste Methods were successfully retrieved +*/ +type GetPlantWasteMethodsOK struct { + Payload *metrc_gw_models.PlantWasteMethodResponse +} + +func (o *GetPlantWasteMethodsOK) Error() string { + return fmt.Sprintf("[GET /plants/wastemethods][%d] getPlantWasteMethodsOK %+v", 200, o.Payload) +} + +func (o *GetPlantWasteMethodsOK) GetPayload() *metrc_gw_models.PlantWasteMethodResponse { + return o.Payload +} + +func (o *GetPlantWasteMethodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantWasteMethodResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteMethodsUnauthorized creates a GetPlantWasteMethodsUnauthorized with default headers values +func NewGetPlantWasteMethodsUnauthorized() *GetPlantWasteMethodsUnauthorized { + return &GetPlantWasteMethodsUnauthorized{} +} + +/*GetPlantWasteMethodsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlantWasteMethodsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteMethodsUnauthorized) Error() string { + return fmt.Sprintf("[GET /plants/wastemethods][%d] getPlantWasteMethodsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlantWasteMethodsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteMethodsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteMethodsForbidden creates a GetPlantWasteMethodsForbidden with default headers values +func NewGetPlantWasteMethodsForbidden() *GetPlantWasteMethodsForbidden { + return &GetPlantWasteMethodsForbidden{} +} + +/*GetPlantWasteMethodsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlantWasteMethodsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteMethodsForbidden) Error() string { + return fmt.Sprintf("[GET /plants/wastemethods][%d] getPlantWasteMethodsForbidden %+v", 403, o.Payload) +} + +func (o *GetPlantWasteMethodsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteMethodsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteMethodsNotFound creates a GetPlantWasteMethodsNotFound with default headers values +func NewGetPlantWasteMethodsNotFound() *GetPlantWasteMethodsNotFound { + return &GetPlantWasteMethodsNotFound{} +} + +/*GetPlantWasteMethodsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlantWasteMethodsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteMethodsNotFound) Error() string { + return fmt.Sprintf("[GET /plants/wastemethods][%d] getPlantWasteMethodsNotFound %+v", 404, o.Payload) +} + +func (o *GetPlantWasteMethodsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteMethodsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteMethodsInternalServerError creates a GetPlantWasteMethodsInternalServerError with default headers values +func NewGetPlantWasteMethodsInternalServerError() *GetPlantWasteMethodsInternalServerError { + return &GetPlantWasteMethodsInternalServerError{} +} + +/*GetPlantWasteMethodsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlantWasteMethodsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteMethodsInternalServerError) Error() string { + return fmt.Sprintf("[GET /plants/wastemethods][%d] getPlantWasteMethodsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlantWasteMethodsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteMethodsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_parameters.go b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_parameters.go new file mode 100644 index 0000000..d23a3ea --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_parameters.go @@ -0,0 +1,218 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" +) + +// NewGetPlantWasteReasonsParams creates a new GetPlantWasteReasonsParams object +// with the default values initialized. +func NewGetPlantWasteReasonsParams() *GetPlantWasteReasonsParams { + var () + return &GetPlantWasteReasonsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlantWasteReasonsParamsWithTimeout creates a new GetPlantWasteReasonsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlantWasteReasonsParamsWithTimeout(timeout time.Duration) *GetPlantWasteReasonsParams { + var () + return &GetPlantWasteReasonsParams{ + + timeout: timeout, + } +} + +// NewGetPlantWasteReasonsParamsWithContext creates a new GetPlantWasteReasonsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlantWasteReasonsParamsWithContext(ctx context.Context) *GetPlantWasteReasonsParams { + var () + return &GetPlantWasteReasonsParams{ + + Context: ctx, + } +} + +// NewGetPlantWasteReasonsParamsWithHTTPClient creates a new GetPlantWasteReasonsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlantWasteReasonsParamsWithHTTPClient(client *http.Client) *GetPlantWasteReasonsParams { + var () + return &GetPlantWasteReasonsParams{ + HTTPClient: client, + } +} + +/*GetPlantWasteReasonsParams contains all the parameters to send to the API endpoint +for the get plant waste reasons operation typically these are written to a http.Request +*/ +type GetPlantWasteReasonsParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) WithTimeout(timeout time.Duration) *GetPlantWasteReasonsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) WithContext(ctx context.Context) *GetPlantWasteReasonsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) WithHTTPClient(client *http.Client) *GetPlantWasteReasonsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) WithLicense(license string) *GetPlantWasteReasonsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) WithReseller(reseller string) *GetPlantWasteReasonsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) WithState(state string) *GetPlantWasteReasonsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) WithUser(user string) *GetPlantWasteReasonsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get plant waste reasons params +func (o *GetPlantWasteReasonsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlantWasteReasonsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_responses.go b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_responses.go new file mode 100644 index 0000000..b81819a --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plant_waste_reasons_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPlantWasteReasonsReader is a Reader for the GetPlantWasteReasons structure. +type GetPlantWasteReasonsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlantWasteReasonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlantWasteReasonsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlantWasteReasonsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlantWasteReasonsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlantWasteReasonsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlantWasteReasonsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlantWasteReasonsOK creates a GetPlantWasteReasonsOK with default headers values +func NewGetPlantWasteReasonsOK() *GetPlantWasteReasonsOK { + return &GetPlantWasteReasonsOK{} +} + +/*GetPlantWasteReasonsOK handles this case with default header values. + +Plant Waste Reasons were successfully retrieved +*/ +type GetPlantWasteReasonsOK struct { + Payload *metrc_gw_models.PlantWasteReasonResponse +} + +func (o *GetPlantWasteReasonsOK) Error() string { + return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsOK %+v", 200, o.Payload) +} + +func (o *GetPlantWasteReasonsOK) GetPayload() *metrc_gw_models.PlantWasteReasonResponse { + return o.Payload +} + +func (o *GetPlantWasteReasonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantWasteReasonResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteReasonsUnauthorized creates a GetPlantWasteReasonsUnauthorized with default headers values +func NewGetPlantWasteReasonsUnauthorized() *GetPlantWasteReasonsUnauthorized { + return &GetPlantWasteReasonsUnauthorized{} +} + +/*GetPlantWasteReasonsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlantWasteReasonsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteReasonsUnauthorized) Error() string { + return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlantWasteReasonsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteReasonsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteReasonsForbidden creates a GetPlantWasteReasonsForbidden with default headers values +func NewGetPlantWasteReasonsForbidden() *GetPlantWasteReasonsForbidden { + return &GetPlantWasteReasonsForbidden{} +} + +/*GetPlantWasteReasonsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlantWasteReasonsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteReasonsForbidden) Error() string { + return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsForbidden %+v", 403, o.Payload) +} + +func (o *GetPlantWasteReasonsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteReasonsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteReasonsNotFound creates a GetPlantWasteReasonsNotFound with default headers values +func NewGetPlantWasteReasonsNotFound() *GetPlantWasteReasonsNotFound { + return &GetPlantWasteReasonsNotFound{} +} + +/*GetPlantWasteReasonsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlantWasteReasonsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteReasonsNotFound) Error() string { + return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsNotFound %+v", 404, o.Payload) +} + +func (o *GetPlantWasteReasonsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteReasonsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantWasteReasonsInternalServerError creates a GetPlantWasteReasonsInternalServerError with default headers values +func NewGetPlantWasteReasonsInternalServerError() *GetPlantWasteReasonsInternalServerError { + return &GetPlantWasteReasonsInternalServerError{} +} + +/*GetPlantWasteReasonsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlantWasteReasonsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantWasteReasonsInternalServerError) Error() string { + return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlantWasteReasonsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantWasteReasonsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plants/get_plants_parameters.go b/api/metrc-gw/metrc_gw_client/plants/get_plants_parameters.go new file mode 100644 index 0000000..653cc37 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plants_parameters.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" +) + +// NewGetPlantsParams creates a new GetPlantsParams object +// with the default values initialized. +func NewGetPlantsParams() *GetPlantsParams { + var () + return &GetPlantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlantsParamsWithTimeout creates a new GetPlantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlantsParamsWithTimeout(timeout time.Duration) *GetPlantsParams { + var () + return &GetPlantsParams{ + + timeout: timeout, + } +} + +// NewGetPlantsParamsWithContext creates a new GetPlantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlantsParamsWithContext(ctx context.Context) *GetPlantsParams { + var () + return &GetPlantsParams{ + + Context: ctx, + } +} + +// NewGetPlantsParamsWithHTTPClient creates a new GetPlantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlantsParamsWithHTTPClient(client *http.Client) *GetPlantsParams { + var () + return &GetPlantsParams{ + HTTPClient: client, + } +} + +/*GetPlantsParams contains all the parameters to send to the API endpoint +for the get plants operation typically these are written to a http.Request +*/ +type GetPlantsParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*ItemID + The Item Number + + */ + ItemID *float64 + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get plants params +func (o *GetPlantsParams) WithTimeout(timeout time.Duration) *GetPlantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get plants params +func (o *GetPlantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get plants params +func (o *GetPlantsParams) WithContext(ctx context.Context) *GetPlantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get plants params +func (o *GetPlantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get plants params +func (o *GetPlantsParams) WithHTTPClient(client *http.Client) *GetPlantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get plants params +func (o *GetPlantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get plants params +func (o *GetPlantsParams) WithActive(active *bool) *GetPlantsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get plants params +func (o *GetPlantsParams) SetActive(active *bool) { + o.Active = active +} + +// WithItemID adds the itemID to the get plants params +func (o *GetPlantsParams) WithItemID(itemID *float64) *GetPlantsParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get plants params +func (o *GetPlantsParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the get plants params +func (o *GetPlantsParams) WithLicense(license string) *GetPlantsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get plants params +func (o *GetPlantsParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get plants params +func (o *GetPlantsParams) WithProduction(production *bool) *GetPlantsParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get plants params +func (o *GetPlantsParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get plants params +func (o *GetPlantsParams) WithReseller(reseller string) *GetPlantsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get plants params +func (o *GetPlantsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get plants params +func (o *GetPlantsParams) WithState(state string) *GetPlantsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get plants params +func (o *GetPlantsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get plants params +func (o *GetPlantsParams) WithUser(user string) *GetPlantsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get plants params +func (o *GetPlantsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlantsParams) 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.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plants/get_plants_responses.go b/api/metrc-gw/metrc_gw_client/plants/get_plants_responses.go new file mode 100644 index 0000000..ae4a59b --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/get_plants_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetPlantsReader is a Reader for the GetPlants structure. +type GetPlantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlantsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlantsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlantsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlantsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlantsOK creates a GetPlantsOK with default headers values +func NewGetPlantsOK() *GetPlantsOK { + return &GetPlantsOK{} +} + +/*GetPlantsOK handles this case with default header values. + +Plants were successfully retrieved +*/ +type GetPlantsOK struct { + Payload *metrc_gw_models.PlantResponse +} + +func (o *GetPlantsOK) Error() string { + return fmt.Sprintf("[GET /plants][%d] getPlantsOK %+v", 200, o.Payload) +} + +func (o *GetPlantsOK) GetPayload() *metrc_gw_models.PlantResponse { + return o.Payload +} + +func (o *GetPlantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantsUnauthorized creates a GetPlantsUnauthorized with default headers values +func NewGetPlantsUnauthorized() *GetPlantsUnauthorized { + return &GetPlantsUnauthorized{} +} + +/*GetPlantsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlantsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantsUnauthorized) Error() string { + return fmt.Sprintf("[GET /plants][%d] getPlantsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlantsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantsForbidden creates a GetPlantsForbidden with default headers values +func NewGetPlantsForbidden() *GetPlantsForbidden { + return &GetPlantsForbidden{} +} + +/*GetPlantsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlantsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantsForbidden) Error() string { + return fmt.Sprintf("[GET /plants][%d] getPlantsForbidden %+v", 403, o.Payload) +} + +func (o *GetPlantsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantsNotFound creates a GetPlantsNotFound with default headers values +func NewGetPlantsNotFound() *GetPlantsNotFound { + return &GetPlantsNotFound{} +} + +/*GetPlantsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlantsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantsNotFound) Error() string { + return fmt.Sprintf("[GET /plants][%d] getPlantsNotFound %+v", 404, o.Payload) +} + +func (o *GetPlantsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlantsInternalServerError creates a GetPlantsInternalServerError with default headers values +func NewGetPlantsInternalServerError() *GetPlantsInternalServerError { + return &GetPlantsInternalServerError{} +} + +/*GetPlantsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlantsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetPlantsInternalServerError) Error() string { + return fmt.Sprintf("[GET /plants][%d] getPlantsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlantsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetPlantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plants/plants_client.go b/api/metrc-gw/metrc_gw_client/plants/plants_client.go new file mode 100644 index 0000000..385a22a --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/plants_client.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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 plants API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for plants API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeletePlant(params *DeletePlantParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePlantOK, error) + + GetPlantGrowthPhases(params *GetPlantGrowthPhasesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantGrowthPhasesOK, error) + + GetPlantWasteMethods(params *GetPlantWasteMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantWasteMethodsOK, error) + + GetPlantWasteReasons(params *GetPlantWasteReasonsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantWasteReasonsOK, error) + + GetPlants(params *GetPlantsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantsOK, error) + + PostPlants(params *PostPlantsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPlantsOK, error) + + PutPlants(params *PutPlantsParams, authInfo runtime.ClientAuthInfoWriter) (*PutPlantsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeletePlant plants for this user license + + Delete a plant for this User-License + +*/ +func (a *Client) DeletePlant(params *DeletePlantParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePlantOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeletePlantParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deletePlant", + Method: "DELETE", + PathPattern: "/plants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeletePlantReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeletePlantOK) + 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 deletePlant: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlantGrowthPhases plants growth phases for this user license + + Get available Plant Growth Phases for this User-License +*/ +func (a *Client) GetPlantGrowthPhases(params *GetPlantGrowthPhasesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantGrowthPhasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlantGrowthPhasesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlantGrowthPhases", + Method: "GET", + PathPattern: "/plants/growthphases", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlantGrowthPhasesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlantGrowthPhasesOK) + 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 getPlantGrowthPhases: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlantWasteMethods plants waste methods for this user license + + Get available Plant Waste Methods for this User-License +*/ +func (a *Client) GetPlantWasteMethods(params *GetPlantWasteMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantWasteMethodsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlantWasteMethodsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlantWasteMethods", + Method: "GET", + PathPattern: "/plants/wastemethods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlantWasteMethodsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlantWasteMethodsOK) + 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 getPlantWasteMethods: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlantWasteReasons plants waste methods for this user license + + Get available Plant Waste Reasons for this User-License +*/ +func (a *Client) GetPlantWasteReasons(params *GetPlantWasteReasonsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantWasteReasonsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlantWasteReasonsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlantWasteReasons", + Method: "GET", + PathPattern: "/plants/wastereasons", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlantWasteReasonsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlantWasteReasonsOK) + 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 getPlantWasteReasons: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPlants plants for this user license + + Get Plants for this User-License + +*/ +func (a *Client) GetPlants(params *GetPlantsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlantsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlants", + Method: "GET", + PathPattern: "/plants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlantsOK) + 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 getPlants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPlants creates new plants + + Create new Plants +*/ +func (a *Client) PostPlants(params *PostPlantsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPlantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPlantsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPlants", + Method: "POST", + PathPattern: "/plants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPlantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPlantsOK) + 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 postPlants: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPlants updates existing plants + + Update existing Plants +*/ +func (a *Client) PutPlants(params *PutPlantsParams, authInfo runtime.ClientAuthInfoWriter) (*PutPlantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPlantsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putPlants", + Method: "PUT", + PathPattern: "/plants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPlantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutPlantsOK) + 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 putPlants: 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/metrc-gw/metrc_gw_client/plants/post_plants_parameters.go b/api/metrc-gw/metrc_gw_client/plants/post_plants_parameters.go new file mode 100644 index 0000000..7d255b9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/post_plants_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostPlantsParams creates a new PostPlantsParams object +// with the default values initialized. +func NewPostPlantsParams() *PostPlantsParams { + var () + return &PostPlantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPlantsParamsWithTimeout creates a new PostPlantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPlantsParamsWithTimeout(timeout time.Duration) *PostPlantsParams { + var () + return &PostPlantsParams{ + + timeout: timeout, + } +} + +// NewPostPlantsParamsWithContext creates a new PostPlantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPlantsParamsWithContext(ctx context.Context) *PostPlantsParams { + var () + return &PostPlantsParams{ + + Context: ctx, + } +} + +// NewPostPlantsParamsWithHTTPClient creates a new PostPlantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPlantsParamsWithHTTPClient(client *http.Client) *PostPlantsParams { + var () + return &PostPlantsParams{ + HTTPClient: client, + } +} + +/*PostPlantsParams contains all the parameters to send to the API endpoint +for the post plants operation typically these are written to a http.Request +*/ +type PostPlantsParams struct { + + /*PlantRequest + The New Plants + + */ + PlantRequest *metrc_gw_models.PlantRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post plants params +func (o *PostPlantsParams) WithTimeout(timeout time.Duration) *PostPlantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post plants params +func (o *PostPlantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post plants params +func (o *PostPlantsParams) WithContext(ctx context.Context) *PostPlantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post plants params +func (o *PostPlantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post plants params +func (o *PostPlantsParams) WithHTTPClient(client *http.Client) *PostPlantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post plants params +func (o *PostPlantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPlantRequest adds the plantRequest to the post plants params +func (o *PostPlantsParams) WithPlantRequest(plantRequest *metrc_gw_models.PlantRequest) *PostPlantsParams { + o.SetPlantRequest(plantRequest) + return o +} + +// SetPlantRequest adds the plantRequest to the post plants params +func (o *PostPlantsParams) SetPlantRequest(plantRequest *metrc_gw_models.PlantRequest) { + o.PlantRequest = plantRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPlantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PlantRequest != nil { + if err := r.SetBodyParam(o.PlantRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plants/post_plants_responses.go b/api/metrc-gw/metrc_gw_client/plants/post_plants_responses.go new file mode 100644 index 0000000..060b40f --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/post_plants_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostPlantsReader is a Reader for the PostPlants structure. +type PostPlantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPlantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPlantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPlantsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPlantsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPlantsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPlantsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPlantsOK creates a PostPlantsOK with default headers values +func NewPostPlantsOK() *PostPlantsOK { + return &PostPlantsOK{} +} + +/*PostPlantsOK handles this case with default header values. + +An array of Plants records with the new IDs +*/ +type PostPlantsOK struct { + Payload *metrc_gw_models.PlantResponse +} + +func (o *PostPlantsOK) Error() string { + return fmt.Sprintf("[POST /plants][%d] postPlantsOK %+v", 200, o.Payload) +} + +func (o *PostPlantsOK) GetPayload() *metrc_gw_models.PlantResponse { + return o.Payload +} + +func (o *PostPlantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantsUnauthorized creates a PostPlantsUnauthorized with default headers values +func NewPostPlantsUnauthorized() *PostPlantsUnauthorized { + return &PostPlantsUnauthorized{} +} + +/*PostPlantsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostPlantsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantsUnauthorized) Error() string { + return fmt.Sprintf("[POST /plants][%d] postPlantsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPlantsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantsForbidden creates a PostPlantsForbidden with default headers values +func NewPostPlantsForbidden() *PostPlantsForbidden { + return &PostPlantsForbidden{} +} + +/*PostPlantsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPlantsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantsForbidden) Error() string { + return fmt.Sprintf("[POST /plants][%d] postPlantsForbidden %+v", 403, o.Payload) +} + +func (o *PostPlantsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantsNotFound creates a PostPlantsNotFound with default headers values +func NewPostPlantsNotFound() *PostPlantsNotFound { + return &PostPlantsNotFound{} +} + +/*PostPlantsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPlantsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantsNotFound) Error() string { + return fmt.Sprintf("[POST /plants][%d] postPlantsNotFound %+v", 404, o.Payload) +} + +func (o *PostPlantsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPlantsInternalServerError creates a PostPlantsInternalServerError with default headers values +func NewPostPlantsInternalServerError() *PostPlantsInternalServerError { + return &PostPlantsInternalServerError{} +} + +/*PostPlantsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPlantsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostPlantsInternalServerError) Error() string { + return fmt.Sprintf("[POST /plants][%d] postPlantsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPlantsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostPlantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/plants/put_plants_parameters.go b/api/metrc-gw/metrc_gw_client/plants/put_plants_parameters.go new file mode 100644 index 0000000..161df82 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/put_plants_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutPlantsParams creates a new PutPlantsParams object +// with the default values initialized. +func NewPutPlantsParams() *PutPlantsParams { + var () + return &PutPlantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutPlantsParamsWithTimeout creates a new PutPlantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutPlantsParamsWithTimeout(timeout time.Duration) *PutPlantsParams { + var () + return &PutPlantsParams{ + + timeout: timeout, + } +} + +// NewPutPlantsParamsWithContext creates a new PutPlantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutPlantsParamsWithContext(ctx context.Context) *PutPlantsParams { + var () + return &PutPlantsParams{ + + Context: ctx, + } +} + +// NewPutPlantsParamsWithHTTPClient creates a new PutPlantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutPlantsParamsWithHTTPClient(client *http.Client) *PutPlantsParams { + var () + return &PutPlantsParams{ + HTTPClient: client, + } +} + +/*PutPlantsParams contains all the parameters to send to the API endpoint +for the put plants operation typically these are written to a http.Request +*/ +type PutPlantsParams struct { + + /*PlantRequest + The Existing Plants with Ids + + */ + PlantRequest *metrc_gw_models.PlantRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put plants params +func (o *PutPlantsParams) WithTimeout(timeout time.Duration) *PutPlantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put plants params +func (o *PutPlantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put plants params +func (o *PutPlantsParams) WithContext(ctx context.Context) *PutPlantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put plants params +func (o *PutPlantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put plants params +func (o *PutPlantsParams) WithHTTPClient(client *http.Client) *PutPlantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put plants params +func (o *PutPlantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPlantRequest adds the plantRequest to the put plants params +func (o *PutPlantsParams) WithPlantRequest(plantRequest *metrc_gw_models.PlantRequest) *PutPlantsParams { + o.SetPlantRequest(plantRequest) + return o +} + +// SetPlantRequest adds the plantRequest to the put plants params +func (o *PutPlantsParams) SetPlantRequest(plantRequest *metrc_gw_models.PlantRequest) { + o.PlantRequest = plantRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPlantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PlantRequest != nil { + if err := r.SetBodyParam(o.PlantRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/plants/put_plants_responses.go b/api/metrc-gw/metrc_gw_client/plants/put_plants_responses.go new file mode 100644 index 0000000..4e242e1 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/plants/put_plants_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plants + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutPlantsReader is a Reader for the PutPlants structure. +type PutPlantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPlantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPlantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPlantsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPlantsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPlantsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPlantsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutPlantsOK creates a PutPlantsOK with default headers values +func NewPutPlantsOK() *PutPlantsOK { + return &PutPlantsOK{} +} + +/*PutPlantsOK handles this case with default header values. + +An array of Plants records +*/ +type PutPlantsOK struct { + Payload *metrc_gw_models.PlantResponse +} + +func (o *PutPlantsOK) Error() string { + return fmt.Sprintf("[PUT /plants][%d] putPlantsOK %+v", 200, o.Payload) +} + +func (o *PutPlantsOK) GetPayload() *metrc_gw_models.PlantResponse { + return o.Payload +} + +func (o *PutPlantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.PlantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantsUnauthorized creates a PutPlantsUnauthorized with default headers values +func NewPutPlantsUnauthorized() *PutPlantsUnauthorized { + return &PutPlantsUnauthorized{} +} + +/*PutPlantsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutPlantsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /plants][%d] putPlantsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutPlantsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantsForbidden creates a PutPlantsForbidden with default headers values +func NewPutPlantsForbidden() *PutPlantsForbidden { + return &PutPlantsForbidden{} +} + +/*PutPlantsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutPlantsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantsForbidden) Error() string { + return fmt.Sprintf("[PUT /plants][%d] putPlantsForbidden %+v", 403, o.Payload) +} + +func (o *PutPlantsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantsNotFound creates a PutPlantsNotFound with default headers values +func NewPutPlantsNotFound() *PutPlantsNotFound { + return &PutPlantsNotFound{} +} + +/*PutPlantsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutPlantsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantsNotFound) Error() string { + return fmt.Sprintf("[PUT /plants][%d] putPlantsNotFound %+v", 404, o.Payload) +} + +func (o *PutPlantsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPlantsInternalServerError creates a PutPlantsInternalServerError with default headers values +func NewPutPlantsInternalServerError() *PutPlantsInternalServerError { + return &PutPlantsInternalServerError{} +} + +/*PutPlantsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutPlantsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutPlantsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /plants][%d] putPlantsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutPlantsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutPlantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/rooms/delete_room_parameters.go b/api/metrc-gw/metrc_gw_client/rooms/delete_room_parameters.go new file mode 100644 index 0000000..15ddcc4 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/delete_room_parameters.go @@ -0,0 +1,243 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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" +) + +// NewDeleteRoomParams creates a new DeleteRoomParams object +// with the default values initialized. +func NewDeleteRoomParams() *DeleteRoomParams { + var () + return &DeleteRoomParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteRoomParamsWithTimeout creates a new DeleteRoomParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteRoomParamsWithTimeout(timeout time.Duration) *DeleteRoomParams { + var () + return &DeleteRoomParams{ + + timeout: timeout, + } +} + +// NewDeleteRoomParamsWithContext creates a new DeleteRoomParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteRoomParamsWithContext(ctx context.Context) *DeleteRoomParams { + var () + return &DeleteRoomParams{ + + Context: ctx, + } +} + +// NewDeleteRoomParamsWithHTTPClient creates a new DeleteRoomParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteRoomParamsWithHTTPClient(client *http.Client) *DeleteRoomParams { + var () + return &DeleteRoomParams{ + HTTPClient: client, + } +} + +/*DeleteRoomParams contains all the parameters to send to the API endpoint +for the delete room operation typically these are written to a http.Request +*/ +type DeleteRoomParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*RoomNumber + The Room ID number + + */ + RoomNumber string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete room params +func (o *DeleteRoomParams) WithTimeout(timeout time.Duration) *DeleteRoomParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete room params +func (o *DeleteRoomParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete room params +func (o *DeleteRoomParams) WithContext(ctx context.Context) *DeleteRoomParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete room params +func (o *DeleteRoomParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete room params +func (o *DeleteRoomParams) WithHTTPClient(client *http.Client) *DeleteRoomParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete room params +func (o *DeleteRoomParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the delete room params +func (o *DeleteRoomParams) WithLicense(license string) *DeleteRoomParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the delete room params +func (o *DeleteRoomParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the delete room params +func (o *DeleteRoomParams) WithReseller(reseller string) *DeleteRoomParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the delete room params +func (o *DeleteRoomParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithRoomNumber adds the roomNumber to the delete room params +func (o *DeleteRoomParams) WithRoomNumber(roomNumber string) *DeleteRoomParams { + o.SetRoomNumber(roomNumber) + return o +} + +// SetRoomNumber adds the roomNumber to the delete room params +func (o *DeleteRoomParams) SetRoomNumber(roomNumber string) { + o.RoomNumber = roomNumber +} + +// WithState adds the state to the delete room params +func (o *DeleteRoomParams) WithState(state string) *DeleteRoomParams { + o.SetState(state) + return o +} + +// SetState adds the state to the delete room params +func (o *DeleteRoomParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the delete room params +func (o *DeleteRoomParams) WithUser(user string) *DeleteRoomParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the delete room params +func (o *DeleteRoomParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteRoomParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param roomNumber + qrRoomNumber := o.RoomNumber + qRoomNumber := qrRoomNumber + if qRoomNumber != "" { + if err := r.SetQueryParam("roomNumber", qRoomNumber); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/rooms/delete_room_responses.go b/api/metrc-gw/metrc_gw_client/rooms/delete_room_responses.go new file mode 100644 index 0000000..fb8d7cf --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/delete_room_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// DeleteRoomReader is a Reader for the DeleteRoom structure. +type DeleteRoomReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteRoomReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteRoomOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteRoomUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteRoomForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteRoomNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteRoomInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteRoomOK creates a DeleteRoomOK with default headers values +func NewDeleteRoomOK() *DeleteRoomOK { + return &DeleteRoomOK{} +} + +/*DeleteRoomOK handles this case with default header values. + +Rooms were successfully deleted +*/ +type DeleteRoomOK struct { + Payload *metrc_gw_models.RoomResponse +} + +func (o *DeleteRoomOK) Error() string { + return fmt.Sprintf("[DELETE /rooms][%d] deleteRoomOK %+v", 200, o.Payload) +} + +func (o *DeleteRoomOK) GetPayload() *metrc_gw_models.RoomResponse { + return o.Payload +} + +func (o *DeleteRoomOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.RoomResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRoomUnauthorized creates a DeleteRoomUnauthorized with default headers values +func NewDeleteRoomUnauthorized() *DeleteRoomUnauthorized { + return &DeleteRoomUnauthorized{} +} + +/*DeleteRoomUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteRoomUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteRoomUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /rooms][%d] deleteRoomUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteRoomUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteRoomUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRoomForbidden creates a DeleteRoomForbidden with default headers values +func NewDeleteRoomForbidden() *DeleteRoomForbidden { + return &DeleteRoomForbidden{} +} + +/*DeleteRoomForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteRoomForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteRoomForbidden) Error() string { + return fmt.Sprintf("[DELETE /rooms][%d] deleteRoomForbidden %+v", 403, o.Payload) +} + +func (o *DeleteRoomForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteRoomForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRoomNotFound creates a DeleteRoomNotFound with default headers values +func NewDeleteRoomNotFound() *DeleteRoomNotFound { + return &DeleteRoomNotFound{} +} + +/*DeleteRoomNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteRoomNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteRoomNotFound) Error() string { + return fmt.Sprintf("[DELETE /rooms][%d] deleteRoomNotFound %+v", 404, o.Payload) +} + +func (o *DeleteRoomNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteRoomNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRoomInternalServerError creates a DeleteRoomInternalServerError with default headers values +func NewDeleteRoomInternalServerError() *DeleteRoomInternalServerError { + return &DeleteRoomInternalServerError{} +} + +/*DeleteRoomInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteRoomInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteRoomInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /rooms][%d] deleteRoomInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteRoomInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteRoomInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/rooms/get_rooms_parameters.go b/api/metrc-gw/metrc_gw_client/rooms/get_rooms_parameters.go new file mode 100644 index 0000000..a217daa --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/get_rooms_parameters.go @@ -0,0 +1,315 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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" +) + +// NewGetRoomsParams creates a new GetRoomsParams object +// with the default values initialized. +func NewGetRoomsParams() *GetRoomsParams { + var () + return &GetRoomsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRoomsParamsWithTimeout creates a new GetRoomsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRoomsParamsWithTimeout(timeout time.Duration) *GetRoomsParams { + var () + return &GetRoomsParams{ + + timeout: timeout, + } +} + +// NewGetRoomsParamsWithContext creates a new GetRoomsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRoomsParamsWithContext(ctx context.Context) *GetRoomsParams { + var () + return &GetRoomsParams{ + + Context: ctx, + } +} + +// NewGetRoomsParamsWithHTTPClient creates a new GetRoomsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRoomsParamsWithHTTPClient(client *http.Client) *GetRoomsParams { + var () + return &GetRoomsParams{ + HTTPClient: client, + } +} + +/*GetRoomsParams contains all the parameters to send to the API endpoint +for the get rooms operation typically these are written to a http.Request +*/ +type GetRoomsParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*ItemID + The Item Number + + */ + ItemID *float64 + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get rooms params +func (o *GetRoomsParams) WithTimeout(timeout time.Duration) *GetRoomsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get rooms params +func (o *GetRoomsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get rooms params +func (o *GetRoomsParams) WithContext(ctx context.Context) *GetRoomsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get rooms params +func (o *GetRoomsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get rooms params +func (o *GetRoomsParams) WithHTTPClient(client *http.Client) *GetRoomsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get rooms params +func (o *GetRoomsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get rooms params +func (o *GetRoomsParams) WithActive(active *bool) *GetRoomsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get rooms params +func (o *GetRoomsParams) SetActive(active *bool) { + o.Active = active +} + +// WithItemID adds the itemID to the get rooms params +func (o *GetRoomsParams) WithItemID(itemID *float64) *GetRoomsParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get rooms params +func (o *GetRoomsParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the get rooms params +func (o *GetRoomsParams) WithLicense(license string) *GetRoomsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get rooms params +func (o *GetRoomsParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get rooms params +func (o *GetRoomsParams) WithProduction(production *bool) *GetRoomsParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get rooms params +func (o *GetRoomsParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get rooms params +func (o *GetRoomsParams) WithReseller(reseller string) *GetRoomsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get rooms params +func (o *GetRoomsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get rooms params +func (o *GetRoomsParams) WithState(state string) *GetRoomsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get rooms params +func (o *GetRoomsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get rooms params +func (o *GetRoomsParams) WithUser(user string) *GetRoomsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get rooms params +func (o *GetRoomsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRoomsParams) 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.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/rooms/get_rooms_responses.go b/api/metrc-gw/metrc_gw_client/rooms/get_rooms_responses.go new file mode 100644 index 0000000..f0c32db --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/get_rooms_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetRoomsReader is a Reader for the GetRooms structure. +type GetRoomsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRoomsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRoomsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRoomsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRoomsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRoomsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRoomsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRoomsOK creates a GetRoomsOK with default headers values +func NewGetRoomsOK() *GetRoomsOK { + return &GetRoomsOK{} +} + +/*GetRoomsOK handles this case with default header values. + +Rooms were successfully retrieved +*/ +type GetRoomsOK struct { + Payload *metrc_gw_models.RoomResponse +} + +func (o *GetRoomsOK) Error() string { + return fmt.Sprintf("[GET /rooms][%d] getRoomsOK %+v", 200, o.Payload) +} + +func (o *GetRoomsOK) GetPayload() *metrc_gw_models.RoomResponse { + return o.Payload +} + +func (o *GetRoomsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.RoomResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRoomsUnauthorized creates a GetRoomsUnauthorized with default headers values +func NewGetRoomsUnauthorized() *GetRoomsUnauthorized { + return &GetRoomsUnauthorized{} +} + +/*GetRoomsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRoomsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetRoomsUnauthorized) Error() string { + return fmt.Sprintf("[GET /rooms][%d] getRoomsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRoomsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetRoomsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRoomsForbidden creates a GetRoomsForbidden with default headers values +func NewGetRoomsForbidden() *GetRoomsForbidden { + return &GetRoomsForbidden{} +} + +/*GetRoomsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRoomsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetRoomsForbidden) Error() string { + return fmt.Sprintf("[GET /rooms][%d] getRoomsForbidden %+v", 403, o.Payload) +} + +func (o *GetRoomsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetRoomsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRoomsNotFound creates a GetRoomsNotFound with default headers values +func NewGetRoomsNotFound() *GetRoomsNotFound { + return &GetRoomsNotFound{} +} + +/*GetRoomsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRoomsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetRoomsNotFound) Error() string { + return fmt.Sprintf("[GET /rooms][%d] getRoomsNotFound %+v", 404, o.Payload) +} + +func (o *GetRoomsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetRoomsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRoomsInternalServerError creates a GetRoomsInternalServerError with default headers values +func NewGetRoomsInternalServerError() *GetRoomsInternalServerError { + return &GetRoomsInternalServerError{} +} + +/*GetRoomsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRoomsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetRoomsInternalServerError) Error() string { + return fmt.Sprintf("[GET /rooms][%d] getRoomsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRoomsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetRoomsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/rooms/post_rooms_parameters.go b/api/metrc-gw/metrc_gw_client/rooms/post_rooms_parameters.go new file mode 100644 index 0000000..1940929 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/post_rooms_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostRoomsParams creates a new PostRoomsParams object +// with the default values initialized. +func NewPostRoomsParams() *PostRoomsParams { + var () + return &PostRoomsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostRoomsParamsWithTimeout creates a new PostRoomsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostRoomsParamsWithTimeout(timeout time.Duration) *PostRoomsParams { + var () + return &PostRoomsParams{ + + timeout: timeout, + } +} + +// NewPostRoomsParamsWithContext creates a new PostRoomsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostRoomsParamsWithContext(ctx context.Context) *PostRoomsParams { + var () + return &PostRoomsParams{ + + Context: ctx, + } +} + +// NewPostRoomsParamsWithHTTPClient creates a new PostRoomsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostRoomsParamsWithHTTPClient(client *http.Client) *PostRoomsParams { + var () + return &PostRoomsParams{ + HTTPClient: client, + } +} + +/*PostRoomsParams contains all the parameters to send to the API endpoint +for the post rooms operation typically these are written to a http.Request +*/ +type PostRoomsParams struct { + + /*RoomRequest + The New Rooms + + */ + RoomRequest *metrc_gw_models.RoomRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post rooms params +func (o *PostRoomsParams) WithTimeout(timeout time.Duration) *PostRoomsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post rooms params +func (o *PostRoomsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post rooms params +func (o *PostRoomsParams) WithContext(ctx context.Context) *PostRoomsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post rooms params +func (o *PostRoomsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post rooms params +func (o *PostRoomsParams) WithHTTPClient(client *http.Client) *PostRoomsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post rooms params +func (o *PostRoomsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRoomRequest adds the roomRequest to the post rooms params +func (o *PostRoomsParams) WithRoomRequest(roomRequest *metrc_gw_models.RoomRequest) *PostRoomsParams { + o.SetRoomRequest(roomRequest) + return o +} + +// SetRoomRequest adds the roomRequest to the post rooms params +func (o *PostRoomsParams) SetRoomRequest(roomRequest *metrc_gw_models.RoomRequest) { + o.RoomRequest = roomRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostRoomsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RoomRequest != nil { + if err := r.SetBodyParam(o.RoomRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/rooms/post_rooms_responses.go b/api/metrc-gw/metrc_gw_client/rooms/post_rooms_responses.go new file mode 100644 index 0000000..f880395 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/post_rooms_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostRoomsReader is a Reader for the PostRooms structure. +type PostRoomsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostRoomsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostRoomsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostRoomsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostRoomsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostRoomsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostRoomsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostRoomsOK creates a PostRoomsOK with default headers values +func NewPostRoomsOK() *PostRoomsOK { + return &PostRoomsOK{} +} + +/*PostRoomsOK handles this case with default header values. + +An array of Room records with the new IDs +*/ +type PostRoomsOK struct { + Payload *metrc_gw_models.RoomResponse +} + +func (o *PostRoomsOK) Error() string { + return fmt.Sprintf("[POST /rooms][%d] postRoomsOK %+v", 200, o.Payload) +} + +func (o *PostRoomsOK) GetPayload() *metrc_gw_models.RoomResponse { + return o.Payload +} + +func (o *PostRoomsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.RoomResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRoomsUnauthorized creates a PostRoomsUnauthorized with default headers values +func NewPostRoomsUnauthorized() *PostRoomsUnauthorized { + return &PostRoomsUnauthorized{} +} + +/*PostRoomsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostRoomsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostRoomsUnauthorized) Error() string { + return fmt.Sprintf("[POST /rooms][%d] postRoomsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostRoomsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostRoomsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRoomsForbidden creates a PostRoomsForbidden with default headers values +func NewPostRoomsForbidden() *PostRoomsForbidden { + return &PostRoomsForbidden{} +} + +/*PostRoomsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostRoomsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostRoomsForbidden) Error() string { + return fmt.Sprintf("[POST /rooms][%d] postRoomsForbidden %+v", 403, o.Payload) +} + +func (o *PostRoomsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostRoomsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRoomsNotFound creates a PostRoomsNotFound with default headers values +func NewPostRoomsNotFound() *PostRoomsNotFound { + return &PostRoomsNotFound{} +} + +/*PostRoomsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostRoomsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostRoomsNotFound) Error() string { + return fmt.Sprintf("[POST /rooms][%d] postRoomsNotFound %+v", 404, o.Payload) +} + +func (o *PostRoomsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostRoomsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRoomsInternalServerError creates a PostRoomsInternalServerError with default headers values +func NewPostRoomsInternalServerError() *PostRoomsInternalServerError { + return &PostRoomsInternalServerError{} +} + +/*PostRoomsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostRoomsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostRoomsInternalServerError) Error() string { + return fmt.Sprintf("[POST /rooms][%d] postRoomsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostRoomsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostRoomsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/rooms/put_rooms_parameters.go b/api/metrc-gw/metrc_gw_client/rooms/put_rooms_parameters.go new file mode 100644 index 0000000..7f79dd2 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/put_rooms_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutRoomsParams creates a new PutRoomsParams object +// with the default values initialized. +func NewPutRoomsParams() *PutRoomsParams { + var () + return &PutRoomsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutRoomsParamsWithTimeout creates a new PutRoomsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutRoomsParamsWithTimeout(timeout time.Duration) *PutRoomsParams { + var () + return &PutRoomsParams{ + + timeout: timeout, + } +} + +// NewPutRoomsParamsWithContext creates a new PutRoomsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutRoomsParamsWithContext(ctx context.Context) *PutRoomsParams { + var () + return &PutRoomsParams{ + + Context: ctx, + } +} + +// NewPutRoomsParamsWithHTTPClient creates a new PutRoomsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutRoomsParamsWithHTTPClient(client *http.Client) *PutRoomsParams { + var () + return &PutRoomsParams{ + HTTPClient: client, + } +} + +/*PutRoomsParams contains all the parameters to send to the API endpoint +for the put rooms operation typically these are written to a http.Request +*/ +type PutRoomsParams struct { + + /*RoomRequest + The Existing Rooms with Ids + + */ + RoomRequest *metrc_gw_models.RoomRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put rooms params +func (o *PutRoomsParams) WithTimeout(timeout time.Duration) *PutRoomsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put rooms params +func (o *PutRoomsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put rooms params +func (o *PutRoomsParams) WithContext(ctx context.Context) *PutRoomsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put rooms params +func (o *PutRoomsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put rooms params +func (o *PutRoomsParams) WithHTTPClient(client *http.Client) *PutRoomsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put rooms params +func (o *PutRoomsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRoomRequest adds the roomRequest to the put rooms params +func (o *PutRoomsParams) WithRoomRequest(roomRequest *metrc_gw_models.RoomRequest) *PutRoomsParams { + o.SetRoomRequest(roomRequest) + return o +} + +// SetRoomRequest adds the roomRequest to the put rooms params +func (o *PutRoomsParams) SetRoomRequest(roomRequest *metrc_gw_models.RoomRequest) { + o.RoomRequest = roomRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutRoomsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RoomRequest != nil { + if err := r.SetBodyParam(o.RoomRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/rooms/put_rooms_responses.go b/api/metrc-gw/metrc_gw_client/rooms/put_rooms_responses.go new file mode 100644 index 0000000..ba62d65 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/put_rooms_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutRoomsReader is a Reader for the PutRooms structure. +type PutRoomsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutRoomsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutRoomsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutRoomsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutRoomsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutRoomsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutRoomsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutRoomsOK creates a PutRoomsOK with default headers values +func NewPutRoomsOK() *PutRoomsOK { + return &PutRoomsOK{} +} + +/*PutRoomsOK handles this case with default header values. + +An array of Room records +*/ +type PutRoomsOK struct { + Payload *metrc_gw_models.RoomResponse +} + +func (o *PutRoomsOK) Error() string { + return fmt.Sprintf("[PUT /rooms][%d] putRoomsOK %+v", 200, o.Payload) +} + +func (o *PutRoomsOK) GetPayload() *metrc_gw_models.RoomResponse { + return o.Payload +} + +func (o *PutRoomsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.RoomResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRoomsUnauthorized creates a PutRoomsUnauthorized with default headers values +func NewPutRoomsUnauthorized() *PutRoomsUnauthorized { + return &PutRoomsUnauthorized{} +} + +/*PutRoomsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutRoomsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutRoomsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /rooms][%d] putRoomsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutRoomsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutRoomsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRoomsForbidden creates a PutRoomsForbidden with default headers values +func NewPutRoomsForbidden() *PutRoomsForbidden { + return &PutRoomsForbidden{} +} + +/*PutRoomsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutRoomsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutRoomsForbidden) Error() string { + return fmt.Sprintf("[PUT /rooms][%d] putRoomsForbidden %+v", 403, o.Payload) +} + +func (o *PutRoomsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutRoomsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRoomsNotFound creates a PutRoomsNotFound with default headers values +func NewPutRoomsNotFound() *PutRoomsNotFound { + return &PutRoomsNotFound{} +} + +/*PutRoomsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutRoomsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutRoomsNotFound) Error() string { + return fmt.Sprintf("[PUT /rooms][%d] putRoomsNotFound %+v", 404, o.Payload) +} + +func (o *PutRoomsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutRoomsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRoomsInternalServerError creates a PutRoomsInternalServerError with default headers values +func NewPutRoomsInternalServerError() *PutRoomsInternalServerError { + return &PutRoomsInternalServerError{} +} + +/*PutRoomsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutRoomsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutRoomsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /rooms][%d] putRoomsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutRoomsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutRoomsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/rooms/rooms_client.go b/api/metrc-gw/metrc_gw_client/rooms/rooms_client.go new file mode 100644 index 0000000..7e80d67 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/rooms/rooms_client.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rooms + +// 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 rooms API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for rooms API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteRoom(params *DeleteRoomParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRoomOK, error) + + GetRooms(params *GetRoomsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRoomsOK, error) + + PostRooms(params *PostRoomsParams, authInfo runtime.ClientAuthInfoWriter) (*PostRoomsOK, error) + + PutRooms(params *PutRoomsParams, authInfo runtime.ClientAuthInfoWriter) (*PutRoomsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteRoom rooms for this user license + + Delete a Room for this User-License + +*/ +func (a *Client) DeleteRoom(params *DeleteRoomParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRoomOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteRoomParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteRoom", + Method: "DELETE", + PathPattern: "/rooms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteRoomReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteRoomOK) + 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 deleteRoom: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetRooms rooms for this user license + + Get Rooms for this User-License + +*/ +func (a *Client) GetRooms(params *GetRoomsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRoomsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRoomsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRooms", + Method: "GET", + PathPattern: "/rooms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRoomsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRoomsOK) + 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 getRooms: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostRooms creates new rooms + + Create new Rooms +*/ +func (a *Client) PostRooms(params *PostRoomsParams, authInfo runtime.ClientAuthInfoWriter) (*PostRoomsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostRoomsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postRooms", + Method: "POST", + PathPattern: "/rooms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostRoomsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostRoomsOK) + 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 postRooms: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutRooms updates existing rooms + + Update existing Rooms +*/ +func (a *Client) PutRooms(params *PutRoomsParams, authInfo runtime.ClientAuthInfoWriter) (*PutRoomsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutRoomsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putRooms", + Method: "PUT", + PathPattern: "/rooms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutRoomsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutRoomsOK) + 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 putRooms: 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/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_parameters.go b/api/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_parameters.go new file mode 100644 index 0000000..deb2fdd --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_parameters.go @@ -0,0 +1,243 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewDeleteSalesDeliveryParams creates a new DeleteSalesDeliveryParams object +// with the default values initialized. +func NewDeleteSalesDeliveryParams() *DeleteSalesDeliveryParams { + var () + return &DeleteSalesDeliveryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSalesDeliveryParamsWithTimeout creates a new DeleteSalesDeliveryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteSalesDeliveryParamsWithTimeout(timeout time.Duration) *DeleteSalesDeliveryParams { + var () + return &DeleteSalesDeliveryParams{ + + timeout: timeout, + } +} + +// NewDeleteSalesDeliveryParamsWithContext creates a new DeleteSalesDeliveryParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteSalesDeliveryParamsWithContext(ctx context.Context) *DeleteSalesDeliveryParams { + var () + return &DeleteSalesDeliveryParams{ + + Context: ctx, + } +} + +// NewDeleteSalesDeliveryParamsWithHTTPClient creates a new DeleteSalesDeliveryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteSalesDeliveryParamsWithHTTPClient(client *http.Client) *DeleteSalesDeliveryParams { + var () + return &DeleteSalesDeliveryParams{ + HTTPClient: client, + } +} + +/*DeleteSalesDeliveryParams contains all the parameters to send to the API endpoint +for the delete sales delivery operation typically these are written to a http.Request +*/ +type DeleteSalesDeliveryParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*SalesDeliveryID + The Sales Delivery Number + + */ + SalesDeliveryID string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithTimeout(timeout time.Duration) *DeleteSalesDeliveryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithContext(ctx context.Context) *DeleteSalesDeliveryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithHTTPClient(client *http.Client) *DeleteSalesDeliveryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithLicense(license string) *DeleteSalesDeliveryParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithReseller(reseller string) *DeleteSalesDeliveryParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithSalesDeliveryID adds the salesDeliveryID to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithSalesDeliveryID(salesDeliveryID string) *DeleteSalesDeliveryParams { + o.SetSalesDeliveryID(salesDeliveryID) + return o +} + +// SetSalesDeliveryID adds the salesDeliveryId to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetSalesDeliveryID(salesDeliveryID string) { + o.SalesDeliveryID = salesDeliveryID +} + +// WithState adds the state to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithState(state string) *DeleteSalesDeliveryParams { + o.SetState(state) + return o +} + +// SetState adds the state to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) WithUser(user string) *DeleteSalesDeliveryParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the delete sales delivery params +func (o *DeleteSalesDeliveryParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSalesDeliveryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param salesDeliveryId + qrSalesDeliveryID := o.SalesDeliveryID + qSalesDeliveryID := qrSalesDeliveryID + if qSalesDeliveryID != "" { + if err := r.SetQueryParam("salesDeliveryId", qSalesDeliveryID); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_responses.go b/api/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_responses.go new file mode 100644 index 0000000..9630657 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/delete_sales_delivery_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// DeleteSalesDeliveryReader is a Reader for the DeleteSalesDelivery structure. +type DeleteSalesDeliveryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSalesDeliveryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSalesDeliveryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteSalesDeliveryUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteSalesDeliveryForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteSalesDeliveryNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteSalesDeliveryInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteSalesDeliveryOK creates a DeleteSalesDeliveryOK with default headers values +func NewDeleteSalesDeliveryOK() *DeleteSalesDeliveryOK { + return &DeleteSalesDeliveryOK{} +} + +/*DeleteSalesDeliveryOK handles this case with default header values. + +Sales Delivery was successfully deleted +*/ +type DeleteSalesDeliveryOK struct { + Payload *metrc_gw_models.SalesDeliveryResponse +} + +func (o *DeleteSalesDeliveryOK) Error() string { + return fmt.Sprintf("[DELETE /sales/deliveries][%d] deleteSalesDeliveryOK %+v", 200, o.Payload) +} + +func (o *DeleteSalesDeliveryOK) GetPayload() *metrc_gw_models.SalesDeliveryResponse { + return o.Payload +} + +func (o *DeleteSalesDeliveryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesDeliveryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesDeliveryUnauthorized creates a DeleteSalesDeliveryUnauthorized with default headers values +func NewDeleteSalesDeliveryUnauthorized() *DeleteSalesDeliveryUnauthorized { + return &DeleteSalesDeliveryUnauthorized{} +} + +/*DeleteSalesDeliveryUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteSalesDeliveryUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesDeliveryUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /sales/deliveries][%d] deleteSalesDeliveryUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteSalesDeliveryUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesDeliveryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesDeliveryForbidden creates a DeleteSalesDeliveryForbidden with default headers values +func NewDeleteSalesDeliveryForbidden() *DeleteSalesDeliveryForbidden { + return &DeleteSalesDeliveryForbidden{} +} + +/*DeleteSalesDeliveryForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteSalesDeliveryForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesDeliveryForbidden) Error() string { + return fmt.Sprintf("[DELETE /sales/deliveries][%d] deleteSalesDeliveryForbidden %+v", 403, o.Payload) +} + +func (o *DeleteSalesDeliveryForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesDeliveryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesDeliveryNotFound creates a DeleteSalesDeliveryNotFound with default headers values +func NewDeleteSalesDeliveryNotFound() *DeleteSalesDeliveryNotFound { + return &DeleteSalesDeliveryNotFound{} +} + +/*DeleteSalesDeliveryNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteSalesDeliveryNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesDeliveryNotFound) Error() string { + return fmt.Sprintf("[DELETE /sales/deliveries][%d] deleteSalesDeliveryNotFound %+v", 404, o.Payload) +} + +func (o *DeleteSalesDeliveryNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesDeliveryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesDeliveryInternalServerError creates a DeleteSalesDeliveryInternalServerError with default headers values +func NewDeleteSalesDeliveryInternalServerError() *DeleteSalesDeliveryInternalServerError { + return &DeleteSalesDeliveryInternalServerError{} +} + +/*DeleteSalesDeliveryInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteSalesDeliveryInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesDeliveryInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /sales/deliveries][%d] deleteSalesDeliveryInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteSalesDeliveryInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesDeliveryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_parameters.go b/api/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_parameters.go new file mode 100644 index 0000000..be63446 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_parameters.go @@ -0,0 +1,243 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewDeleteSalesReceiptsParams creates a new DeleteSalesReceiptsParams object +// with the default values initialized. +func NewDeleteSalesReceiptsParams() *DeleteSalesReceiptsParams { + var () + return &DeleteSalesReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSalesReceiptsParamsWithTimeout creates a new DeleteSalesReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteSalesReceiptsParamsWithTimeout(timeout time.Duration) *DeleteSalesReceiptsParams { + var () + return &DeleteSalesReceiptsParams{ + + timeout: timeout, + } +} + +// NewDeleteSalesReceiptsParamsWithContext creates a new DeleteSalesReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteSalesReceiptsParamsWithContext(ctx context.Context) *DeleteSalesReceiptsParams { + var () + return &DeleteSalesReceiptsParams{ + + Context: ctx, + } +} + +// NewDeleteSalesReceiptsParamsWithHTTPClient creates a new DeleteSalesReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteSalesReceiptsParamsWithHTTPClient(client *http.Client) *DeleteSalesReceiptsParams { + var () + return &DeleteSalesReceiptsParams{ + HTTPClient: client, + } +} + +/*DeleteSalesReceiptsParams contains all the parameters to send to the API endpoint +for the delete sales receipts operation typically these are written to a http.Request +*/ +type DeleteSalesReceiptsParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*SalesReceiptID + The Sales Receipt Number + + */ + SalesReceiptID string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithTimeout(timeout time.Duration) *DeleteSalesReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithContext(ctx context.Context) *DeleteSalesReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithHTTPClient(client *http.Client) *DeleteSalesReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithLicense(license string) *DeleteSalesReceiptsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithReseller(reseller string) *DeleteSalesReceiptsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithSalesReceiptID adds the salesReceiptID to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithSalesReceiptID(salesReceiptID string) *DeleteSalesReceiptsParams { + o.SetSalesReceiptID(salesReceiptID) + return o +} + +// SetSalesReceiptID adds the salesReceiptId to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetSalesReceiptID(salesReceiptID string) { + o.SalesReceiptID = salesReceiptID +} + +// WithState adds the state to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithState(state string) *DeleteSalesReceiptsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) WithUser(user string) *DeleteSalesReceiptsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the delete sales receipts params +func (o *DeleteSalesReceiptsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSalesReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param salesReceiptId + qrSalesReceiptID := o.SalesReceiptID + qSalesReceiptID := qrSalesReceiptID + if qSalesReceiptID != "" { + if err := r.SetQueryParam("salesReceiptId", qSalesReceiptID); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_responses.go b/api/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_responses.go new file mode 100644 index 0000000..9230f08 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/delete_sales_receipts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// DeleteSalesReceiptsReader is a Reader for the DeleteSalesReceipts structure. +type DeleteSalesReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSalesReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSalesReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteSalesReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteSalesReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteSalesReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteSalesReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteSalesReceiptsOK creates a DeleteSalesReceiptsOK with default headers values +func NewDeleteSalesReceiptsOK() *DeleteSalesReceiptsOK { + return &DeleteSalesReceiptsOK{} +} + +/*DeleteSalesReceiptsOK handles this case with default header values. + +Sales Receipt was successfully deleted +*/ +type DeleteSalesReceiptsOK struct { + Payload *metrc_gw_models.SalesReceiptResponse +} + +func (o *DeleteSalesReceiptsOK) Error() string { + return fmt.Sprintf("[DELETE /sales/receipts][%d] deleteSalesReceiptsOK %+v", 200, o.Payload) +} + +func (o *DeleteSalesReceiptsOK) GetPayload() *metrc_gw_models.SalesReceiptResponse { + return o.Payload +} + +func (o *DeleteSalesReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesReceiptsUnauthorized creates a DeleteSalesReceiptsUnauthorized with default headers values +func NewDeleteSalesReceiptsUnauthorized() *DeleteSalesReceiptsUnauthorized { + return &DeleteSalesReceiptsUnauthorized{} +} + +/*DeleteSalesReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteSalesReceiptsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /sales/receipts][%d] deleteSalesReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteSalesReceiptsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesReceiptsForbidden creates a DeleteSalesReceiptsForbidden with default headers values +func NewDeleteSalesReceiptsForbidden() *DeleteSalesReceiptsForbidden { + return &DeleteSalesReceiptsForbidden{} +} + +/*DeleteSalesReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteSalesReceiptsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesReceiptsForbidden) Error() string { + return fmt.Sprintf("[DELETE /sales/receipts][%d] deleteSalesReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *DeleteSalesReceiptsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesReceiptsNotFound creates a DeleteSalesReceiptsNotFound with default headers values +func NewDeleteSalesReceiptsNotFound() *DeleteSalesReceiptsNotFound { + return &DeleteSalesReceiptsNotFound{} +} + +/*DeleteSalesReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteSalesReceiptsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesReceiptsNotFound) Error() string { + return fmt.Sprintf("[DELETE /sales/receipts][%d] deleteSalesReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *DeleteSalesReceiptsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteSalesReceiptsInternalServerError creates a DeleteSalesReceiptsInternalServerError with default headers values +func NewDeleteSalesReceiptsInternalServerError() *DeleteSalesReceiptsInternalServerError { + return &DeleteSalesReceiptsInternalServerError{} +} + +/*DeleteSalesReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteSalesReceiptsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteSalesReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /sales/receipts][%d] deleteSalesReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteSalesReceiptsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteSalesReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/get_customer_types_parameters.go b/api/metrc-gw/metrc_gw_client/sales/get_customer_types_parameters.go new file mode 100644 index 0000000..3f27722 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_customer_types_parameters.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewGetCustomerTypesParams creates a new GetCustomerTypesParams object +// with the default values initialized. +func NewGetCustomerTypesParams() *GetCustomerTypesParams { + var () + return &GetCustomerTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCustomerTypesParamsWithTimeout creates a new GetCustomerTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCustomerTypesParamsWithTimeout(timeout time.Duration) *GetCustomerTypesParams { + var () + return &GetCustomerTypesParams{ + + timeout: timeout, + } +} + +// NewGetCustomerTypesParamsWithContext creates a new GetCustomerTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCustomerTypesParamsWithContext(ctx context.Context) *GetCustomerTypesParams { + var () + return &GetCustomerTypesParams{ + + Context: ctx, + } +} + +// NewGetCustomerTypesParamsWithHTTPClient creates a new GetCustomerTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCustomerTypesParamsWithHTTPClient(client *http.Client) *GetCustomerTypesParams { + var () + return &GetCustomerTypesParams{ + HTTPClient: client, + } +} + +/*GetCustomerTypesParams contains all the parameters to send to the API endpoint +for the get customer types operation typically these are written to a http.Request +*/ +type GetCustomerTypesParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get customer types params +func (o *GetCustomerTypesParams) WithTimeout(timeout time.Duration) *GetCustomerTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get customer types params +func (o *GetCustomerTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get customer types params +func (o *GetCustomerTypesParams) WithContext(ctx context.Context) *GetCustomerTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get customer types params +func (o *GetCustomerTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get customer types params +func (o *GetCustomerTypesParams) WithHTTPClient(client *http.Client) *GetCustomerTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get customer types params +func (o *GetCustomerTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the get customer types params +func (o *GetCustomerTypesParams) WithLicense(license string) *GetCustomerTypesParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get customer types params +func (o *GetCustomerTypesParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get customer types params +func (o *GetCustomerTypesParams) WithProduction(production *bool) *GetCustomerTypesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get customer types params +func (o *GetCustomerTypesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get customer types params +func (o *GetCustomerTypesParams) WithReseller(reseller string) *GetCustomerTypesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get customer types params +func (o *GetCustomerTypesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get customer types params +func (o *GetCustomerTypesParams) WithState(state string) *GetCustomerTypesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get customer types params +func (o *GetCustomerTypesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get customer types params +func (o *GetCustomerTypesParams) WithUser(user string) *GetCustomerTypesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get customer types params +func (o *GetCustomerTypesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCustomerTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/get_customer_types_responses.go b/api/metrc-gw/metrc_gw_client/sales/get_customer_types_responses.go new file mode 100644 index 0000000..fd07c58 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_customer_types_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetCustomerTypesReader is a Reader for the GetCustomerTypes structure. +type GetCustomerTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCustomerTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCustomerTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCustomerTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCustomerTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCustomerTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCustomerTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCustomerTypesOK creates a GetCustomerTypesOK with default headers values +func NewGetCustomerTypesOK() *GetCustomerTypesOK { + return &GetCustomerTypesOK{} +} + +/*GetCustomerTypesOK handles this case with default header values. + +A list of active Customer Types was succefully retrieved +*/ +type GetCustomerTypesOK struct { + Payload *metrc_gw_models.CustomerTypeResponse +} + +func (o *GetCustomerTypesOK) Error() string { + return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesOK %+v", 200, o.Payload) +} + +func (o *GetCustomerTypesOK) GetPayload() *metrc_gw_models.CustomerTypeResponse { + return o.Payload +} + +func (o *GetCustomerTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.CustomerTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCustomerTypesUnauthorized creates a GetCustomerTypesUnauthorized with default headers values +func NewGetCustomerTypesUnauthorized() *GetCustomerTypesUnauthorized { + return &GetCustomerTypesUnauthorized{} +} + +/*GetCustomerTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCustomerTypesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetCustomerTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCustomerTypesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetCustomerTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCustomerTypesForbidden creates a GetCustomerTypesForbidden with default headers values +func NewGetCustomerTypesForbidden() *GetCustomerTypesForbidden { + return &GetCustomerTypesForbidden{} +} + +/*GetCustomerTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCustomerTypesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetCustomerTypesForbidden) Error() string { + return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetCustomerTypesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetCustomerTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCustomerTypesNotFound creates a GetCustomerTypesNotFound with default headers values +func NewGetCustomerTypesNotFound() *GetCustomerTypesNotFound { + return &GetCustomerTypesNotFound{} +} + +/*GetCustomerTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCustomerTypesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetCustomerTypesNotFound) Error() string { + return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetCustomerTypesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetCustomerTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCustomerTypesInternalServerError creates a GetCustomerTypesInternalServerError with default headers values +func NewGetCustomerTypesInternalServerError() *GetCustomerTypesInternalServerError { + return &GetCustomerTypesInternalServerError{} +} + +/*GetCustomerTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCustomerTypesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetCustomerTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCustomerTypesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetCustomerTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_parameters.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_parameters.go new file mode 100644 index 0000000..a084471 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_parameters.go @@ -0,0 +1,347 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewGetSalesDeliveriesParams creates a new GetSalesDeliveriesParams object +// with the default values initialized. +func NewGetSalesDeliveriesParams() *GetSalesDeliveriesParams { + var () + return &GetSalesDeliveriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSalesDeliveriesParamsWithTimeout creates a new GetSalesDeliveriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSalesDeliveriesParamsWithTimeout(timeout time.Duration) *GetSalesDeliveriesParams { + var () + return &GetSalesDeliveriesParams{ + + timeout: timeout, + } +} + +// NewGetSalesDeliveriesParamsWithContext creates a new GetSalesDeliveriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSalesDeliveriesParamsWithContext(ctx context.Context) *GetSalesDeliveriesParams { + var () + return &GetSalesDeliveriesParams{ + + Context: ctx, + } +} + +// NewGetSalesDeliveriesParamsWithHTTPClient creates a new GetSalesDeliveriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSalesDeliveriesParamsWithHTTPClient(client *http.Client) *GetSalesDeliveriesParams { + var () + return &GetSalesDeliveriesParams{ + HTTPClient: client, + } +} + +/*GetSalesDeliveriesParams contains all the parameters to send to the API endpoint +for the get sales deliveries operation typically these are written to a http.Request +*/ +type GetSalesDeliveriesParams struct { + + /*DeliveryID + The Sales Delivery Number + + */ + DeliveryID *string + /*LastModifiedEnd + The last modified end timestamp + + */ + LastModifiedEnd *string + /*LastModifiedStart + The last modified start timestamp + + */ + LastModifiedStart *string + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithTimeout(timeout time.Duration) *GetSalesDeliveriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithContext(ctx context.Context) *GetSalesDeliveriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithHTTPClient(client *http.Client) *GetSalesDeliveriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDeliveryID adds the deliveryID to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithDeliveryID(deliveryID *string) *GetSalesDeliveriesParams { + o.SetDeliveryID(deliveryID) + return o +} + +// SetDeliveryID adds the deliveryId to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetDeliveryID(deliveryID *string) { + o.DeliveryID = deliveryID +} + +// WithLastModifiedEnd adds the lastModifiedEnd to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithLastModifiedEnd(lastModifiedEnd *string) *GetSalesDeliveriesParams { + o.SetLastModifiedEnd(lastModifiedEnd) + return o +} + +// SetLastModifiedEnd adds the lastModifiedEnd to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetLastModifiedEnd(lastModifiedEnd *string) { + o.LastModifiedEnd = lastModifiedEnd +} + +// WithLastModifiedStart adds the lastModifiedStart to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithLastModifiedStart(lastModifiedStart *string) *GetSalesDeliveriesParams { + o.SetLastModifiedStart(lastModifiedStart) + return o +} + +// SetLastModifiedStart adds the lastModifiedStart to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetLastModifiedStart(lastModifiedStart *string) { + o.LastModifiedStart = lastModifiedStart +} + +// WithLicense adds the license to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithLicense(license string) *GetSalesDeliveriesParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithProduction(production *bool) *GetSalesDeliveriesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithReseller(reseller string) *GetSalesDeliveriesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithState(state string) *GetSalesDeliveriesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get sales deliveries params +func (o *GetSalesDeliveriesParams) WithUser(user string) *GetSalesDeliveriesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get sales deliveries params +func (o *GetSalesDeliveriesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSalesDeliveriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DeliveryID != nil { + + // query param deliveryId + var qrDeliveryID string + if o.DeliveryID != nil { + qrDeliveryID = *o.DeliveryID + } + qDeliveryID := qrDeliveryID + if qDeliveryID != "" { + if err := r.SetQueryParam("deliveryId", qDeliveryID); err != nil { + return err + } + } + + } + + if o.LastModifiedEnd != nil { + + // query param lastModifiedEnd + var qrLastModifiedEnd string + if o.LastModifiedEnd != nil { + qrLastModifiedEnd = *o.LastModifiedEnd + } + qLastModifiedEnd := qrLastModifiedEnd + if qLastModifiedEnd != "" { + if err := r.SetQueryParam("lastModifiedEnd", qLastModifiedEnd); err != nil { + return err + } + } + + } + + if o.LastModifiedStart != nil { + + // query param lastModifiedStart + var qrLastModifiedStart string + if o.LastModifiedStart != nil { + qrLastModifiedStart = *o.LastModifiedStart + } + qLastModifiedStart := qrLastModifiedStart + if qLastModifiedStart != "" { + if err := r.SetQueryParam("lastModifiedStart", qLastModifiedStart); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_responses.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_responses.go new file mode 100644 index 0000000..224dd8d --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_deliveries_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetSalesDeliveriesReader is a Reader for the GetSalesDeliveries structure. +type GetSalesDeliveriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSalesDeliveriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSalesDeliveriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSalesDeliveriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSalesDeliveriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSalesDeliveriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSalesDeliveriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSalesDeliveriesOK creates a GetSalesDeliveriesOK with default headers values +func NewGetSalesDeliveriesOK() *GetSalesDeliveriesOK { + return &GetSalesDeliveriesOK{} +} + +/*GetSalesDeliveriesOK handles this case with default header values. + +A list of Deliveries was succefully retrieved +*/ +type GetSalesDeliveriesOK struct { + Payload *metrc_gw_models.SalesDeliveryResponse +} + +func (o *GetSalesDeliveriesOK) Error() string { + return fmt.Sprintf("[GET /sales/deliveries][%d] getSalesDeliveriesOK %+v", 200, o.Payload) +} + +func (o *GetSalesDeliveriesOK) GetPayload() *metrc_gw_models.SalesDeliveryResponse { + return o.Payload +} + +func (o *GetSalesDeliveriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesDeliveryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveriesUnauthorized creates a GetSalesDeliveriesUnauthorized with default headers values +func NewGetSalesDeliveriesUnauthorized() *GetSalesDeliveriesUnauthorized { + return &GetSalesDeliveriesUnauthorized{} +} + +/*GetSalesDeliveriesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetSalesDeliveriesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveriesUnauthorized) Error() string { + return fmt.Sprintf("[GET /sales/deliveries][%d] getSalesDeliveriesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSalesDeliveriesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveriesForbidden creates a GetSalesDeliveriesForbidden with default headers values +func NewGetSalesDeliveriesForbidden() *GetSalesDeliveriesForbidden { + return &GetSalesDeliveriesForbidden{} +} + +/*GetSalesDeliveriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSalesDeliveriesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveriesForbidden) Error() string { + return fmt.Sprintf("[GET /sales/deliveries][%d] getSalesDeliveriesForbidden %+v", 403, o.Payload) +} + +func (o *GetSalesDeliveriesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveriesNotFound creates a GetSalesDeliveriesNotFound with default headers values +func NewGetSalesDeliveriesNotFound() *GetSalesDeliveriesNotFound { + return &GetSalesDeliveriesNotFound{} +} + +/*GetSalesDeliveriesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSalesDeliveriesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveriesNotFound) Error() string { + return fmt.Sprintf("[GET /sales/deliveries][%d] getSalesDeliveriesNotFound %+v", 404, o.Payload) +} + +func (o *GetSalesDeliveriesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveriesInternalServerError creates a GetSalesDeliveriesInternalServerError with default headers values +func NewGetSalesDeliveriesInternalServerError() *GetSalesDeliveriesInternalServerError { + return &GetSalesDeliveriesInternalServerError{} +} + +/*GetSalesDeliveriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSalesDeliveriesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveriesInternalServerError) Error() string { + return fmt.Sprintf("[GET /sales/deliveries][%d] getSalesDeliveriesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSalesDeliveriesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_parameters.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_parameters.go new file mode 100644 index 0000000..e1d216e --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_parameters.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewGetSalesDeliveryReturnReasonsParams creates a new GetSalesDeliveryReturnReasonsParams object +// with the default values initialized. +func NewGetSalesDeliveryReturnReasonsParams() *GetSalesDeliveryReturnReasonsParams { + var () + return &GetSalesDeliveryReturnReasonsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSalesDeliveryReturnReasonsParamsWithTimeout creates a new GetSalesDeliveryReturnReasonsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSalesDeliveryReturnReasonsParamsWithTimeout(timeout time.Duration) *GetSalesDeliveryReturnReasonsParams { + var () + return &GetSalesDeliveryReturnReasonsParams{ + + timeout: timeout, + } +} + +// NewGetSalesDeliveryReturnReasonsParamsWithContext creates a new GetSalesDeliveryReturnReasonsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSalesDeliveryReturnReasonsParamsWithContext(ctx context.Context) *GetSalesDeliveryReturnReasonsParams { + var () + return &GetSalesDeliveryReturnReasonsParams{ + + Context: ctx, + } +} + +// NewGetSalesDeliveryReturnReasonsParamsWithHTTPClient creates a new GetSalesDeliveryReturnReasonsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSalesDeliveryReturnReasonsParamsWithHTTPClient(client *http.Client) *GetSalesDeliveryReturnReasonsParams { + var () + return &GetSalesDeliveryReturnReasonsParams{ + HTTPClient: client, + } +} + +/*GetSalesDeliveryReturnReasonsParams contains all the parameters to send to the API endpoint +for the get sales delivery return reasons operation typically these are written to a http.Request +*/ +type GetSalesDeliveryReturnReasonsParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithTimeout(timeout time.Duration) *GetSalesDeliveryReturnReasonsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithContext(ctx context.Context) *GetSalesDeliveryReturnReasonsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithHTTPClient(client *http.Client) *GetSalesDeliveryReturnReasonsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithLicense(license string) *GetSalesDeliveryReturnReasonsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithProduction(production *bool) *GetSalesDeliveryReturnReasonsParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithReseller(reseller string) *GetSalesDeliveryReturnReasonsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithState(state string) *GetSalesDeliveryReturnReasonsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) WithUser(user string) *GetSalesDeliveryReturnReasonsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get sales delivery return reasons params +func (o *GetSalesDeliveryReturnReasonsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSalesDeliveryReturnReasonsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_responses.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_responses.go new file mode 100644 index 0000000..eb371cf --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_delivery_return_reasons_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetSalesDeliveryReturnReasonsReader is a Reader for the GetSalesDeliveryReturnReasons structure. +type GetSalesDeliveryReturnReasonsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSalesDeliveryReturnReasonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSalesDeliveryReturnReasonsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSalesDeliveryReturnReasonsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSalesDeliveryReturnReasonsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSalesDeliveryReturnReasonsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSalesDeliveryReturnReasonsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSalesDeliveryReturnReasonsOK creates a GetSalesDeliveryReturnReasonsOK with default headers values +func NewGetSalesDeliveryReturnReasonsOK() *GetSalesDeliveryReturnReasonsOK { + return &GetSalesDeliveryReturnReasonsOK{} +} + +/*GetSalesDeliveryReturnReasonsOK handles this case with default header values. + +A list of active Sales Delivery Return Reasons was succefully retrieved +*/ +type GetSalesDeliveryReturnReasonsOK struct { + Payload *metrc_gw_models.SalesDeliveryReturnReasonResponse +} + +func (o *GetSalesDeliveryReturnReasonsOK) Error() string { + return fmt.Sprintf("[GET /sales/deliveries/returnreasons][%d] getSalesDeliveryReturnReasonsOK %+v", 200, o.Payload) +} + +func (o *GetSalesDeliveryReturnReasonsOK) GetPayload() *metrc_gw_models.SalesDeliveryReturnReasonResponse { + return o.Payload +} + +func (o *GetSalesDeliveryReturnReasonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesDeliveryReturnReasonResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveryReturnReasonsUnauthorized creates a GetSalesDeliveryReturnReasonsUnauthorized with default headers values +func NewGetSalesDeliveryReturnReasonsUnauthorized() *GetSalesDeliveryReturnReasonsUnauthorized { + return &GetSalesDeliveryReturnReasonsUnauthorized{} +} + +/*GetSalesDeliveryReturnReasonsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetSalesDeliveryReturnReasonsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveryReturnReasonsUnauthorized) Error() string { + return fmt.Sprintf("[GET /sales/deliveries/returnreasons][%d] getSalesDeliveryReturnReasonsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSalesDeliveryReturnReasonsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveryReturnReasonsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveryReturnReasonsForbidden creates a GetSalesDeliveryReturnReasonsForbidden with default headers values +func NewGetSalesDeliveryReturnReasonsForbidden() *GetSalesDeliveryReturnReasonsForbidden { + return &GetSalesDeliveryReturnReasonsForbidden{} +} + +/*GetSalesDeliveryReturnReasonsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSalesDeliveryReturnReasonsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveryReturnReasonsForbidden) Error() string { + return fmt.Sprintf("[GET /sales/deliveries/returnreasons][%d] getSalesDeliveryReturnReasonsForbidden %+v", 403, o.Payload) +} + +func (o *GetSalesDeliveryReturnReasonsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveryReturnReasonsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveryReturnReasonsNotFound creates a GetSalesDeliveryReturnReasonsNotFound with default headers values +func NewGetSalesDeliveryReturnReasonsNotFound() *GetSalesDeliveryReturnReasonsNotFound { + return &GetSalesDeliveryReturnReasonsNotFound{} +} + +/*GetSalesDeliveryReturnReasonsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSalesDeliveryReturnReasonsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveryReturnReasonsNotFound) Error() string { + return fmt.Sprintf("[GET /sales/deliveries/returnreasons][%d] getSalesDeliveryReturnReasonsNotFound %+v", 404, o.Payload) +} + +func (o *GetSalesDeliveryReturnReasonsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveryReturnReasonsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesDeliveryReturnReasonsInternalServerError creates a GetSalesDeliveryReturnReasonsInternalServerError with default headers values +func NewGetSalesDeliveryReturnReasonsInternalServerError() *GetSalesDeliveryReturnReasonsInternalServerError { + return &GetSalesDeliveryReturnReasonsInternalServerError{} +} + +/*GetSalesDeliveryReturnReasonsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSalesDeliveryReturnReasonsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesDeliveryReturnReasonsInternalServerError) Error() string { + return fmt.Sprintf("[GET /sales/deliveries/returnreasons][%d] getSalesDeliveryReturnReasonsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSalesDeliveryReturnReasonsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesDeliveryReturnReasonsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/get_sales_receipts_parameters.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_receipts_parameters.go new file mode 100644 index 0000000..e84b68b --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_receipts_parameters.go @@ -0,0 +1,347 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewGetSalesReceiptsParams creates a new GetSalesReceiptsParams object +// with the default values initialized. +func NewGetSalesReceiptsParams() *GetSalesReceiptsParams { + var () + return &GetSalesReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSalesReceiptsParamsWithTimeout creates a new GetSalesReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSalesReceiptsParamsWithTimeout(timeout time.Duration) *GetSalesReceiptsParams { + var () + return &GetSalesReceiptsParams{ + + timeout: timeout, + } +} + +// NewGetSalesReceiptsParamsWithContext creates a new GetSalesReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSalesReceiptsParamsWithContext(ctx context.Context) *GetSalesReceiptsParams { + var () + return &GetSalesReceiptsParams{ + + Context: ctx, + } +} + +// NewGetSalesReceiptsParamsWithHTTPClient creates a new GetSalesReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSalesReceiptsParamsWithHTTPClient(client *http.Client) *GetSalesReceiptsParams { + var () + return &GetSalesReceiptsParams{ + HTTPClient: client, + } +} + +/*GetSalesReceiptsParams contains all the parameters to send to the API endpoint +for the get sales receipts operation typically these are written to a http.Request +*/ +type GetSalesReceiptsParams struct { + + /*LastModifiedEnd + The last modified end timestamp + + */ + LastModifiedEnd *string + /*LastModifiedStart + The last modified start timestamp + + */ + LastModifiedStart *string + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*SalesReceiptID + The Sales Receipt Number + + */ + SalesReceiptID *string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get sales receipts params +func (o *GetSalesReceiptsParams) WithTimeout(timeout time.Duration) *GetSalesReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sales receipts params +func (o *GetSalesReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sales receipts params +func (o *GetSalesReceiptsParams) WithContext(ctx context.Context) *GetSalesReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sales receipts params +func (o *GetSalesReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sales receipts params +func (o *GetSalesReceiptsParams) WithHTTPClient(client *http.Client) *GetSalesReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sales receipts params +func (o *GetSalesReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLastModifiedEnd adds the lastModifiedEnd to the get sales receipts params +func (o *GetSalesReceiptsParams) WithLastModifiedEnd(lastModifiedEnd *string) *GetSalesReceiptsParams { + o.SetLastModifiedEnd(lastModifiedEnd) + return o +} + +// SetLastModifiedEnd adds the lastModifiedEnd to the get sales receipts params +func (o *GetSalesReceiptsParams) SetLastModifiedEnd(lastModifiedEnd *string) { + o.LastModifiedEnd = lastModifiedEnd +} + +// WithLastModifiedStart adds the lastModifiedStart to the get sales receipts params +func (o *GetSalesReceiptsParams) WithLastModifiedStart(lastModifiedStart *string) *GetSalesReceiptsParams { + o.SetLastModifiedStart(lastModifiedStart) + return o +} + +// SetLastModifiedStart adds the lastModifiedStart to the get sales receipts params +func (o *GetSalesReceiptsParams) SetLastModifiedStart(lastModifiedStart *string) { + o.LastModifiedStart = lastModifiedStart +} + +// WithLicense adds the license to the get sales receipts params +func (o *GetSalesReceiptsParams) WithLicense(license string) *GetSalesReceiptsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get sales receipts params +func (o *GetSalesReceiptsParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get sales receipts params +func (o *GetSalesReceiptsParams) WithProduction(production *bool) *GetSalesReceiptsParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get sales receipts params +func (o *GetSalesReceiptsParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get sales receipts params +func (o *GetSalesReceiptsParams) WithReseller(reseller string) *GetSalesReceiptsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get sales receipts params +func (o *GetSalesReceiptsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithSalesReceiptID adds the salesReceiptID to the get sales receipts params +func (o *GetSalesReceiptsParams) WithSalesReceiptID(salesReceiptID *string) *GetSalesReceiptsParams { + o.SetSalesReceiptID(salesReceiptID) + return o +} + +// SetSalesReceiptID adds the salesReceiptId to the get sales receipts params +func (o *GetSalesReceiptsParams) SetSalesReceiptID(salesReceiptID *string) { + o.SalesReceiptID = salesReceiptID +} + +// WithState adds the state to the get sales receipts params +func (o *GetSalesReceiptsParams) WithState(state string) *GetSalesReceiptsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get sales receipts params +func (o *GetSalesReceiptsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get sales receipts params +func (o *GetSalesReceiptsParams) WithUser(user string) *GetSalesReceiptsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get sales receipts params +func (o *GetSalesReceiptsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSalesReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LastModifiedEnd != nil { + + // query param lastModifiedEnd + var qrLastModifiedEnd string + if o.LastModifiedEnd != nil { + qrLastModifiedEnd = *o.LastModifiedEnd + } + qLastModifiedEnd := qrLastModifiedEnd + if qLastModifiedEnd != "" { + if err := r.SetQueryParam("lastModifiedEnd", qLastModifiedEnd); err != nil { + return err + } + } + + } + + if o.LastModifiedStart != nil { + + // query param lastModifiedStart + var qrLastModifiedStart string + if o.LastModifiedStart != nil { + qrLastModifiedStart = *o.LastModifiedStart + } + qLastModifiedStart := qrLastModifiedStart + if qLastModifiedStart != "" { + if err := r.SetQueryParam("lastModifiedStart", qLastModifiedStart); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + if o.SalesReceiptID != nil { + + // query param salesReceiptId + var qrSalesReceiptID string + if o.SalesReceiptID != nil { + qrSalesReceiptID = *o.SalesReceiptID + } + qSalesReceiptID := qrSalesReceiptID + if qSalesReceiptID != "" { + if err := r.SetQueryParam("salesReceiptId", qSalesReceiptID); err != nil { + return err + } + } + + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/get_sales_receipts_responses.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_receipts_responses.go new file mode 100644 index 0000000..d8455f9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_receipts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetSalesReceiptsReader is a Reader for the GetSalesReceipts structure. +type GetSalesReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSalesReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSalesReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSalesReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSalesReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSalesReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSalesReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSalesReceiptsOK creates a GetSalesReceiptsOK with default headers values +func NewGetSalesReceiptsOK() *GetSalesReceiptsOK { + return &GetSalesReceiptsOK{} +} + +/*GetSalesReceiptsOK handles this case with default header values. + +A list of active Sales Receipts was succefully retrieved +*/ +type GetSalesReceiptsOK struct { + Payload *metrc_gw_models.SalesReceiptResponse +} + +func (o *GetSalesReceiptsOK) Error() string { + return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsOK %+v", 200, o.Payload) +} + +func (o *GetSalesReceiptsOK) GetPayload() *metrc_gw_models.SalesReceiptResponse { + return o.Payload +} + +func (o *GetSalesReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesReceiptsUnauthorized creates a GetSalesReceiptsUnauthorized with default headers values +func NewGetSalesReceiptsUnauthorized() *GetSalesReceiptsUnauthorized { + return &GetSalesReceiptsUnauthorized{} +} + +/*GetSalesReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetSalesReceiptsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSalesReceiptsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesReceiptsForbidden creates a GetSalesReceiptsForbidden with default headers values +func NewGetSalesReceiptsForbidden() *GetSalesReceiptsForbidden { + return &GetSalesReceiptsForbidden{} +} + +/*GetSalesReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSalesReceiptsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesReceiptsForbidden) Error() string { + return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *GetSalesReceiptsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesReceiptsNotFound creates a GetSalesReceiptsNotFound with default headers values +func NewGetSalesReceiptsNotFound() *GetSalesReceiptsNotFound { + return &GetSalesReceiptsNotFound{} +} + +/*GetSalesReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSalesReceiptsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesReceiptsNotFound) Error() string { + return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *GetSalesReceiptsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesReceiptsInternalServerError creates a GetSalesReceiptsInternalServerError with default headers values +func NewGetSalesReceiptsInternalServerError() *GetSalesReceiptsInternalServerError { + return &GetSalesReceiptsInternalServerError{} +} + +/*GetSalesReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSalesReceiptsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSalesReceiptsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_parameters.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_parameters.go new file mode 100644 index 0000000..08c20b6 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_parameters.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewGetSalesTransactionDatesParams creates a new GetSalesTransactionDatesParams object +// with the default values initialized. +func NewGetSalesTransactionDatesParams() *GetSalesTransactionDatesParams { + var () + return &GetSalesTransactionDatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSalesTransactionDatesParamsWithTimeout creates a new GetSalesTransactionDatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSalesTransactionDatesParamsWithTimeout(timeout time.Duration) *GetSalesTransactionDatesParams { + var () + return &GetSalesTransactionDatesParams{ + + timeout: timeout, + } +} + +// NewGetSalesTransactionDatesParamsWithContext creates a new GetSalesTransactionDatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSalesTransactionDatesParamsWithContext(ctx context.Context) *GetSalesTransactionDatesParams { + var () + return &GetSalesTransactionDatesParams{ + + Context: ctx, + } +} + +// NewGetSalesTransactionDatesParamsWithHTTPClient creates a new GetSalesTransactionDatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSalesTransactionDatesParamsWithHTTPClient(client *http.Client) *GetSalesTransactionDatesParams { + var () + return &GetSalesTransactionDatesParams{ + HTTPClient: client, + } +} + +/*GetSalesTransactionDatesParams contains all the parameters to send to the API endpoint +for the get sales transaction dates operation typically these are written to a http.Request +*/ +type GetSalesTransactionDatesParams struct { + + /*License + The Licnese Number for the query + + */ + License string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithTimeout(timeout time.Duration) *GetSalesTransactionDatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithContext(ctx context.Context) *GetSalesTransactionDatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithHTTPClient(client *http.Client) *GetSalesTransactionDatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicense adds the license to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithLicense(license string) *GetSalesTransactionDatesParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetLicense(license string) { + o.License = license +} + +// WithProduction adds the production to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithProduction(production *bool) *GetSalesTransactionDatesParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithReseller(reseller string) *GetSalesTransactionDatesParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithState(state string) *GetSalesTransactionDatesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) WithUser(user string) *GetSalesTransactionDatesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get sales transaction dates params +func (o *GetSalesTransactionDatesParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSalesTransactionDatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_responses.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_responses.go new file mode 100644 index 0000000..e48641b --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_transaction_dates_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetSalesTransactionDatesReader is a Reader for the GetSalesTransactionDates structure. +type GetSalesTransactionDatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSalesTransactionDatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSalesTransactionDatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSalesTransactionDatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSalesTransactionDatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSalesTransactionDatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSalesTransactionDatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSalesTransactionDatesOK creates a GetSalesTransactionDatesOK with default headers values +func NewGetSalesTransactionDatesOK() *GetSalesTransactionDatesOK { + return &GetSalesTransactionDatesOK{} +} + +/*GetSalesTransactionDatesOK handles this case with default header values. + +A list of Sales Transaction Dates was succefully retrieved +*/ +type GetSalesTransactionDatesOK struct { + Payload *metrc_gw_models.SalesTransactionDateResponse +} + +func (o *GetSalesTransactionDatesOK) Error() string { + return fmt.Sprintf("[GET /sales/transactiondates][%d] getSalesTransactionDatesOK %+v", 200, o.Payload) +} + +func (o *GetSalesTransactionDatesOK) GetPayload() *metrc_gw_models.SalesTransactionDateResponse { + return o.Payload +} + +func (o *GetSalesTransactionDatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesTransactionDateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionDatesUnauthorized creates a GetSalesTransactionDatesUnauthorized with default headers values +func NewGetSalesTransactionDatesUnauthorized() *GetSalesTransactionDatesUnauthorized { + return &GetSalesTransactionDatesUnauthorized{} +} + +/*GetSalesTransactionDatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetSalesTransactionDatesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionDatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /sales/transactiondates][%d] getSalesTransactionDatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSalesTransactionDatesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionDatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionDatesForbidden creates a GetSalesTransactionDatesForbidden with default headers values +func NewGetSalesTransactionDatesForbidden() *GetSalesTransactionDatesForbidden { + return &GetSalesTransactionDatesForbidden{} +} + +/*GetSalesTransactionDatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSalesTransactionDatesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionDatesForbidden) Error() string { + return fmt.Sprintf("[GET /sales/transactiondates][%d] getSalesTransactionDatesForbidden %+v", 403, o.Payload) +} + +func (o *GetSalesTransactionDatesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionDatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionDatesNotFound creates a GetSalesTransactionDatesNotFound with default headers values +func NewGetSalesTransactionDatesNotFound() *GetSalesTransactionDatesNotFound { + return &GetSalesTransactionDatesNotFound{} +} + +/*GetSalesTransactionDatesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSalesTransactionDatesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionDatesNotFound) Error() string { + return fmt.Sprintf("[GET /sales/transactiondates][%d] getSalesTransactionDatesNotFound %+v", 404, o.Payload) +} + +func (o *GetSalesTransactionDatesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionDatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionDatesInternalServerError creates a GetSalesTransactionDatesInternalServerError with default headers values +func NewGetSalesTransactionDatesInternalServerError() *GetSalesTransactionDatesInternalServerError { + return &GetSalesTransactionDatesInternalServerError{} +} + +/*GetSalesTransactionDatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSalesTransactionDatesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionDatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /sales/transactiondates][%d] getSalesTransactionDatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSalesTransactionDatesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionDatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/get_sales_transactions_parameters.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_transactions_parameters.go new file mode 100644 index 0000000..00fa09f --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_transactions_parameters.go @@ -0,0 +1,314 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" +) + +// NewGetSalesTransactionsParams creates a new GetSalesTransactionsParams object +// with the default values initialized. +func NewGetSalesTransactionsParams() *GetSalesTransactionsParams { + var () + return &GetSalesTransactionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSalesTransactionsParamsWithTimeout creates a new GetSalesTransactionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSalesTransactionsParamsWithTimeout(timeout time.Duration) *GetSalesTransactionsParams { + var () + return &GetSalesTransactionsParams{ + + timeout: timeout, + } +} + +// NewGetSalesTransactionsParamsWithContext creates a new GetSalesTransactionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSalesTransactionsParamsWithContext(ctx context.Context) *GetSalesTransactionsParams { + var () + return &GetSalesTransactionsParams{ + + Context: ctx, + } +} + +// NewGetSalesTransactionsParamsWithHTTPClient creates a new GetSalesTransactionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSalesTransactionsParamsWithHTTPClient(client *http.Client) *GetSalesTransactionsParams { + var () + return &GetSalesTransactionsParams{ + HTTPClient: client, + } +} + +/*GetSalesTransactionsParams contains all the parameters to send to the API endpoint +for the get sales transactions operation typically these are written to a http.Request +*/ +type GetSalesTransactionsParams struct { + + /*LastModifiedEnd + The last modified end timestamp + + */ + LastModifiedEnd *string + /*LastModifiedStart + The last modified start timestamp + + */ + LastModifiedStart *string + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*SalesReceiptID + The Sales Receipt Number + + */ + SalesReceiptID *string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get sales transactions params +func (o *GetSalesTransactionsParams) WithTimeout(timeout time.Duration) *GetSalesTransactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sales transactions params +func (o *GetSalesTransactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sales transactions params +func (o *GetSalesTransactionsParams) WithContext(ctx context.Context) *GetSalesTransactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sales transactions params +func (o *GetSalesTransactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sales transactions params +func (o *GetSalesTransactionsParams) WithHTTPClient(client *http.Client) *GetSalesTransactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sales transactions params +func (o *GetSalesTransactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLastModifiedEnd adds the lastModifiedEnd to the get sales transactions params +func (o *GetSalesTransactionsParams) WithLastModifiedEnd(lastModifiedEnd *string) *GetSalesTransactionsParams { + o.SetLastModifiedEnd(lastModifiedEnd) + return o +} + +// SetLastModifiedEnd adds the lastModifiedEnd to the get sales transactions params +func (o *GetSalesTransactionsParams) SetLastModifiedEnd(lastModifiedEnd *string) { + o.LastModifiedEnd = lastModifiedEnd +} + +// WithLastModifiedStart adds the lastModifiedStart to the get sales transactions params +func (o *GetSalesTransactionsParams) WithLastModifiedStart(lastModifiedStart *string) *GetSalesTransactionsParams { + o.SetLastModifiedStart(lastModifiedStart) + return o +} + +// SetLastModifiedStart adds the lastModifiedStart to the get sales transactions params +func (o *GetSalesTransactionsParams) SetLastModifiedStart(lastModifiedStart *string) { + o.LastModifiedStart = lastModifiedStart +} + +// WithLicense adds the license to the get sales transactions params +func (o *GetSalesTransactionsParams) WithLicense(license string) *GetSalesTransactionsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get sales transactions params +func (o *GetSalesTransactionsParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the get sales transactions params +func (o *GetSalesTransactionsParams) WithReseller(reseller string) *GetSalesTransactionsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get sales transactions params +func (o *GetSalesTransactionsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithSalesReceiptID adds the salesReceiptID to the get sales transactions params +func (o *GetSalesTransactionsParams) WithSalesReceiptID(salesReceiptID *string) *GetSalesTransactionsParams { + o.SetSalesReceiptID(salesReceiptID) + return o +} + +// SetSalesReceiptID adds the salesReceiptId to the get sales transactions params +func (o *GetSalesTransactionsParams) SetSalesReceiptID(salesReceiptID *string) { + o.SalesReceiptID = salesReceiptID +} + +// WithState adds the state to the get sales transactions params +func (o *GetSalesTransactionsParams) WithState(state string) *GetSalesTransactionsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get sales transactions params +func (o *GetSalesTransactionsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get sales transactions params +func (o *GetSalesTransactionsParams) WithUser(user string) *GetSalesTransactionsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get sales transactions params +func (o *GetSalesTransactionsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSalesTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LastModifiedEnd != nil { + + // query param lastModifiedEnd + var qrLastModifiedEnd string + if o.LastModifiedEnd != nil { + qrLastModifiedEnd = *o.LastModifiedEnd + } + qLastModifiedEnd := qrLastModifiedEnd + if qLastModifiedEnd != "" { + if err := r.SetQueryParam("lastModifiedEnd", qLastModifiedEnd); err != nil { + return err + } + } + + } + + if o.LastModifiedStart != nil { + + // query param lastModifiedStart + var qrLastModifiedStart string + if o.LastModifiedStart != nil { + qrLastModifiedStart = *o.LastModifiedStart + } + qLastModifiedStart := qrLastModifiedStart + if qLastModifiedStart != "" { + if err := r.SetQueryParam("lastModifiedStart", qLastModifiedStart); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + if o.SalesReceiptID != nil { + + // query param salesReceiptId + var qrSalesReceiptID string + if o.SalesReceiptID != nil { + qrSalesReceiptID = *o.SalesReceiptID + } + qSalesReceiptID := qrSalesReceiptID + if qSalesReceiptID != "" { + if err := r.SetQueryParam("salesReceiptId", qSalesReceiptID); err != nil { + return err + } + } + + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/get_sales_transactions_responses.go b/api/metrc-gw/metrc_gw_client/sales/get_sales_transactions_responses.go new file mode 100644 index 0000000..469d658 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/get_sales_transactions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetSalesTransactionsReader is a Reader for the GetSalesTransactions structure. +type GetSalesTransactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSalesTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSalesTransactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSalesTransactionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSalesTransactionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSalesTransactionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSalesTransactionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSalesTransactionsOK creates a GetSalesTransactionsOK with default headers values +func NewGetSalesTransactionsOK() *GetSalesTransactionsOK { + return &GetSalesTransactionsOK{} +} + +/*GetSalesTransactionsOK handles this case with default header values. + +A list of active Sales Receipts was succefully retrieved +*/ +type GetSalesTransactionsOK struct { + Payload *metrc_gw_models.TransactionResponse +} + +func (o *GetSalesTransactionsOK) Error() string { + return fmt.Sprintf("[GET /sales/transactions][%d] getSalesTransactionsOK %+v", 200, o.Payload) +} + +func (o *GetSalesTransactionsOK) GetPayload() *metrc_gw_models.TransactionResponse { + return o.Payload +} + +func (o *GetSalesTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.TransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionsUnauthorized creates a GetSalesTransactionsUnauthorized with default headers values +func NewGetSalesTransactionsUnauthorized() *GetSalesTransactionsUnauthorized { + return &GetSalesTransactionsUnauthorized{} +} + +/*GetSalesTransactionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetSalesTransactionsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionsUnauthorized) Error() string { + return fmt.Sprintf("[GET /sales/transactions][%d] getSalesTransactionsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSalesTransactionsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionsForbidden creates a GetSalesTransactionsForbidden with default headers values +func NewGetSalesTransactionsForbidden() *GetSalesTransactionsForbidden { + return &GetSalesTransactionsForbidden{} +} + +/*GetSalesTransactionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSalesTransactionsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionsForbidden) Error() string { + return fmt.Sprintf("[GET /sales/transactions][%d] getSalesTransactionsForbidden %+v", 403, o.Payload) +} + +func (o *GetSalesTransactionsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionsNotFound creates a GetSalesTransactionsNotFound with default headers values +func NewGetSalesTransactionsNotFound() *GetSalesTransactionsNotFound { + return &GetSalesTransactionsNotFound{} +} + +/*GetSalesTransactionsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSalesTransactionsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionsNotFound) Error() string { + return fmt.Sprintf("[GET /sales/transactions][%d] getSalesTransactionsNotFound %+v", 404, o.Payload) +} + +func (o *GetSalesTransactionsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesTransactionsInternalServerError creates a GetSalesTransactionsInternalServerError with default headers values +func NewGetSalesTransactionsInternalServerError() *GetSalesTransactionsInternalServerError { + return &GetSalesTransactionsInternalServerError{} +} + +/*GetSalesTransactionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSalesTransactionsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetSalesTransactionsInternalServerError) Error() string { + return fmt.Sprintf("[GET /sales/transactions][%d] getSalesTransactionsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSalesTransactionsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetSalesTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_parameters.go b/api/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_parameters.go new file mode 100644 index 0000000..a649e76 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostSalesDeliveriesParams creates a new PostSalesDeliveriesParams object +// with the default values initialized. +func NewPostSalesDeliveriesParams() *PostSalesDeliveriesParams { + var () + return &PostSalesDeliveriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSalesDeliveriesParamsWithTimeout creates a new PostSalesDeliveriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSalesDeliveriesParamsWithTimeout(timeout time.Duration) *PostSalesDeliveriesParams { + var () + return &PostSalesDeliveriesParams{ + + timeout: timeout, + } +} + +// NewPostSalesDeliveriesParamsWithContext creates a new PostSalesDeliveriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSalesDeliveriesParamsWithContext(ctx context.Context) *PostSalesDeliveriesParams { + var () + return &PostSalesDeliveriesParams{ + + Context: ctx, + } +} + +// NewPostSalesDeliveriesParamsWithHTTPClient creates a new PostSalesDeliveriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSalesDeliveriesParamsWithHTTPClient(client *http.Client) *PostSalesDeliveriesParams { + var () + return &PostSalesDeliveriesParams{ + HTTPClient: client, + } +} + +/*PostSalesDeliveriesParams contains all the parameters to send to the API endpoint +for the post sales deliveries operation typically these are written to a http.Request +*/ +type PostSalesDeliveriesParams struct { + + /*SalesDeliveryRequest + The New Sales Deliveries + + */ + SalesDeliveryRequest *metrc_gw_models.SalesDeliveryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post sales deliveries params +func (o *PostSalesDeliveriesParams) WithTimeout(timeout time.Duration) *PostSalesDeliveriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post sales deliveries params +func (o *PostSalesDeliveriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post sales deliveries params +func (o *PostSalesDeliveriesParams) WithContext(ctx context.Context) *PostSalesDeliveriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post sales deliveries params +func (o *PostSalesDeliveriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post sales deliveries params +func (o *PostSalesDeliveriesParams) WithHTTPClient(client *http.Client) *PostSalesDeliveriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post sales deliveries params +func (o *PostSalesDeliveriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSalesDeliveryRequest adds the salesDeliveryRequest to the post sales deliveries params +func (o *PostSalesDeliveriesParams) WithSalesDeliveryRequest(salesDeliveryRequest *metrc_gw_models.SalesDeliveryRequest) *PostSalesDeliveriesParams { + o.SetSalesDeliveryRequest(salesDeliveryRequest) + return o +} + +// SetSalesDeliveryRequest adds the salesDeliveryRequest to the post sales deliveries params +func (o *PostSalesDeliveriesParams) SetSalesDeliveryRequest(salesDeliveryRequest *metrc_gw_models.SalesDeliveryRequest) { + o.SalesDeliveryRequest = salesDeliveryRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSalesDeliveriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SalesDeliveryRequest != nil { + if err := r.SetBodyParam(o.SalesDeliveryRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_responses.go b/api/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_responses.go new file mode 100644 index 0000000..07075af --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/post_sales_deliveries_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostSalesDeliveriesReader is a Reader for the PostSalesDeliveries structure. +type PostSalesDeliveriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSalesDeliveriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSalesDeliveriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostSalesDeliveriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostSalesDeliveriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostSalesDeliveriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostSalesDeliveriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostSalesDeliveriesOK creates a PostSalesDeliveriesOK with default headers values +func NewPostSalesDeliveriesOK() *PostSalesDeliveriesOK { + return &PostSalesDeliveriesOK{} +} + +/*PostSalesDeliveriesOK handles this case with default header values. + +An array of Sales Delivery records with the new IDs +*/ +type PostSalesDeliveriesOK struct { + Payload *metrc_gw_models.SalesDeliveryResponse +} + +func (o *PostSalesDeliveriesOK) Error() string { + return fmt.Sprintf("[POST /sales/deliveries][%d] postSalesDeliveriesOK %+v", 200, o.Payload) +} + +func (o *PostSalesDeliveriesOK) GetPayload() *metrc_gw_models.SalesDeliveryResponse { + return o.Payload +} + +func (o *PostSalesDeliveriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesDeliveryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesDeliveriesUnauthorized creates a PostSalesDeliveriesUnauthorized with default headers values +func NewPostSalesDeliveriesUnauthorized() *PostSalesDeliveriesUnauthorized { + return &PostSalesDeliveriesUnauthorized{} +} + +/*PostSalesDeliveriesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostSalesDeliveriesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesDeliveriesUnauthorized) Error() string { + return fmt.Sprintf("[POST /sales/deliveries][%d] postSalesDeliveriesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostSalesDeliveriesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesDeliveriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesDeliveriesForbidden creates a PostSalesDeliveriesForbidden with default headers values +func NewPostSalesDeliveriesForbidden() *PostSalesDeliveriesForbidden { + return &PostSalesDeliveriesForbidden{} +} + +/*PostSalesDeliveriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostSalesDeliveriesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesDeliveriesForbidden) Error() string { + return fmt.Sprintf("[POST /sales/deliveries][%d] postSalesDeliveriesForbidden %+v", 403, o.Payload) +} + +func (o *PostSalesDeliveriesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesDeliveriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesDeliveriesNotFound creates a PostSalesDeliveriesNotFound with default headers values +func NewPostSalesDeliveriesNotFound() *PostSalesDeliveriesNotFound { + return &PostSalesDeliveriesNotFound{} +} + +/*PostSalesDeliveriesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostSalesDeliveriesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesDeliveriesNotFound) Error() string { + return fmt.Sprintf("[POST /sales/deliveries][%d] postSalesDeliveriesNotFound %+v", 404, o.Payload) +} + +func (o *PostSalesDeliveriesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesDeliveriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesDeliveriesInternalServerError creates a PostSalesDeliveriesInternalServerError with default headers values +func NewPostSalesDeliveriesInternalServerError() *PostSalesDeliveriesInternalServerError { + return &PostSalesDeliveriesInternalServerError{} +} + +/*PostSalesDeliveriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostSalesDeliveriesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesDeliveriesInternalServerError) Error() string { + return fmt.Sprintf("[POST /sales/deliveries][%d] postSalesDeliveriesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostSalesDeliveriesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesDeliveriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/post_sales_receipts_parameters.go b/api/metrc-gw/metrc_gw_client/sales/post_sales_receipts_parameters.go new file mode 100644 index 0000000..de74fcc --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/post_sales_receipts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostSalesReceiptsParams creates a new PostSalesReceiptsParams object +// with the default values initialized. +func NewPostSalesReceiptsParams() *PostSalesReceiptsParams { + var () + return &PostSalesReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSalesReceiptsParamsWithTimeout creates a new PostSalesReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSalesReceiptsParamsWithTimeout(timeout time.Duration) *PostSalesReceiptsParams { + var () + return &PostSalesReceiptsParams{ + + timeout: timeout, + } +} + +// NewPostSalesReceiptsParamsWithContext creates a new PostSalesReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSalesReceiptsParamsWithContext(ctx context.Context) *PostSalesReceiptsParams { + var () + return &PostSalesReceiptsParams{ + + Context: ctx, + } +} + +// NewPostSalesReceiptsParamsWithHTTPClient creates a new PostSalesReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSalesReceiptsParamsWithHTTPClient(client *http.Client) *PostSalesReceiptsParams { + var () + return &PostSalesReceiptsParams{ + HTTPClient: client, + } +} + +/*PostSalesReceiptsParams contains all the parameters to send to the API endpoint +for the post sales receipts operation typically these are written to a http.Request +*/ +type PostSalesReceiptsParams struct { + + /*SalesReceiptRequest + The New Sales Receipts + + */ + SalesReceiptRequest *metrc_gw_models.SalesReceiptRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post sales receipts params +func (o *PostSalesReceiptsParams) WithTimeout(timeout time.Duration) *PostSalesReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post sales receipts params +func (o *PostSalesReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post sales receipts params +func (o *PostSalesReceiptsParams) WithContext(ctx context.Context) *PostSalesReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post sales receipts params +func (o *PostSalesReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post sales receipts params +func (o *PostSalesReceiptsParams) WithHTTPClient(client *http.Client) *PostSalesReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post sales receipts params +func (o *PostSalesReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSalesReceiptRequest adds the salesReceiptRequest to the post sales receipts params +func (o *PostSalesReceiptsParams) WithSalesReceiptRequest(salesReceiptRequest *metrc_gw_models.SalesReceiptRequest) *PostSalesReceiptsParams { + o.SetSalesReceiptRequest(salesReceiptRequest) + return o +} + +// SetSalesReceiptRequest adds the salesReceiptRequest to the post sales receipts params +func (o *PostSalesReceiptsParams) SetSalesReceiptRequest(salesReceiptRequest *metrc_gw_models.SalesReceiptRequest) { + o.SalesReceiptRequest = salesReceiptRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSalesReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SalesReceiptRequest != nil { + if err := r.SetBodyParam(o.SalesReceiptRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/post_sales_receipts_responses.go b/api/metrc-gw/metrc_gw_client/sales/post_sales_receipts_responses.go new file mode 100644 index 0000000..65f16d8 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/post_sales_receipts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostSalesReceiptsReader is a Reader for the PostSalesReceipts structure. +type PostSalesReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSalesReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSalesReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostSalesReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostSalesReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostSalesReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostSalesReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostSalesReceiptsOK creates a PostSalesReceiptsOK with default headers values +func NewPostSalesReceiptsOK() *PostSalesReceiptsOK { + return &PostSalesReceiptsOK{} +} + +/*PostSalesReceiptsOK handles this case with default header values. + +An array of Sales Receipt records with the new IDs +*/ +type PostSalesReceiptsOK struct { + Payload *metrc_gw_models.SalesReceiptResponse +} + +func (o *PostSalesReceiptsOK) Error() string { + return fmt.Sprintf("[POST /sales/receipts][%d] postSalesReceiptsOK %+v", 200, o.Payload) +} + +func (o *PostSalesReceiptsOK) GetPayload() *metrc_gw_models.SalesReceiptResponse { + return o.Payload +} + +func (o *PostSalesReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesReceiptsUnauthorized creates a PostSalesReceiptsUnauthorized with default headers values +func NewPostSalesReceiptsUnauthorized() *PostSalesReceiptsUnauthorized { + return &PostSalesReceiptsUnauthorized{} +} + +/*PostSalesReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostSalesReceiptsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[POST /sales/receipts][%d] postSalesReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostSalesReceiptsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesReceiptsForbidden creates a PostSalesReceiptsForbidden with default headers values +func NewPostSalesReceiptsForbidden() *PostSalesReceiptsForbidden { + return &PostSalesReceiptsForbidden{} +} + +/*PostSalesReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostSalesReceiptsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesReceiptsForbidden) Error() string { + return fmt.Sprintf("[POST /sales/receipts][%d] postSalesReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *PostSalesReceiptsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesReceiptsNotFound creates a PostSalesReceiptsNotFound with default headers values +func NewPostSalesReceiptsNotFound() *PostSalesReceiptsNotFound { + return &PostSalesReceiptsNotFound{} +} + +/*PostSalesReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostSalesReceiptsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesReceiptsNotFound) Error() string { + return fmt.Sprintf("[POST /sales/receipts][%d] postSalesReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *PostSalesReceiptsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesReceiptsInternalServerError creates a PostSalesReceiptsInternalServerError with default headers values +func NewPostSalesReceiptsInternalServerError() *PostSalesReceiptsInternalServerError { + return &PostSalesReceiptsInternalServerError{} +} + +/*PostSalesReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostSalesReceiptsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[POST /sales/receipts][%d] postSalesReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostSalesReceiptsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/post_sales_transactions_parameters.go b/api/metrc-gw/metrc_gw_client/sales/post_sales_transactions_parameters.go new file mode 100644 index 0000000..40bfd29 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/post_sales_transactions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostSalesTransactionsParams creates a new PostSalesTransactionsParams object +// with the default values initialized. +func NewPostSalesTransactionsParams() *PostSalesTransactionsParams { + var () + return &PostSalesTransactionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSalesTransactionsParamsWithTimeout creates a new PostSalesTransactionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSalesTransactionsParamsWithTimeout(timeout time.Duration) *PostSalesTransactionsParams { + var () + return &PostSalesTransactionsParams{ + + timeout: timeout, + } +} + +// NewPostSalesTransactionsParamsWithContext creates a new PostSalesTransactionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSalesTransactionsParamsWithContext(ctx context.Context) *PostSalesTransactionsParams { + var () + return &PostSalesTransactionsParams{ + + Context: ctx, + } +} + +// NewPostSalesTransactionsParamsWithHTTPClient creates a new PostSalesTransactionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSalesTransactionsParamsWithHTTPClient(client *http.Client) *PostSalesTransactionsParams { + var () + return &PostSalesTransactionsParams{ + HTTPClient: client, + } +} + +/*PostSalesTransactionsParams contains all the parameters to send to the API endpoint +for the post sales transactions operation typically these are written to a http.Request +*/ +type PostSalesTransactionsParams struct { + + /*SalesTransactionRequest + The New Sales Transactions + + */ + SalesTransactionRequest *metrc_gw_models.TransactionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post sales transactions params +func (o *PostSalesTransactionsParams) WithTimeout(timeout time.Duration) *PostSalesTransactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post sales transactions params +func (o *PostSalesTransactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post sales transactions params +func (o *PostSalesTransactionsParams) WithContext(ctx context.Context) *PostSalesTransactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post sales transactions params +func (o *PostSalesTransactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post sales transactions params +func (o *PostSalesTransactionsParams) WithHTTPClient(client *http.Client) *PostSalesTransactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post sales transactions params +func (o *PostSalesTransactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSalesTransactionRequest adds the salesTransactionRequest to the post sales transactions params +func (o *PostSalesTransactionsParams) WithSalesTransactionRequest(salesTransactionRequest *metrc_gw_models.TransactionRequest) *PostSalesTransactionsParams { + o.SetSalesTransactionRequest(salesTransactionRequest) + return o +} + +// SetSalesTransactionRequest adds the salesTransactionRequest to the post sales transactions params +func (o *PostSalesTransactionsParams) SetSalesTransactionRequest(salesTransactionRequest *metrc_gw_models.TransactionRequest) { + o.SalesTransactionRequest = salesTransactionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSalesTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SalesTransactionRequest != nil { + if err := r.SetBodyParam(o.SalesTransactionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/post_sales_transactions_responses.go b/api/metrc-gw/metrc_gw_client/sales/post_sales_transactions_responses.go new file mode 100644 index 0000000..f664f92 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/post_sales_transactions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostSalesTransactionsReader is a Reader for the PostSalesTransactions structure. +type PostSalesTransactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSalesTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSalesTransactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostSalesTransactionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostSalesTransactionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostSalesTransactionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostSalesTransactionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostSalesTransactionsOK creates a PostSalesTransactionsOK with default headers values +func NewPostSalesTransactionsOK() *PostSalesTransactionsOK { + return &PostSalesTransactionsOK{} +} + +/*PostSalesTransactionsOK handles this case with default header values. + +An array of Sales Transaction records with the new IDs +*/ +type PostSalesTransactionsOK struct { + Payload *metrc_gw_models.TransactionResponse +} + +func (o *PostSalesTransactionsOK) Error() string { + return fmt.Sprintf("[POST /sales/transactions][%d] postSalesTransactionsOK %+v", 200, o.Payload) +} + +func (o *PostSalesTransactionsOK) GetPayload() *metrc_gw_models.TransactionResponse { + return o.Payload +} + +func (o *PostSalesTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.TransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesTransactionsUnauthorized creates a PostSalesTransactionsUnauthorized with default headers values +func NewPostSalesTransactionsUnauthorized() *PostSalesTransactionsUnauthorized { + return &PostSalesTransactionsUnauthorized{} +} + +/*PostSalesTransactionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostSalesTransactionsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesTransactionsUnauthorized) Error() string { + return fmt.Sprintf("[POST /sales/transactions][%d] postSalesTransactionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostSalesTransactionsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesTransactionsForbidden creates a PostSalesTransactionsForbidden with default headers values +func NewPostSalesTransactionsForbidden() *PostSalesTransactionsForbidden { + return &PostSalesTransactionsForbidden{} +} + +/*PostSalesTransactionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostSalesTransactionsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesTransactionsForbidden) Error() string { + return fmt.Sprintf("[POST /sales/transactions][%d] postSalesTransactionsForbidden %+v", 403, o.Payload) +} + +func (o *PostSalesTransactionsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesTransactionsNotFound creates a PostSalesTransactionsNotFound with default headers values +func NewPostSalesTransactionsNotFound() *PostSalesTransactionsNotFound { + return &PostSalesTransactionsNotFound{} +} + +/*PostSalesTransactionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostSalesTransactionsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesTransactionsNotFound) Error() string { + return fmt.Sprintf("[POST /sales/transactions][%d] postSalesTransactionsNotFound %+v", 404, o.Payload) +} + +func (o *PostSalesTransactionsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSalesTransactionsInternalServerError creates a PostSalesTransactionsInternalServerError with default headers values +func NewPostSalesTransactionsInternalServerError() *PostSalesTransactionsInternalServerError { + return &PostSalesTransactionsInternalServerError{} +} + +/*PostSalesTransactionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostSalesTransactionsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostSalesTransactionsInternalServerError) Error() string { + return fmt.Sprintf("[POST /sales/transactions][%d] postSalesTransactionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostSalesTransactionsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostSalesTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_parameters.go b/api/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_parameters.go new file mode 100644 index 0000000..eaa5338 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutSalesDeliveriesParams creates a new PutSalesDeliveriesParams object +// with the default values initialized. +func NewPutSalesDeliveriesParams() *PutSalesDeliveriesParams { + var () + return &PutSalesDeliveriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutSalesDeliveriesParamsWithTimeout creates a new PutSalesDeliveriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutSalesDeliveriesParamsWithTimeout(timeout time.Duration) *PutSalesDeliveriesParams { + var () + return &PutSalesDeliveriesParams{ + + timeout: timeout, + } +} + +// NewPutSalesDeliveriesParamsWithContext creates a new PutSalesDeliveriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutSalesDeliveriesParamsWithContext(ctx context.Context) *PutSalesDeliveriesParams { + var () + return &PutSalesDeliveriesParams{ + + Context: ctx, + } +} + +// NewPutSalesDeliveriesParamsWithHTTPClient creates a new PutSalesDeliveriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutSalesDeliveriesParamsWithHTTPClient(client *http.Client) *PutSalesDeliveriesParams { + var () + return &PutSalesDeliveriesParams{ + HTTPClient: client, + } +} + +/*PutSalesDeliveriesParams contains all the parameters to send to the API endpoint +for the put sales deliveries operation typically these are written to a http.Request +*/ +type PutSalesDeliveriesParams struct { + + /*SalesDeliveryRequest + The New Sales Deliveries + + */ + SalesDeliveryRequest *metrc_gw_models.SalesDeliveryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put sales deliveries params +func (o *PutSalesDeliveriesParams) WithTimeout(timeout time.Duration) *PutSalesDeliveriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put sales deliveries params +func (o *PutSalesDeliveriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put sales deliveries params +func (o *PutSalesDeliveriesParams) WithContext(ctx context.Context) *PutSalesDeliveriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put sales deliveries params +func (o *PutSalesDeliveriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put sales deliveries params +func (o *PutSalesDeliveriesParams) WithHTTPClient(client *http.Client) *PutSalesDeliveriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put sales deliveries params +func (o *PutSalesDeliveriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSalesDeliveryRequest adds the salesDeliveryRequest to the put sales deliveries params +func (o *PutSalesDeliveriesParams) WithSalesDeliveryRequest(salesDeliveryRequest *metrc_gw_models.SalesDeliveryRequest) *PutSalesDeliveriesParams { + o.SetSalesDeliveryRequest(salesDeliveryRequest) + return o +} + +// SetSalesDeliveryRequest adds the salesDeliveryRequest to the put sales deliveries params +func (o *PutSalesDeliveriesParams) SetSalesDeliveryRequest(salesDeliveryRequest *metrc_gw_models.SalesDeliveryRequest) { + o.SalesDeliveryRequest = salesDeliveryRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutSalesDeliveriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SalesDeliveryRequest != nil { + if err := r.SetBodyParam(o.SalesDeliveryRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_responses.go b/api/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_responses.go new file mode 100644 index 0000000..75b08bb --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/put_sales_deliveries_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutSalesDeliveriesReader is a Reader for the PutSalesDeliveries structure. +type PutSalesDeliveriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutSalesDeliveriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutSalesDeliveriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutSalesDeliveriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutSalesDeliveriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutSalesDeliveriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutSalesDeliveriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutSalesDeliveriesOK creates a PutSalesDeliveriesOK with default headers values +func NewPutSalesDeliveriesOK() *PutSalesDeliveriesOK { + return &PutSalesDeliveriesOK{} +} + +/*PutSalesDeliveriesOK handles this case with default header values. + +An array of Sales Delivery records with the new IDs +*/ +type PutSalesDeliveriesOK struct { + Payload *metrc_gw_models.SalesDeliveryResponse +} + +func (o *PutSalesDeliveriesOK) Error() string { + return fmt.Sprintf("[PUT /sales/deliveries][%d] putSalesDeliveriesOK %+v", 200, o.Payload) +} + +func (o *PutSalesDeliveriesOK) GetPayload() *metrc_gw_models.SalesDeliveryResponse { + return o.Payload +} + +func (o *PutSalesDeliveriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesDeliveryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesDeliveriesUnauthorized creates a PutSalesDeliveriesUnauthorized with default headers values +func NewPutSalesDeliveriesUnauthorized() *PutSalesDeliveriesUnauthorized { + return &PutSalesDeliveriesUnauthorized{} +} + +/*PutSalesDeliveriesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutSalesDeliveriesUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesDeliveriesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /sales/deliveries][%d] putSalesDeliveriesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutSalesDeliveriesUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesDeliveriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesDeliveriesForbidden creates a PutSalesDeliveriesForbidden with default headers values +func NewPutSalesDeliveriesForbidden() *PutSalesDeliveriesForbidden { + return &PutSalesDeliveriesForbidden{} +} + +/*PutSalesDeliveriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutSalesDeliveriesForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesDeliveriesForbidden) Error() string { + return fmt.Sprintf("[PUT /sales/deliveries][%d] putSalesDeliveriesForbidden %+v", 403, o.Payload) +} + +func (o *PutSalesDeliveriesForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesDeliveriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesDeliveriesNotFound creates a PutSalesDeliveriesNotFound with default headers values +func NewPutSalesDeliveriesNotFound() *PutSalesDeliveriesNotFound { + return &PutSalesDeliveriesNotFound{} +} + +/*PutSalesDeliveriesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutSalesDeliveriesNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesDeliveriesNotFound) Error() string { + return fmt.Sprintf("[PUT /sales/deliveries][%d] putSalesDeliveriesNotFound %+v", 404, o.Payload) +} + +func (o *PutSalesDeliveriesNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesDeliveriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesDeliveriesInternalServerError creates a PutSalesDeliveriesInternalServerError with default headers values +func NewPutSalesDeliveriesInternalServerError() *PutSalesDeliveriesInternalServerError { + return &PutSalesDeliveriesInternalServerError{} +} + +/*PutSalesDeliveriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutSalesDeliveriesInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesDeliveriesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /sales/deliveries][%d] putSalesDeliveriesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutSalesDeliveriesInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesDeliveriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/put_sales_receipts_parameters.go b/api/metrc-gw/metrc_gw_client/sales/put_sales_receipts_parameters.go new file mode 100644 index 0000000..c9cb481 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/put_sales_receipts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutSalesReceiptsParams creates a new PutSalesReceiptsParams object +// with the default values initialized. +func NewPutSalesReceiptsParams() *PutSalesReceiptsParams { + var () + return &PutSalesReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutSalesReceiptsParamsWithTimeout creates a new PutSalesReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutSalesReceiptsParamsWithTimeout(timeout time.Duration) *PutSalesReceiptsParams { + var () + return &PutSalesReceiptsParams{ + + timeout: timeout, + } +} + +// NewPutSalesReceiptsParamsWithContext creates a new PutSalesReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutSalesReceiptsParamsWithContext(ctx context.Context) *PutSalesReceiptsParams { + var () + return &PutSalesReceiptsParams{ + + Context: ctx, + } +} + +// NewPutSalesReceiptsParamsWithHTTPClient creates a new PutSalesReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutSalesReceiptsParamsWithHTTPClient(client *http.Client) *PutSalesReceiptsParams { + var () + return &PutSalesReceiptsParams{ + HTTPClient: client, + } +} + +/*PutSalesReceiptsParams contains all the parameters to send to the API endpoint +for the put sales receipts operation typically these are written to a http.Request +*/ +type PutSalesReceiptsParams struct { + + /*SalesReceiptRequest + The Existing Sales Receipts + + */ + SalesReceiptRequest *metrc_gw_models.SalesReceiptRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put sales receipts params +func (o *PutSalesReceiptsParams) WithTimeout(timeout time.Duration) *PutSalesReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put sales receipts params +func (o *PutSalesReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put sales receipts params +func (o *PutSalesReceiptsParams) WithContext(ctx context.Context) *PutSalesReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put sales receipts params +func (o *PutSalesReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put sales receipts params +func (o *PutSalesReceiptsParams) WithHTTPClient(client *http.Client) *PutSalesReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put sales receipts params +func (o *PutSalesReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSalesReceiptRequest adds the salesReceiptRequest to the put sales receipts params +func (o *PutSalesReceiptsParams) WithSalesReceiptRequest(salesReceiptRequest *metrc_gw_models.SalesReceiptRequest) *PutSalesReceiptsParams { + o.SetSalesReceiptRequest(salesReceiptRequest) + return o +} + +// SetSalesReceiptRequest adds the salesReceiptRequest to the put sales receipts params +func (o *PutSalesReceiptsParams) SetSalesReceiptRequest(salesReceiptRequest *metrc_gw_models.SalesReceiptRequest) { + o.SalesReceiptRequest = salesReceiptRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutSalesReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SalesReceiptRequest != nil { + if err := r.SetBodyParam(o.SalesReceiptRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/put_sales_receipts_responses.go b/api/metrc-gw/metrc_gw_client/sales/put_sales_receipts_responses.go new file mode 100644 index 0000000..09a6403 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/put_sales_receipts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutSalesReceiptsReader is a Reader for the PutSalesReceipts structure. +type PutSalesReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutSalesReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutSalesReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutSalesReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutSalesReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutSalesReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutSalesReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutSalesReceiptsOK creates a PutSalesReceiptsOK with default headers values +func NewPutSalesReceiptsOK() *PutSalesReceiptsOK { + return &PutSalesReceiptsOK{} +} + +/*PutSalesReceiptsOK handles this case with default header values. + +An array of Sales Receipt records with the existing IDs +*/ +type PutSalesReceiptsOK struct { + Payload *metrc_gw_models.SalesReceiptResponse +} + +func (o *PutSalesReceiptsOK) Error() string { + return fmt.Sprintf("[PUT /sales/receipts][%d] putSalesReceiptsOK %+v", 200, o.Payload) +} + +func (o *PutSalesReceiptsOK) GetPayload() *metrc_gw_models.SalesReceiptResponse { + return o.Payload +} + +func (o *PutSalesReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.SalesReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesReceiptsUnauthorized creates a PutSalesReceiptsUnauthorized with default headers values +func NewPutSalesReceiptsUnauthorized() *PutSalesReceiptsUnauthorized { + return &PutSalesReceiptsUnauthorized{} +} + +/*PutSalesReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutSalesReceiptsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /sales/receipts][%d] putSalesReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutSalesReceiptsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesReceiptsForbidden creates a PutSalesReceiptsForbidden with default headers values +func NewPutSalesReceiptsForbidden() *PutSalesReceiptsForbidden { + return &PutSalesReceiptsForbidden{} +} + +/*PutSalesReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutSalesReceiptsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesReceiptsForbidden) Error() string { + return fmt.Sprintf("[PUT /sales/receipts][%d] putSalesReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *PutSalesReceiptsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesReceiptsNotFound creates a PutSalesReceiptsNotFound with default headers values +func NewPutSalesReceiptsNotFound() *PutSalesReceiptsNotFound { + return &PutSalesReceiptsNotFound{} +} + +/*PutSalesReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutSalesReceiptsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesReceiptsNotFound) Error() string { + return fmt.Sprintf("[PUT /sales/receipts][%d] putSalesReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *PutSalesReceiptsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesReceiptsInternalServerError creates a PutSalesReceiptsInternalServerError with default headers values +func NewPutSalesReceiptsInternalServerError() *PutSalesReceiptsInternalServerError { + return &PutSalesReceiptsInternalServerError{} +} + +/*PutSalesReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutSalesReceiptsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /sales/receipts][%d] putSalesReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutSalesReceiptsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/put_sales_transactions_parameters.go b/api/metrc-gw/metrc_gw_client/sales/put_sales_transactions_parameters.go new file mode 100644 index 0000000..874cbf7 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/put_sales_transactions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutSalesTransactionsParams creates a new PutSalesTransactionsParams object +// with the default values initialized. +func NewPutSalesTransactionsParams() *PutSalesTransactionsParams { + var () + return &PutSalesTransactionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutSalesTransactionsParamsWithTimeout creates a new PutSalesTransactionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutSalesTransactionsParamsWithTimeout(timeout time.Duration) *PutSalesTransactionsParams { + var () + return &PutSalesTransactionsParams{ + + timeout: timeout, + } +} + +// NewPutSalesTransactionsParamsWithContext creates a new PutSalesTransactionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutSalesTransactionsParamsWithContext(ctx context.Context) *PutSalesTransactionsParams { + var () + return &PutSalesTransactionsParams{ + + Context: ctx, + } +} + +// NewPutSalesTransactionsParamsWithHTTPClient creates a new PutSalesTransactionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutSalesTransactionsParamsWithHTTPClient(client *http.Client) *PutSalesTransactionsParams { + var () + return &PutSalesTransactionsParams{ + HTTPClient: client, + } +} + +/*PutSalesTransactionsParams contains all the parameters to send to the API endpoint +for the put sales transactions operation typically these are written to a http.Request +*/ +type PutSalesTransactionsParams struct { + + /*SalesTransactionRequest + The New Sales Transactions + + */ + SalesTransactionRequest *metrc_gw_models.TransactionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put sales transactions params +func (o *PutSalesTransactionsParams) WithTimeout(timeout time.Duration) *PutSalesTransactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put sales transactions params +func (o *PutSalesTransactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put sales transactions params +func (o *PutSalesTransactionsParams) WithContext(ctx context.Context) *PutSalesTransactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put sales transactions params +func (o *PutSalesTransactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put sales transactions params +func (o *PutSalesTransactionsParams) WithHTTPClient(client *http.Client) *PutSalesTransactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put sales transactions params +func (o *PutSalesTransactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSalesTransactionRequest adds the salesTransactionRequest to the put sales transactions params +func (o *PutSalesTransactionsParams) WithSalesTransactionRequest(salesTransactionRequest *metrc_gw_models.TransactionRequest) *PutSalesTransactionsParams { + o.SetSalesTransactionRequest(salesTransactionRequest) + return o +} + +// SetSalesTransactionRequest adds the salesTransactionRequest to the put sales transactions params +func (o *PutSalesTransactionsParams) SetSalesTransactionRequest(salesTransactionRequest *metrc_gw_models.TransactionRequest) { + o.SalesTransactionRequest = salesTransactionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutSalesTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SalesTransactionRequest != nil { + if err := r.SetBodyParam(o.SalesTransactionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sales/put_sales_transactions_responses.go b/api/metrc-gw/metrc_gw_client/sales/put_sales_transactions_responses.go new file mode 100644 index 0000000..cd90348 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/put_sales_transactions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutSalesTransactionsReader is a Reader for the PutSalesTransactions structure. +type PutSalesTransactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutSalesTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutSalesTransactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutSalesTransactionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutSalesTransactionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutSalesTransactionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutSalesTransactionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutSalesTransactionsOK creates a PutSalesTransactionsOK with default headers values +func NewPutSalesTransactionsOK() *PutSalesTransactionsOK { + return &PutSalesTransactionsOK{} +} + +/*PutSalesTransactionsOK handles this case with default header values. + +An array of Sales Transaction records with the existing IDs +*/ +type PutSalesTransactionsOK struct { + Payload *metrc_gw_models.TransactionResponse +} + +func (o *PutSalesTransactionsOK) Error() string { + return fmt.Sprintf("[PUT /sales/transactions][%d] putSalesTransactionsOK %+v", 200, o.Payload) +} + +func (o *PutSalesTransactionsOK) GetPayload() *metrc_gw_models.TransactionResponse { + return o.Payload +} + +func (o *PutSalesTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.TransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesTransactionsUnauthorized creates a PutSalesTransactionsUnauthorized with default headers values +func NewPutSalesTransactionsUnauthorized() *PutSalesTransactionsUnauthorized { + return &PutSalesTransactionsUnauthorized{} +} + +/*PutSalesTransactionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutSalesTransactionsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesTransactionsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /sales/transactions][%d] putSalesTransactionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutSalesTransactionsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesTransactionsForbidden creates a PutSalesTransactionsForbidden with default headers values +func NewPutSalesTransactionsForbidden() *PutSalesTransactionsForbidden { + return &PutSalesTransactionsForbidden{} +} + +/*PutSalesTransactionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutSalesTransactionsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesTransactionsForbidden) Error() string { + return fmt.Sprintf("[PUT /sales/transactions][%d] putSalesTransactionsForbidden %+v", 403, o.Payload) +} + +func (o *PutSalesTransactionsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesTransactionsNotFound creates a PutSalesTransactionsNotFound with default headers values +func NewPutSalesTransactionsNotFound() *PutSalesTransactionsNotFound { + return &PutSalesTransactionsNotFound{} +} + +/*PutSalesTransactionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutSalesTransactionsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesTransactionsNotFound) Error() string { + return fmt.Sprintf("[PUT /sales/transactions][%d] putSalesTransactionsNotFound %+v", 404, o.Payload) +} + +func (o *PutSalesTransactionsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSalesTransactionsInternalServerError creates a PutSalesTransactionsInternalServerError with default headers values +func NewPutSalesTransactionsInternalServerError() *PutSalesTransactionsInternalServerError { + return &PutSalesTransactionsInternalServerError{} +} + +/*PutSalesTransactionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutSalesTransactionsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutSalesTransactionsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /sales/transactions][%d] putSalesTransactionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutSalesTransactionsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutSalesTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/sales/sales_client.go b/api/metrc-gw/metrc_gw_client/sales/sales_client.go new file mode 100644 index 0000000..f760ff8 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sales/sales_client.go @@ -0,0 +1,594 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sales + +// 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 sales API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for sales API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteSalesDelivery(params *DeleteSalesDeliveryParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSalesDeliveryOK, error) + + DeleteSalesReceipts(params *DeleteSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSalesReceiptsOK, error) + + GetCustomerTypes(params *GetCustomerTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCustomerTypesOK, error) + + GetSalesDeliveries(params *GetSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesDeliveriesOK, error) + + GetSalesDeliveryReturnReasons(params *GetSalesDeliveryReturnReasonsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesDeliveryReturnReasonsOK, error) + + GetSalesReceipts(params *GetSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesReceiptsOK, error) + + GetSalesTransactionDates(params *GetSalesTransactionDatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesTransactionDatesOK, error) + + GetSalesTransactions(params *GetSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesTransactionsOK, error) + + PostSalesDeliveries(params *PostSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter) (*PostSalesDeliveriesOK, error) + + PostSalesReceipts(params *PostSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSalesReceiptsOK, error) + + PostSalesTransactions(params *PostSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSalesTransactionsOK, error) + + PutSalesDeliveries(params *PutSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter) (*PutSalesDeliveriesOK, error) + + PutSalesReceipts(params *PutSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSalesReceiptsOK, error) + + PutSalesTransactions(params *PutSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSalesTransactionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteSalesDelivery sales delivery deleted for this user license + + Delete a Sales Delivery for this User-License + +*/ +func (a *Client) DeleteSalesDelivery(params *DeleteSalesDeliveryParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSalesDeliveryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSalesDeliveryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteSalesDelivery", + Method: "DELETE", + PathPattern: "/sales/deliveries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteSalesDeliveryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSalesDeliveryOK) + 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 deleteSalesDelivery: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteSalesReceipts sales receipts for this user license + + Delete a Sales Receipt for this User-License + +*/ +func (a *Client) DeleteSalesReceipts(params *DeleteSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteSalesReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSalesReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteSalesReceipts", + Method: "DELETE", + PathPattern: "/sales/receipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteSalesReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSalesReceiptsOK) + 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 deleteSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCustomerTypes customers types for user + + Get Customer Types for this User + +*/ +func (a *Client) GetCustomerTypes(params *GetCustomerTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCustomerTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCustomerTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCustomerTypes", + Method: "GET", + PathPattern: "/sales/customertypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCustomerTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCustomerTypesOK) + 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 getCustomerTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSalesDeliveries deliveries for user license + + Deliveries for this User-License + +*/ +func (a *Client) GetSalesDeliveries(params *GetSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesDeliveriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSalesDeliveriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSalesDeliveries", + Method: "GET", + PathPattern: "/sales/deliveries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSalesDeliveriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSalesDeliveriesOK) + 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 getSalesDeliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSalesDeliveryReturnReasons deliveries return reasons for user license + + Delivery Return Reasons for this User-License + +*/ +func (a *Client) GetSalesDeliveryReturnReasons(params *GetSalesDeliveryReturnReasonsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesDeliveryReturnReasonsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSalesDeliveryReturnReasonsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSalesDeliveryReturnReasons", + Method: "GET", + PathPattern: "/sales/deliveries/returnreasons", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSalesDeliveryReturnReasonsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSalesDeliveryReturnReasonsOK) + 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 getSalesDeliveryReturnReasons: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSalesReceipts sales receipts for user license + + Sales Receipts for this User-License + +*/ +func (a *Client) GetSalesReceipts(params *GetSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSalesReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSalesReceipts", + Method: "GET", + PathPattern: "/sales/receipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSalesReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSalesReceiptsOK) + 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 getSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSalesTransactionDates as list of sales transaction dates for this user license + + Get A list of Sales Transaction Dates for this User-License + +*/ +func (a *Client) GetSalesTransactionDates(params *GetSalesTransactionDatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesTransactionDatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSalesTransactionDatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSalesTransactionDates", + Method: "GET", + PathPattern: "/sales/transactiondates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSalesTransactionDatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSalesTransactionDatesOK) + 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 getSalesTransactionDates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSalesTransactions sales receipts for user license + + Sales Transactions for this User-License + +*/ +func (a *Client) GetSalesTransactions(params *GetSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesTransactionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSalesTransactionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSalesTransactions", + Method: "GET", + PathPattern: "/sales/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSalesTransactionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSalesTransactionsOK) + 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 getSalesTransactions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostSalesDeliveries creates new sales deliveries + + Create new Sales Deliveries +*/ +func (a *Client) PostSalesDeliveries(params *PostSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter) (*PostSalesDeliveriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSalesDeliveriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postSalesDeliveries", + Method: "POST", + PathPattern: "/sales/deliveries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSalesDeliveriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostSalesDeliveriesOK) + 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 postSalesDeliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostSalesReceipts creates new sales receipts + + Create new Sales Receipts +*/ +func (a *Client) PostSalesReceipts(params *PostSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSalesReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSalesReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postSalesReceipts", + Method: "POST", + PathPattern: "/sales/receipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSalesReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostSalesReceiptsOK) + 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 postSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostSalesTransactions creates new sales transactions + + Create new Sales Transactions +*/ +func (a *Client) PostSalesTransactions(params *PostSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSalesTransactionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSalesTransactionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postSalesTransactions", + Method: "POST", + PathPattern: "/sales/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSalesTransactionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostSalesTransactionsOK) + 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 postSalesTransactions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutSalesDeliveries creates new sales deliveries + + Create new Sales Deliveries +*/ +func (a *Client) PutSalesDeliveries(params *PutSalesDeliveriesParams, authInfo runtime.ClientAuthInfoWriter) (*PutSalesDeliveriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutSalesDeliveriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putSalesDeliveries", + Method: "PUT", + PathPattern: "/sales/deliveries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutSalesDeliveriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutSalesDeliveriesOK) + 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 putSalesDeliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutSalesReceipts creates new sales receipts + + Create new Sales Receipts +*/ +func (a *Client) PutSalesReceipts(params *PutSalesReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSalesReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutSalesReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putSalesReceipts", + Method: "PUT", + PathPattern: "/sales/receipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutSalesReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutSalesReceiptsOK) + 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 putSalesReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutSalesTransactions creates new sales transactions + + Create new Sales Transactions +*/ +func (a *Client) PutSalesTransactions(params *PutSalesTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSalesTransactionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutSalesTransactionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putSalesTransactions", + Method: "PUT", + PathPattern: "/sales/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutSalesTransactionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutSalesTransactionsOK) + 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 putSalesTransactions: 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/metrc-gw/metrc_gw_client/strains/delete_strain_parameters.go b/api/metrc-gw/metrc_gw_client/strains/delete_strain_parameters.go new file mode 100644 index 0000000..a83e0ef --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/delete_strain_parameters.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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" +) + +// NewDeleteStrainParams creates a new DeleteStrainParams object +// with the default values initialized. +func NewDeleteStrainParams() *DeleteStrainParams { + var () + return &DeleteStrainParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteStrainParamsWithTimeout creates a new DeleteStrainParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteStrainParamsWithTimeout(timeout time.Duration) *DeleteStrainParams { + var () + return &DeleteStrainParams{ + + timeout: timeout, + } +} + +// NewDeleteStrainParamsWithContext creates a new DeleteStrainParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteStrainParamsWithContext(ctx context.Context) *DeleteStrainParams { + var () + return &DeleteStrainParams{ + + Context: ctx, + } +} + +// NewDeleteStrainParamsWithHTTPClient creates a new DeleteStrainParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteStrainParamsWithHTTPClient(client *http.Client) *DeleteStrainParams { + var () + return &DeleteStrainParams{ + HTTPClient: client, + } +} + +/*DeleteStrainParams contains all the parameters to send to the API endpoint +for the delete strain operation typically these are written to a http.Request +*/ +type DeleteStrainParams struct { + + /*ItemID + The Item Number + + */ + ItemID float64 + /*License + The Licnese Number for the query + + */ + License string + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete strain params +func (o *DeleteStrainParams) WithTimeout(timeout time.Duration) *DeleteStrainParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete strain params +func (o *DeleteStrainParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete strain params +func (o *DeleteStrainParams) WithContext(ctx context.Context) *DeleteStrainParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete strain params +func (o *DeleteStrainParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete strain params +func (o *DeleteStrainParams) WithHTTPClient(client *http.Client) *DeleteStrainParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete strain params +func (o *DeleteStrainParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithItemID adds the itemID to the delete strain params +func (o *DeleteStrainParams) WithItemID(itemID float64) *DeleteStrainParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the delete strain params +func (o *DeleteStrainParams) SetItemID(itemID float64) { + o.ItemID = itemID +} + +// WithLicense adds the license to the delete strain params +func (o *DeleteStrainParams) WithLicense(license string) *DeleteStrainParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the delete strain params +func (o *DeleteStrainParams) SetLicense(license string) { + o.License = license +} + +// WithReseller adds the reseller to the delete strain params +func (o *DeleteStrainParams) WithReseller(reseller string) *DeleteStrainParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the delete strain params +func (o *DeleteStrainParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the delete strain params +func (o *DeleteStrainParams) WithState(state string) *DeleteStrainParams { + o.SetState(state) + return o +} + +// SetState adds the state to the delete strain params +func (o *DeleteStrainParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the delete strain params +func (o *DeleteStrainParams) WithUser(user string) *DeleteStrainParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the delete strain params +func (o *DeleteStrainParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteStrainParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param itemId + qrItemID := o.ItemID + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/strains/delete_strain_responses.go b/api/metrc-gw/metrc_gw_client/strains/delete_strain_responses.go new file mode 100644 index 0000000..6bd9c38 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/delete_strain_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// DeleteStrainReader is a Reader for the DeleteStrain structure. +type DeleteStrainReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteStrainReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteStrainOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteStrainUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteStrainForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteStrainNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteStrainInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteStrainOK creates a DeleteStrainOK with default headers values +func NewDeleteStrainOK() *DeleteStrainOK { + return &DeleteStrainOK{} +} + +/*DeleteStrainOK handles this case with default header values. + +Strains were successfully retrieved +*/ +type DeleteStrainOK struct { + Payload *metrc_gw_models.StrainResponse +} + +func (o *DeleteStrainOK) Error() string { + return fmt.Sprintf("[DELETE /strains][%d] deleteStrainOK %+v", 200, o.Payload) +} + +func (o *DeleteStrainOK) GetPayload() *metrc_gw_models.StrainResponse { + return o.Payload +} + +func (o *DeleteStrainOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.StrainResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteStrainUnauthorized creates a DeleteStrainUnauthorized with default headers values +func NewDeleteStrainUnauthorized() *DeleteStrainUnauthorized { + return &DeleteStrainUnauthorized{} +} + +/*DeleteStrainUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteStrainUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteStrainUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /strains][%d] deleteStrainUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteStrainUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteStrainUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteStrainForbidden creates a DeleteStrainForbidden with default headers values +func NewDeleteStrainForbidden() *DeleteStrainForbidden { + return &DeleteStrainForbidden{} +} + +/*DeleteStrainForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteStrainForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteStrainForbidden) Error() string { + return fmt.Sprintf("[DELETE /strains][%d] deleteStrainForbidden %+v", 403, o.Payload) +} + +func (o *DeleteStrainForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteStrainForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteStrainNotFound creates a DeleteStrainNotFound with default headers values +func NewDeleteStrainNotFound() *DeleteStrainNotFound { + return &DeleteStrainNotFound{} +} + +/*DeleteStrainNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteStrainNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteStrainNotFound) Error() string { + return fmt.Sprintf("[DELETE /strains][%d] deleteStrainNotFound %+v", 404, o.Payload) +} + +func (o *DeleteStrainNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteStrainNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteStrainInternalServerError creates a DeleteStrainInternalServerError with default headers values +func NewDeleteStrainInternalServerError() *DeleteStrainInternalServerError { + return &DeleteStrainInternalServerError{} +} + +/*DeleteStrainInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteStrainInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *DeleteStrainInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /strains][%d] deleteStrainInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteStrainInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *DeleteStrainInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/strains/get_strains_parameters.go b/api/metrc-gw/metrc_gw_client/strains/get_strains_parameters.go new file mode 100644 index 0000000..f1cab7a --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/get_strains_parameters.go @@ -0,0 +1,379 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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" +) + +// NewGetStrainsParams creates a new GetStrainsParams object +// with the default values initialized. +func NewGetStrainsParams() *GetStrainsParams { + var () + return &GetStrainsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetStrainsParamsWithTimeout creates a new GetStrainsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetStrainsParamsWithTimeout(timeout time.Duration) *GetStrainsParams { + var () + return &GetStrainsParams{ + + timeout: timeout, + } +} + +// NewGetStrainsParamsWithContext creates a new GetStrainsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetStrainsParamsWithContext(ctx context.Context) *GetStrainsParams { + var () + return &GetStrainsParams{ + + Context: ctx, + } +} + +// NewGetStrainsParamsWithHTTPClient creates a new GetStrainsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetStrainsParamsWithHTTPClient(client *http.Client) *GetStrainsParams { + var () + return &GetStrainsParams{ + HTTPClient: client, + } +} + +/*GetStrainsParams contains all the parameters to send to the API endpoint +for the get strains operation typically these are written to a http.Request +*/ +type GetStrainsParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*ItemID + The Item Number + + */ + ItemID *float64 + /*Label + The METRC Package Label + + */ + Label *string + /*License + The Licnese Number for the query + + */ + License string + /*Onhold + Get On Hold objects? + + */ + Onhold *bool + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get strains params +func (o *GetStrainsParams) WithTimeout(timeout time.Duration) *GetStrainsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get strains params +func (o *GetStrainsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get strains params +func (o *GetStrainsParams) WithContext(ctx context.Context) *GetStrainsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get strains params +func (o *GetStrainsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get strains params +func (o *GetStrainsParams) WithHTTPClient(client *http.Client) *GetStrainsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get strains params +func (o *GetStrainsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get strains params +func (o *GetStrainsParams) WithActive(active *bool) *GetStrainsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get strains params +func (o *GetStrainsParams) SetActive(active *bool) { + o.Active = active +} + +// WithItemID adds the itemID to the get strains params +func (o *GetStrainsParams) WithItemID(itemID *float64) *GetStrainsParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get strains params +func (o *GetStrainsParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLabel adds the label to the get strains params +func (o *GetStrainsParams) WithLabel(label *string) *GetStrainsParams { + o.SetLabel(label) + return o +} + +// SetLabel adds the label to the get strains params +func (o *GetStrainsParams) SetLabel(label *string) { + o.Label = label +} + +// WithLicense adds the license to the get strains params +func (o *GetStrainsParams) WithLicense(license string) *GetStrainsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get strains params +func (o *GetStrainsParams) SetLicense(license string) { + o.License = license +} + +// WithOnhold adds the onhold to the get strains params +func (o *GetStrainsParams) WithOnhold(onhold *bool) *GetStrainsParams { + o.SetOnhold(onhold) + return o +} + +// SetOnhold adds the onhold to the get strains params +func (o *GetStrainsParams) SetOnhold(onhold *bool) { + o.Onhold = onhold +} + +// WithProduction adds the production to the get strains params +func (o *GetStrainsParams) WithProduction(production *bool) *GetStrainsParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get strains params +func (o *GetStrainsParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get strains params +func (o *GetStrainsParams) WithReseller(reseller string) *GetStrainsParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get strains params +func (o *GetStrainsParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get strains params +func (o *GetStrainsParams) WithState(state string) *GetStrainsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get strains params +func (o *GetStrainsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get strains params +func (o *GetStrainsParams) WithUser(user string) *GetStrainsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get strains params +func (o *GetStrainsParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStrainsParams) 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.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + if o.Label != nil { + + // query param label + var qrLabel string + if o.Label != nil { + qrLabel = *o.Label + } + qLabel := qrLabel + if qLabel != "" { + if err := r.SetQueryParam("label", qLabel); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Onhold != nil { + + // query param onhold + var qrOnhold bool + if o.Onhold != nil { + qrOnhold = *o.Onhold + } + qOnhold := swag.FormatBool(qrOnhold) + if qOnhold != "" { + if err := r.SetQueryParam("onhold", qOnhold); err != nil { + return err + } + } + + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/strains/get_strains_responses.go b/api/metrc-gw/metrc_gw_client/strains/get_strains_responses.go new file mode 100644 index 0000000..fd66e89 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/get_strains_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetStrainsReader is a Reader for the GetStrains structure. +type GetStrainsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStrainsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStrainsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetStrainsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetStrainsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetStrainsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetStrainsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetStrainsOK creates a GetStrainsOK with default headers values +func NewGetStrainsOK() *GetStrainsOK { + return &GetStrainsOK{} +} + +/*GetStrainsOK handles this case with default header values. + +Strains were successfully retrieved +*/ +type GetStrainsOK struct { + Payload *metrc_gw_models.StrainResponse +} + +func (o *GetStrainsOK) Error() string { + return fmt.Sprintf("[GET /strains][%d] getStrainsOK %+v", 200, o.Payload) +} + +func (o *GetStrainsOK) GetPayload() *metrc_gw_models.StrainResponse { + return o.Payload +} + +func (o *GetStrainsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.StrainResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStrainsUnauthorized creates a GetStrainsUnauthorized with default headers values +func NewGetStrainsUnauthorized() *GetStrainsUnauthorized { + return &GetStrainsUnauthorized{} +} + +/*GetStrainsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetStrainsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetStrainsUnauthorized) Error() string { + return fmt.Sprintf("[GET /strains][%d] getStrainsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetStrainsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetStrainsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStrainsForbidden creates a GetStrainsForbidden with default headers values +func NewGetStrainsForbidden() *GetStrainsForbidden { + return &GetStrainsForbidden{} +} + +/*GetStrainsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetStrainsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetStrainsForbidden) Error() string { + return fmt.Sprintf("[GET /strains][%d] getStrainsForbidden %+v", 403, o.Payload) +} + +func (o *GetStrainsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetStrainsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStrainsNotFound creates a GetStrainsNotFound with default headers values +func NewGetStrainsNotFound() *GetStrainsNotFound { + return &GetStrainsNotFound{} +} + +/*GetStrainsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetStrainsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetStrainsNotFound) Error() string { + return fmt.Sprintf("[GET /strains][%d] getStrainsNotFound %+v", 404, o.Payload) +} + +func (o *GetStrainsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetStrainsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStrainsInternalServerError creates a GetStrainsInternalServerError with default headers values +func NewGetStrainsInternalServerError() *GetStrainsInternalServerError { + return &GetStrainsInternalServerError{} +} + +/*GetStrainsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetStrainsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetStrainsInternalServerError) Error() string { + return fmt.Sprintf("[GET /strains][%d] getStrainsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetStrainsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetStrainsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/strains/post_strains_parameters.go b/api/metrc-gw/metrc_gw_client/strains/post_strains_parameters.go new file mode 100644 index 0000000..fc75cec --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/post_strains_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPostStrainsParams creates a new PostStrainsParams object +// with the default values initialized. +func NewPostStrainsParams() *PostStrainsParams { + var () + return &PostStrainsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostStrainsParamsWithTimeout creates a new PostStrainsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostStrainsParamsWithTimeout(timeout time.Duration) *PostStrainsParams { + var () + return &PostStrainsParams{ + + timeout: timeout, + } +} + +// NewPostStrainsParamsWithContext creates a new PostStrainsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostStrainsParamsWithContext(ctx context.Context) *PostStrainsParams { + var () + return &PostStrainsParams{ + + Context: ctx, + } +} + +// NewPostStrainsParamsWithHTTPClient creates a new PostStrainsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostStrainsParamsWithHTTPClient(client *http.Client) *PostStrainsParams { + var () + return &PostStrainsParams{ + HTTPClient: client, + } +} + +/*PostStrainsParams contains all the parameters to send to the API endpoint +for the post strains operation typically these are written to a http.Request +*/ +type PostStrainsParams struct { + + /*StrainRequest + The New Strains + + */ + StrainRequest *metrc_gw_models.StrainRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post strains params +func (o *PostStrainsParams) WithTimeout(timeout time.Duration) *PostStrainsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post strains params +func (o *PostStrainsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post strains params +func (o *PostStrainsParams) WithContext(ctx context.Context) *PostStrainsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post strains params +func (o *PostStrainsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post strains params +func (o *PostStrainsParams) WithHTTPClient(client *http.Client) *PostStrainsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post strains params +func (o *PostStrainsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStrainRequest adds the strainRequest to the post strains params +func (o *PostStrainsParams) WithStrainRequest(strainRequest *metrc_gw_models.StrainRequest) *PostStrainsParams { + o.SetStrainRequest(strainRequest) + return o +} + +// SetStrainRequest adds the strainRequest to the post strains params +func (o *PostStrainsParams) SetStrainRequest(strainRequest *metrc_gw_models.StrainRequest) { + o.StrainRequest = strainRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostStrainsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StrainRequest != nil { + if err := r.SetBodyParam(o.StrainRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/strains/post_strains_responses.go b/api/metrc-gw/metrc_gw_client/strains/post_strains_responses.go new file mode 100644 index 0000000..485e5e3 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/post_strains_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PostStrainsReader is a Reader for the PostStrains structure. +type PostStrainsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostStrainsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostStrainsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostStrainsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostStrainsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostStrainsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostStrainsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostStrainsOK creates a PostStrainsOK with default headers values +func NewPostStrainsOK() *PostStrainsOK { + return &PostStrainsOK{} +} + +/*PostStrainsOK handles this case with default header values. + +An array of Strain records with the new IDs +*/ +type PostStrainsOK struct { + Payload *metrc_gw_models.StrainResponse +} + +func (o *PostStrainsOK) Error() string { + return fmt.Sprintf("[POST /strains][%d] postStrainsOK %+v", 200, o.Payload) +} + +func (o *PostStrainsOK) GetPayload() *metrc_gw_models.StrainResponse { + return o.Payload +} + +func (o *PostStrainsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.StrainResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStrainsUnauthorized creates a PostStrainsUnauthorized with default headers values +func NewPostStrainsUnauthorized() *PostStrainsUnauthorized { + return &PostStrainsUnauthorized{} +} + +/*PostStrainsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostStrainsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PostStrainsUnauthorized) Error() string { + return fmt.Sprintf("[POST /strains][%d] postStrainsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostStrainsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostStrainsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStrainsForbidden creates a PostStrainsForbidden with default headers values +func NewPostStrainsForbidden() *PostStrainsForbidden { + return &PostStrainsForbidden{} +} + +/*PostStrainsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostStrainsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PostStrainsForbidden) Error() string { + return fmt.Sprintf("[POST /strains][%d] postStrainsForbidden %+v", 403, o.Payload) +} + +func (o *PostStrainsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostStrainsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStrainsNotFound creates a PostStrainsNotFound with default headers values +func NewPostStrainsNotFound() *PostStrainsNotFound { + return &PostStrainsNotFound{} +} + +/*PostStrainsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostStrainsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PostStrainsNotFound) Error() string { + return fmt.Sprintf("[POST /strains][%d] postStrainsNotFound %+v", 404, o.Payload) +} + +func (o *PostStrainsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostStrainsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStrainsInternalServerError creates a PostStrainsInternalServerError with default headers values +func NewPostStrainsInternalServerError() *PostStrainsInternalServerError { + return &PostStrainsInternalServerError{} +} + +/*PostStrainsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostStrainsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PostStrainsInternalServerError) Error() string { + return fmt.Sprintf("[POST /strains][%d] postStrainsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostStrainsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PostStrainsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/strains/put_strains_parameters.go b/api/metrc-gw/metrc_gw_client/strains/put_strains_parameters.go new file mode 100644 index 0000000..46155fb --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/put_strains_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// NewPutStrainsParams creates a new PutStrainsParams object +// with the default values initialized. +func NewPutStrainsParams() *PutStrainsParams { + var () + return &PutStrainsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutStrainsParamsWithTimeout creates a new PutStrainsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutStrainsParamsWithTimeout(timeout time.Duration) *PutStrainsParams { + var () + return &PutStrainsParams{ + + timeout: timeout, + } +} + +// NewPutStrainsParamsWithContext creates a new PutStrainsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutStrainsParamsWithContext(ctx context.Context) *PutStrainsParams { + var () + return &PutStrainsParams{ + + Context: ctx, + } +} + +// NewPutStrainsParamsWithHTTPClient creates a new PutStrainsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutStrainsParamsWithHTTPClient(client *http.Client) *PutStrainsParams { + var () + return &PutStrainsParams{ + HTTPClient: client, + } +} + +/*PutStrainsParams contains all the parameters to send to the API endpoint +for the put strains operation typically these are written to a http.Request +*/ +type PutStrainsParams struct { + + /*StrainRequest + The Existing Strains with Ids + + */ + StrainRequest *metrc_gw_models.StrainRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put strains params +func (o *PutStrainsParams) WithTimeout(timeout time.Duration) *PutStrainsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put strains params +func (o *PutStrainsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put strains params +func (o *PutStrainsParams) WithContext(ctx context.Context) *PutStrainsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put strains params +func (o *PutStrainsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put strains params +func (o *PutStrainsParams) WithHTTPClient(client *http.Client) *PutStrainsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put strains params +func (o *PutStrainsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStrainRequest adds the strainRequest to the put strains params +func (o *PutStrainsParams) WithStrainRequest(strainRequest *metrc_gw_models.StrainRequest) *PutStrainsParams { + o.SetStrainRequest(strainRequest) + return o +} + +// SetStrainRequest adds the strainRequest to the put strains params +func (o *PutStrainsParams) SetStrainRequest(strainRequest *metrc_gw_models.StrainRequest) { + o.StrainRequest = strainRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutStrainsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StrainRequest != nil { + if err := r.SetBodyParam(o.StrainRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/strains/put_strains_responses.go b/api/metrc-gw/metrc_gw_client/strains/put_strains_responses.go new file mode 100644 index 0000000..378c8ad --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/put_strains_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// PutStrainsReader is a Reader for the PutStrains structure. +type PutStrainsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutStrainsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutStrainsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutStrainsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutStrainsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutStrainsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutStrainsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutStrainsOK creates a PutStrainsOK with default headers values +func NewPutStrainsOK() *PutStrainsOK { + return &PutStrainsOK{} +} + +/*PutStrainsOK handles this case with default header values. + +An array of Strain records +*/ +type PutStrainsOK struct { + Payload *metrc_gw_models.StrainResponse +} + +func (o *PutStrainsOK) Error() string { + return fmt.Sprintf("[PUT /strains][%d] putStrainsOK %+v", 200, o.Payload) +} + +func (o *PutStrainsOK) GetPayload() *metrc_gw_models.StrainResponse { + return o.Payload +} + +func (o *PutStrainsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.StrainResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutStrainsUnauthorized creates a PutStrainsUnauthorized with default headers values +func NewPutStrainsUnauthorized() *PutStrainsUnauthorized { + return &PutStrainsUnauthorized{} +} + +/*PutStrainsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutStrainsUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *PutStrainsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /strains][%d] putStrainsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutStrainsUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutStrainsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutStrainsForbidden creates a PutStrainsForbidden with default headers values +func NewPutStrainsForbidden() *PutStrainsForbidden { + return &PutStrainsForbidden{} +} + +/*PutStrainsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutStrainsForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *PutStrainsForbidden) Error() string { + return fmt.Sprintf("[PUT /strains][%d] putStrainsForbidden %+v", 403, o.Payload) +} + +func (o *PutStrainsForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutStrainsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutStrainsNotFound creates a PutStrainsNotFound with default headers values +func NewPutStrainsNotFound() *PutStrainsNotFound { + return &PutStrainsNotFound{} +} + +/*PutStrainsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutStrainsNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *PutStrainsNotFound) Error() string { + return fmt.Sprintf("[PUT /strains][%d] putStrainsNotFound %+v", 404, o.Payload) +} + +func (o *PutStrainsNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutStrainsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutStrainsInternalServerError creates a PutStrainsInternalServerError with default headers values +func NewPutStrainsInternalServerError() *PutStrainsInternalServerError { + return &PutStrainsInternalServerError{} +} + +/*PutStrainsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutStrainsInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *PutStrainsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /strains][%d] putStrainsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutStrainsInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *PutStrainsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/strains/strains_client.go b/api/metrc-gw/metrc_gw_client/strains/strains_client.go new file mode 100644 index 0000000..3e76b3e --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/strains/strains_client.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package strains + +// 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 strains API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for strains API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteStrain(params *DeleteStrainParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteStrainOK, error) + + GetStrains(params *GetStrainsParams, authInfo runtime.ClientAuthInfoWriter) (*GetStrainsOK, error) + + PostStrains(params *PostStrainsParams, authInfo runtime.ClientAuthInfoWriter) (*PostStrainsOK, error) + + PutStrains(params *PutStrainsParams, authInfo runtime.ClientAuthInfoWriter) (*PutStrainsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteStrain strains for this user license + + Delete a Strain for this User-License + +*/ +func (a *Client) DeleteStrain(params *DeleteStrainParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteStrainOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteStrainParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteStrain", + Method: "DELETE", + PathPattern: "/strains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteStrainReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteStrainOK) + 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 deleteStrain: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetStrains strains for this user license + + Get Strains for this User-License + +*/ +func (a *Client) GetStrains(params *GetStrainsParams, authInfo runtime.ClientAuthInfoWriter) (*GetStrainsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetStrainsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getStrains", + Method: "GET", + PathPattern: "/strains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetStrainsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetStrainsOK) + 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 getStrains: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostStrains creates new strains + + Create new Strains +*/ +func (a *Client) PostStrains(params *PostStrainsParams, authInfo runtime.ClientAuthInfoWriter) (*PostStrainsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostStrainsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postStrains", + Method: "POST", + PathPattern: "/strains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostStrainsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostStrainsOK) + 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 postStrains: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutStrains updates existing strains + + Update existing Strains +*/ +func (a *Client) PutStrains(params *PutStrainsParams, authInfo runtime.ClientAuthInfoWriter) (*PutStrainsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutStrainsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putStrains", + Method: "PUT", + PathPattern: "/strains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutStrainsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutStrainsOK) + 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 putStrains: 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/metrc-gw/metrc_gw_client/sys/get_metrics_parameters.go b/api/metrc-gw/metrc_gw_client/sys/get_metrics_parameters.go new file mode 100644 index 0000000..c3268a6 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sys/get_metrics_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sys + +// 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" +) + +// NewGetMetricsParams creates a new GetMetricsParams object +// with the default values initialized. +func NewGetMetricsParams() *GetMetricsParams { + + return &GetMetricsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetMetricsParamsWithTimeout creates a new GetMetricsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetMetricsParamsWithTimeout(timeout time.Duration) *GetMetricsParams { + + return &GetMetricsParams{ + + timeout: timeout, + } +} + +// NewGetMetricsParamsWithContext creates a new GetMetricsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetMetricsParamsWithContext(ctx context.Context) *GetMetricsParams { + + return &GetMetricsParams{ + + Context: ctx, + } +} + +// NewGetMetricsParamsWithHTTPClient creates a new GetMetricsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetMetricsParamsWithHTTPClient(client *http.Client) *GetMetricsParams { + + return &GetMetricsParams{ + HTTPClient: client, + } +} + +/*GetMetricsParams contains all the parameters to send to the API endpoint +for the get metrics operation typically these are written to a http.Request +*/ +type GetMetricsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get metrics params +func (o *GetMetricsParams) WithTimeout(timeout time.Duration) *GetMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get metrics params +func (o *GetMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get metrics params +func (o *GetMetricsParams) WithContext(ctx context.Context) *GetMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get metrics params +func (o *GetMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get metrics params +func (o *GetMetricsParams) WithHTTPClient(client *http.Client) *GetMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get metrics params +func (o *GetMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMetricsParams) 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/metrc-gw/metrc_gw_client/sys/get_metrics_responses.go b/api/metrc-gw/metrc_gw_client/sys/get_metrics_responses.go new file mode 100644 index 0000000..2d06efc --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sys/get_metrics_responses.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sys + +// 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" +) + +// GetMetricsReader is a Reader for the GetMetrics structure. +type GetMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetMetricsOK creates a GetMetricsOK with default headers values +func NewGetMetricsOK() *GetMetricsOK { + return &GetMetricsOK{} +} + +/*GetMetricsOK handles this case with default header values. + +OK +*/ +type GetMetricsOK struct { +} + +func (o *GetMetricsOK) Error() string { + return fmt.Sprintf("[GET /metrics][%d] getMetricsOK ", 200) +} + +func (o *GetMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/sys/sys_client.go b/api/metrc-gw/metrc_gw_client/sys/sys_client.go new file mode 100644 index 0000000..8f82fec --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/sys/sys_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sys + +// 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 sys API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for sys API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetMetrics(params *GetMetricsParams, authInfo runtime.ClientAuthInfoWriter) (*GetMetricsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetMetrics metrics scraper endpoint + + Provides application metrics to Prometheuus logging system +*/ +func (a *Client) GetMetrics(params *GetMetricsParams, authInfo runtime.ClientAuthInfoWriter) (*GetMetricsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMetricsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getMetrics", + Method: "GET", + PathPattern: "/metrics", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetMetricsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetMetricsOK) + 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 getMetrics: 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/metrc-gw/metrc_gw_client/transfers/get_transfers_parameters.go b/api/metrc-gw/metrc_gw_client/transfers/get_transfers_parameters.go new file mode 100644 index 0000000..891050f --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/transfers/get_transfers_parameters.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transfers + +// 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" +) + +// NewGetTransfersParams creates a new GetTransfersParams object +// with the default values initialized. +func NewGetTransfersParams() *GetTransfersParams { + var () + return &GetTransfersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTransfersParamsWithTimeout creates a new GetTransfersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTransfersParamsWithTimeout(timeout time.Duration) *GetTransfersParams { + var () + return &GetTransfersParams{ + + timeout: timeout, + } +} + +// NewGetTransfersParamsWithContext creates a new GetTransfersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTransfersParamsWithContext(ctx context.Context) *GetTransfersParams { + var () + return &GetTransfersParams{ + + Context: ctx, + } +} + +// NewGetTransfersParamsWithHTTPClient creates a new GetTransfersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTransfersParamsWithHTTPClient(client *http.Client) *GetTransfersParams { + var () + return &GetTransfersParams{ + HTTPClient: client, + } +} + +/*GetTransfersParams contains all the parameters to send to the API endpoint +for the get transfers operation typically these are written to a http.Request +*/ +type GetTransfersParams struct { + + /*Active + Get Active objects? + + */ + Active *bool + /*DeliveryID + The Sales Delivery Number + + */ + DeliveryID *string + /*ItemID + The Item Number + + */ + ItemID *float64 + /*Label + The METRC Package Label + + */ + Label *string + /*LastModifiedEnd + The last modified end timestamp + + */ + LastModifiedEnd *string + /*LastModifiedStart + The last modified start timestamp + + */ + LastModifiedStart *string + /*License + The Licnese Number for the query + + */ + License string + /*Onhold + Get On Hold objects? + + */ + Onhold *bool + /*PackageID + The METRC Package Number + + */ + PackageID *string + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get transfers params +func (o *GetTransfersParams) WithTimeout(timeout time.Duration) *GetTransfersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get transfers params +func (o *GetTransfersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get transfers params +func (o *GetTransfersParams) WithContext(ctx context.Context) *GetTransfersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get transfers params +func (o *GetTransfersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get transfers params +func (o *GetTransfersParams) WithHTTPClient(client *http.Client) *GetTransfersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get transfers params +func (o *GetTransfersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get transfers params +func (o *GetTransfersParams) WithActive(active *bool) *GetTransfersParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get transfers params +func (o *GetTransfersParams) SetActive(active *bool) { + o.Active = active +} + +// WithDeliveryID adds the deliveryID to the get transfers params +func (o *GetTransfersParams) WithDeliveryID(deliveryID *string) *GetTransfersParams { + o.SetDeliveryID(deliveryID) + return o +} + +// SetDeliveryID adds the deliveryId to the get transfers params +func (o *GetTransfersParams) SetDeliveryID(deliveryID *string) { + o.DeliveryID = deliveryID +} + +// WithItemID adds the itemID to the get transfers params +func (o *GetTransfersParams) WithItemID(itemID *float64) *GetTransfersParams { + o.SetItemID(itemID) + return o +} + +// SetItemID adds the itemId to the get transfers params +func (o *GetTransfersParams) SetItemID(itemID *float64) { + o.ItemID = itemID +} + +// WithLabel adds the label to the get transfers params +func (o *GetTransfersParams) WithLabel(label *string) *GetTransfersParams { + o.SetLabel(label) + return o +} + +// SetLabel adds the label to the get transfers params +func (o *GetTransfersParams) SetLabel(label *string) { + o.Label = label +} + +// WithLastModifiedEnd adds the lastModifiedEnd to the get transfers params +func (o *GetTransfersParams) WithLastModifiedEnd(lastModifiedEnd *string) *GetTransfersParams { + o.SetLastModifiedEnd(lastModifiedEnd) + return o +} + +// SetLastModifiedEnd adds the lastModifiedEnd to the get transfers params +func (o *GetTransfersParams) SetLastModifiedEnd(lastModifiedEnd *string) { + o.LastModifiedEnd = lastModifiedEnd +} + +// WithLastModifiedStart adds the lastModifiedStart to the get transfers params +func (o *GetTransfersParams) WithLastModifiedStart(lastModifiedStart *string) *GetTransfersParams { + o.SetLastModifiedStart(lastModifiedStart) + return o +} + +// SetLastModifiedStart adds the lastModifiedStart to the get transfers params +func (o *GetTransfersParams) SetLastModifiedStart(lastModifiedStart *string) { + o.LastModifiedStart = lastModifiedStart +} + +// WithLicense adds the license to the get transfers params +func (o *GetTransfersParams) WithLicense(license string) *GetTransfersParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get transfers params +func (o *GetTransfersParams) SetLicense(license string) { + o.License = license +} + +// WithOnhold adds the onhold to the get transfers params +func (o *GetTransfersParams) WithOnhold(onhold *bool) *GetTransfersParams { + o.SetOnhold(onhold) + return o +} + +// SetOnhold adds the onhold to the get transfers params +func (o *GetTransfersParams) SetOnhold(onhold *bool) { + o.Onhold = onhold +} + +// WithPackageID adds the packageID to the get transfers params +func (o *GetTransfersParams) WithPackageID(packageID *string) *GetTransfersParams { + o.SetPackageID(packageID) + return o +} + +// SetPackageID adds the packageId to the get transfers params +func (o *GetTransfersParams) SetPackageID(packageID *string) { + o.PackageID = packageID +} + +// WithProduction adds the production to the get transfers params +func (o *GetTransfersParams) WithProduction(production *bool) *GetTransfersParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get transfers params +func (o *GetTransfersParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get transfers params +func (o *GetTransfersParams) WithReseller(reseller string) *GetTransfersParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get transfers params +func (o *GetTransfersParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get transfers params +func (o *GetTransfersParams) WithState(state string) *GetTransfersParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get transfers params +func (o *GetTransfersParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get transfers params +func (o *GetTransfersParams) WithUser(user string) *GetTransfersParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get transfers params +func (o *GetTransfersParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTransfersParams) 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.DeliveryID != nil { + + // query param deliveryId + var qrDeliveryID string + if o.DeliveryID != nil { + qrDeliveryID = *o.DeliveryID + } + qDeliveryID := qrDeliveryID + if qDeliveryID != "" { + if err := r.SetQueryParam("deliveryId", qDeliveryID); err != nil { + return err + } + } + + } + + if o.ItemID != nil { + + // query param itemId + var qrItemID float64 + if o.ItemID != nil { + qrItemID = *o.ItemID + } + qItemID := swag.FormatFloat64(qrItemID) + if qItemID != "" { + if err := r.SetQueryParam("itemId", qItemID); err != nil { + return err + } + } + + } + + if o.Label != nil { + + // query param label + var qrLabel string + if o.Label != nil { + qrLabel = *o.Label + } + qLabel := qrLabel + if qLabel != "" { + if err := r.SetQueryParam("label", qLabel); err != nil { + return err + } + } + + } + + if o.LastModifiedEnd != nil { + + // query param lastModifiedEnd + var qrLastModifiedEnd string + if o.LastModifiedEnd != nil { + qrLastModifiedEnd = *o.LastModifiedEnd + } + qLastModifiedEnd := qrLastModifiedEnd + if qLastModifiedEnd != "" { + if err := r.SetQueryParam("lastModifiedEnd", qLastModifiedEnd); err != nil { + return err + } + } + + } + + if o.LastModifiedStart != nil { + + // query param lastModifiedStart + var qrLastModifiedStart string + if o.LastModifiedStart != nil { + qrLastModifiedStart = *o.LastModifiedStart + } + qLastModifiedStart := qrLastModifiedStart + if qLastModifiedStart != "" { + if err := r.SetQueryParam("lastModifiedStart", qLastModifiedStart); err != nil { + return err + } + } + + } + + // query param license + qrLicense := o.License + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + if o.Onhold != nil { + + // query param onhold + var qrOnhold bool + if o.Onhold != nil { + qrOnhold = *o.Onhold + } + qOnhold := swag.FormatBool(qrOnhold) + if qOnhold != "" { + if err := r.SetQueryParam("onhold", qOnhold); err != nil { + return err + } + } + + } + + if o.PackageID != nil { + + // query param packageId + var qrPackageID string + if o.PackageID != nil { + qrPackageID = *o.PackageID + } + qPackageID := qrPackageID + if qPackageID != "" { + if err := r.SetQueryParam("packageId", qPackageID); err != nil { + return err + } + } + + } + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/transfers/get_transfers_responses.go b/api/metrc-gw/metrc_gw_client/transfers/get_transfers_responses.go new file mode 100644 index 0000000..4925f50 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/transfers/get_transfers_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transfers + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetTransfersReader is a Reader for the GetTransfers structure. +type GetTransfersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTransfersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTransfersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTransfersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTransfersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTransfersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTransfersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTransfersOK creates a GetTransfersOK with default headers values +func NewGetTransfersOK() *GetTransfersOK { + return &GetTransfersOK{} +} + +/*GetTransfersOK handles this case with default header values. + +Transfers were successfully retrieved +*/ +type GetTransfersOK struct { + Payload *metrc_gw_models.TransferResponse +} + +func (o *GetTransfersOK) Error() string { + return fmt.Sprintf("[GET /transfers][%d] getTransfersOK %+v", 200, o.Payload) +} + +func (o *GetTransfersOK) GetPayload() *metrc_gw_models.TransferResponse { + return o.Payload +} + +func (o *GetTransfersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.TransferResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransfersUnauthorized creates a GetTransfersUnauthorized with default headers values +func NewGetTransfersUnauthorized() *GetTransfersUnauthorized { + return &GetTransfersUnauthorized{} +} + +/*GetTransfersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTransfersUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetTransfersUnauthorized) Error() string { + return fmt.Sprintf("[GET /transfers][%d] getTransfersUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTransfersUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetTransfersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransfersForbidden creates a GetTransfersForbidden with default headers values +func NewGetTransfersForbidden() *GetTransfersForbidden { + return &GetTransfersForbidden{} +} + +/*GetTransfersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTransfersForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetTransfersForbidden) Error() string { + return fmt.Sprintf("[GET /transfers][%d] getTransfersForbidden %+v", 403, o.Payload) +} + +func (o *GetTransfersForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetTransfersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransfersNotFound creates a GetTransfersNotFound with default headers values +func NewGetTransfersNotFound() *GetTransfersNotFound { + return &GetTransfersNotFound{} +} + +/*GetTransfersNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTransfersNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetTransfersNotFound) Error() string { + return fmt.Sprintf("[GET /transfers][%d] getTransfersNotFound %+v", 404, o.Payload) +} + +func (o *GetTransfersNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetTransfersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransfersInternalServerError creates a GetTransfersInternalServerError with default headers values +func NewGetTransfersInternalServerError() *GetTransfersInternalServerError { + return &GetTransfersInternalServerError{} +} + +/*GetTransfersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTransfersInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetTransfersInternalServerError) Error() string { + return fmt.Sprintf("[GET /transfers][%d] getTransfersInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTransfersInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetTransfersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/transfers/transfers_client.go b/api/metrc-gw/metrc_gw_client/transfers/transfers_client.go new file mode 100644 index 0000000..2eb0dbe --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/transfers/transfers_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transfers + +// 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 transfers API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for transfers API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTransfers(params *GetTransfersParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransfersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTransfers transfers for this user license + + Get Transfers for this User-License + +*/ +func (a *Client) GetTransfers(params *GetTransfersParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransfersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTransfersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTransfers", + Method: "GET", + PathPattern: "/transfers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTransfersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTransfersOK) + 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 getTransfers: 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/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_parameters.go b/api/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_parameters.go new file mode 100644 index 0000000..6b4f2b8 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_parameters.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package units_of_measure + +// 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" +) + +// NewGetUnitsOfMeasureParams creates a new GetUnitsOfMeasureParams object +// with the default values initialized. +func NewGetUnitsOfMeasureParams() *GetUnitsOfMeasureParams { + var () + return &GetUnitsOfMeasureParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUnitsOfMeasureParamsWithTimeout creates a new GetUnitsOfMeasureParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUnitsOfMeasureParamsWithTimeout(timeout time.Duration) *GetUnitsOfMeasureParams { + var () + return &GetUnitsOfMeasureParams{ + + timeout: timeout, + } +} + +// NewGetUnitsOfMeasureParamsWithContext creates a new GetUnitsOfMeasureParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUnitsOfMeasureParamsWithContext(ctx context.Context) *GetUnitsOfMeasureParams { + var () + return &GetUnitsOfMeasureParams{ + + Context: ctx, + } +} + +// NewGetUnitsOfMeasureParamsWithHTTPClient creates a new GetUnitsOfMeasureParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUnitsOfMeasureParamsWithHTTPClient(client *http.Client) *GetUnitsOfMeasureParams { + var () + return &GetUnitsOfMeasureParams{ + HTTPClient: client, + } +} + +/*GetUnitsOfMeasureParams contains all the parameters to send to the API endpoint +for the get units of measure operation typically these are written to a http.Request +*/ +type GetUnitsOfMeasureParams struct { + + /*Production + Use Production API? + + */ + Production *bool + /*Reseller + The METRC Reseller Key + + */ + Reseller string + /*State + The 2-character State Code + + */ + State string + /*User + The METRC User Key + + */ + User string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get units of measure params +func (o *GetUnitsOfMeasureParams) WithTimeout(timeout time.Duration) *GetUnitsOfMeasureParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get units of measure params +func (o *GetUnitsOfMeasureParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get units of measure params +func (o *GetUnitsOfMeasureParams) WithContext(ctx context.Context) *GetUnitsOfMeasureParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get units of measure params +func (o *GetUnitsOfMeasureParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get units of measure params +func (o *GetUnitsOfMeasureParams) WithHTTPClient(client *http.Client) *GetUnitsOfMeasureParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get units of measure params +func (o *GetUnitsOfMeasureParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProduction adds the production to the get units of measure params +func (o *GetUnitsOfMeasureParams) WithProduction(production *bool) *GetUnitsOfMeasureParams { + o.SetProduction(production) + return o +} + +// SetProduction adds the production to the get units of measure params +func (o *GetUnitsOfMeasureParams) SetProduction(production *bool) { + o.Production = production +} + +// WithReseller adds the reseller to the get units of measure params +func (o *GetUnitsOfMeasureParams) WithReseller(reseller string) *GetUnitsOfMeasureParams { + o.SetReseller(reseller) + return o +} + +// SetReseller adds the reseller to the get units of measure params +func (o *GetUnitsOfMeasureParams) SetReseller(reseller string) { + o.Reseller = reseller +} + +// WithState adds the state to the get units of measure params +func (o *GetUnitsOfMeasureParams) WithState(state string) *GetUnitsOfMeasureParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get units of measure params +func (o *GetUnitsOfMeasureParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get units of measure params +func (o *GetUnitsOfMeasureParams) WithUser(user string) *GetUnitsOfMeasureParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get units of measure params +func (o *GetUnitsOfMeasureParams) SetUser(user string) { + o.User = user +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUnitsOfMeasureParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Production != nil { + + // query param production + var qrProduction bool + if o.Production != nil { + qrProduction = *o.Production + } + qProduction := swag.FormatBool(qrProduction) + if qProduction != "" { + if err := r.SetQueryParam("production", qProduction); err != nil { + return err + } + } + + } + + // query param reseller + qrReseller := o.Reseller + qReseller := qrReseller + if qReseller != "" { + if err := r.SetQueryParam("reseller", qReseller); err != nil { + return err + } + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_responses.go b/api/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_responses.go new file mode 100644 index 0000000..78675a2 --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/units_of_measure/get_units_of_measure_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package units_of_measure + +// 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" + + "github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models" +) + +// GetUnitsOfMeasureReader is a Reader for the GetUnitsOfMeasure structure. +type GetUnitsOfMeasureReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUnitsOfMeasureReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUnitsOfMeasureOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUnitsOfMeasureUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUnitsOfMeasureForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUnitsOfMeasureNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUnitsOfMeasureInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetUnitsOfMeasureOK creates a GetUnitsOfMeasureOK with default headers values +func NewGetUnitsOfMeasureOK() *GetUnitsOfMeasureOK { + return &GetUnitsOfMeasureOK{} +} + +/*GetUnitsOfMeasureOK handles this case with default header values. + +A list of Units of Measure was succefully retrieved +*/ +type GetUnitsOfMeasureOK struct { + Payload *metrc_gw_models.UnitsOfMeasureResponse +} + +func (o *GetUnitsOfMeasureOK) Error() string { + return fmt.Sprintf("[GET /unitsofmeasure][%d] getUnitsOfMeasureOK %+v", 200, o.Payload) +} + +func (o *GetUnitsOfMeasureOK) GetPayload() *metrc_gw_models.UnitsOfMeasureResponse { + return o.Payload +} + +func (o *GetUnitsOfMeasureOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.UnitsOfMeasureResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUnitsOfMeasureUnauthorized creates a GetUnitsOfMeasureUnauthorized with default headers values +func NewGetUnitsOfMeasureUnauthorized() *GetUnitsOfMeasureUnauthorized { + return &GetUnitsOfMeasureUnauthorized{} +} + +/*GetUnitsOfMeasureUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetUnitsOfMeasureUnauthorized struct { + Payload *metrc_gw_models.Error +} + +func (o *GetUnitsOfMeasureUnauthorized) Error() string { + return fmt.Sprintf("[GET /unitsofmeasure][%d] getUnitsOfMeasureUnauthorized %+v", 401, o.Payload) +} + +func (o *GetUnitsOfMeasureUnauthorized) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetUnitsOfMeasureUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUnitsOfMeasureForbidden creates a GetUnitsOfMeasureForbidden with default headers values +func NewGetUnitsOfMeasureForbidden() *GetUnitsOfMeasureForbidden { + return &GetUnitsOfMeasureForbidden{} +} + +/*GetUnitsOfMeasureForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetUnitsOfMeasureForbidden struct { + Payload *metrc_gw_models.Error +} + +func (o *GetUnitsOfMeasureForbidden) Error() string { + return fmt.Sprintf("[GET /unitsofmeasure][%d] getUnitsOfMeasureForbidden %+v", 403, o.Payload) +} + +func (o *GetUnitsOfMeasureForbidden) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetUnitsOfMeasureForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUnitsOfMeasureNotFound creates a GetUnitsOfMeasureNotFound with default headers values +func NewGetUnitsOfMeasureNotFound() *GetUnitsOfMeasureNotFound { + return &GetUnitsOfMeasureNotFound{} +} + +/*GetUnitsOfMeasureNotFound handles this case with default header values. + +Resource was not found +*/ +type GetUnitsOfMeasureNotFound struct { + Payload *metrc_gw_models.Error +} + +func (o *GetUnitsOfMeasureNotFound) Error() string { + return fmt.Sprintf("[GET /unitsofmeasure][%d] getUnitsOfMeasureNotFound %+v", 404, o.Payload) +} + +func (o *GetUnitsOfMeasureNotFound) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetUnitsOfMeasureNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUnitsOfMeasureInternalServerError creates a GetUnitsOfMeasureInternalServerError with default headers values +func NewGetUnitsOfMeasureInternalServerError() *GetUnitsOfMeasureInternalServerError { + return &GetUnitsOfMeasureInternalServerError{} +} + +/*GetUnitsOfMeasureInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetUnitsOfMeasureInternalServerError struct { + Payload *metrc_gw_models.Error +} + +func (o *GetUnitsOfMeasureInternalServerError) Error() string { + return fmt.Sprintf("[GET /unitsofmeasure][%d] getUnitsOfMeasureInternalServerError %+v", 500, o.Payload) +} + +func (o *GetUnitsOfMeasureInternalServerError) GetPayload() *metrc_gw_models.Error { + return o.Payload +} + +func (o *GetUnitsOfMeasureInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(metrc_gw_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/metrc-gw/metrc_gw_client/units_of_measure/units_of_measure_client.go b/api/metrc-gw/metrc_gw_client/units_of_measure/units_of_measure_client.go new file mode 100644 index 0000000..6dd0f3f --- /dev/null +++ b/api/metrc-gw/metrc_gw_client/units_of_measure/units_of_measure_client.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package units_of_measure + +// 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 units of measure API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for units of measure API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetUnitsOfMeasure(params *GetUnitsOfMeasureParams, authInfo runtime.ClientAuthInfoWriter) (*GetUnitsOfMeasureOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetUnitsOfMeasure units of measure + + Units of Measure + +*/ +func (a *Client) GetUnitsOfMeasure(params *GetUnitsOfMeasureParams, authInfo runtime.ClientAuthInfoWriter) (*GetUnitsOfMeasureOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUnitsOfMeasureParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getUnitsOfMeasure", + Method: "GET", + PathPattern: "/unitsofmeasure", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetUnitsOfMeasureReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetUnitsOfMeasureOK) + 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 getUnitsOfMeasure: 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/metrc-gw/metrc_gw_models/customer_type.go b/api/metrc-gw/metrc_gw_models/customer_type.go new file mode 100644 index 0000000..9194fe7 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/customer_type.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CustomerType customer type +// +// swagger:model CustomerType +type CustomerType struct { + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this customer type +func (m *CustomerType) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CustomerType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CustomerType) UnmarshalBinary(b []byte) error { + var res CustomerType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/customer_type_response.go b/api/metrc-gw/metrc_gw_models/customer_type_response.go new file mode 100644 index 0000000..9805d47 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/customer_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CustomerTypeResponse customer type response +// +// swagger:model CustomerTypeResponse +type CustomerTypeResponse struct { + + // data + Data []*CustomerType `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this customer type response +func (m *CustomerTypeResponse) 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 *CustomerTypeResponse) 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 *CustomerTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CustomerTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CustomerTypeResponse) UnmarshalBinary(b []byte) error { + var res CustomerTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/error.go b/api/metrc-gw/metrc_gw_models/error.go new file mode 100644 index 0000000..a675dd0 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/error.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // error + Error string `json:"error,omitempty"` + + // status + // Maximum: 600 + // Minimum: 100 + Status int64 `json:"status,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Error) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := validate.MinimumInt("status", "body", int64(m.Status), 100, false); err != nil { + return err + } + + if err := validate.MaximumInt("status", "body", int64(m.Status), 600, false); err != nil { + return err + } + + 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/metrc-gw/metrc_gw_models/facility.go b/api/metrc-gw/metrc_gw_models/facility.go new file mode 100644 index 0000000..c9ed5cd --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/facility.go @@ -0,0 +1,270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Facility facility +// +// swagger:model Facility +type Facility struct { + + // alias + Alias string `json:"Alias,omitempty"` + + // credentialed date + CredentialedDate string `json:"CredentialedDate,omitempty"` + + // display name + DisplayName string `json:"DisplayName,omitempty"` + + // facility type + FacilityType *FacilityFacilityType `json:"FacilityType,omitempty"` + + // hire date + HireDate string `json:"HireDate,omitempty"` + + // is manager + IsManager bool `json:"IsManager,omitempty"` + + // is owner + IsOwner bool `json:"IsOwner,omitempty"` + + // license + License *License `json:"License,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // occupations + Occupations []string `json:"Occupations"` +} + +// Validate validates this facility +func (m *Facility) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFacilityType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLicense(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Facility) validateFacilityType(formats strfmt.Registry) error { + + if swag.IsZero(m.FacilityType) { // not required + return nil + } + + if m.FacilityType != nil { + if err := m.FacilityType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("FacilityType") + } + return err + } + } + + return nil +} + +func (m *Facility) validateLicense(formats strfmt.Registry) error { + + if swag.IsZero(m.License) { // not required + return nil + } + + if m.License != nil { + if err := m.License.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("License") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Facility) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Facility) UnmarshalBinary(b []byte) error { + var res Facility + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// FacilityFacilityType facility facility type +// +// swagger:model FacilityFacilityType +type FacilityFacilityType struct { + + // advanced sales + AdvancedSales bool `json:"AdvancedSales,omitempty"` + + // can assign rooms to packages + CanAssignRoomsToPackages bool `json:"CanAssignRoomsToPackages,omitempty"` + + // can assign rooms to plant batches + CanAssignRoomsToPlantBatches bool `json:"CanAssignRoomsToPlantBatches,omitempty"` + + // can create derived packages + CanCreateDerivedPackages bool `json:"CanCreateDerivedPackages,omitempty"` + + // can create opening balance packages + CanCreateOpeningBalancePackages bool `json:"CanCreateOpeningBalancePackages,omitempty"` + + // can create process validation packages + CanCreateProcessValidationPackages bool `json:"CanCreateProcessValidationPackages,omitempty"` + + // can deliver sales to consumers + CanDeliverSalesToConsumers bool `json:"CanDeliverSalesToConsumers,omitempty"` + + // can deliver sales to patients + CanDeliverSalesToPatients bool `json:"CanDeliverSalesToPatients,omitempty"` + + // can grow plants + CanGrowPlants bool `json:"CanGrowPlants,omitempty"` + + // can have member patients + CanHaveMemberPatients bool `json:"CanHaveMemberPatients,omitempty"` + + // can infuse products + CanInfuseProducts bool `json:"CanInfuseProducts,omitempty"` + + // can package vegetative plants + CanPackageVegetativePlants bool `json:"CanPackageVegetativePlants,omitempty"` + + // can remediate packages with failed lab results + CanRemediatePackagesWithFailedLabResults bool `json:"CanRemediatePackagesWithFailedLabResults,omitempty"` + + // can report harvest schedules + CanReportHarvestSchedules bool `json:"CanReportHarvestSchedules,omitempty"` + + // can report patients adverse responses + CanReportPatientsAdverseResponses bool `json:"CanReportPatientsAdverseResponses,omitempty"` + + // can request product remediation + CanRequestProductRemediation bool `json:"CanRequestProductRemediation,omitempty"` + + // can require harvest sample lab test batches + CanRequireHarvestSampleLabTestBatches bool `json:"CanRequireHarvestSampleLabTestBatches,omitempty"` + + // can require package sample lab test batches + CanRequirePackageSampleLabTestBatches bool `json:"CanRequirePackageSampleLabTestBatches,omitempty"` + + // can sell to caregivers + CanSellToCaregivers bool `json:"CanSellToCaregivers,omitempty"` + + // can sell to consumers + CanSellToConsumers bool `json:"CanSellToConsumers,omitempty"` + + // can sell to external patients + CanSellToExternalPatients bool `json:"CanSellToExternalPatients,omitempty"` + + // can sell to patients + CanSellToPatients bool `json:"CanSellToPatients,omitempty"` + + // can submit harvests for testing + CanSubmitHarvestsForTesting bool `json:"CanSubmitHarvestsForTesting,omitempty"` + + // can submit packages for testing + CanSubmitPackagesForTesting bool `json:"CanSubmitPackagesForTesting,omitempty"` + + // can tag plant batches + CanTagPlantBatches bool `json:"CanTagPlantBatches,omitempty"` + + // can test packages + CanTestPackages bool `json:"CanTestPackages,omitempty"` + + // can track vegetative plants + CanTrackVegetativePlants bool `json:"CanTrackVegetativePlants,omitempty"` + + // can transfer from external facilities + CanTransferFromExternalFacilities bool `json:"CanTransferFromExternalFacilities,omitempty"` + + // can update plant strains + CanUpdatePlantStrains bool `json:"CanUpdatePlantStrains,omitempty"` + + // is medical + IsMedical bool `json:"IsMedical,omitempty"` + + // is retail + IsRetail bool `json:"IsRetail,omitempty"` + + // packages require patient affiliation + PackagesRequirePatientAffiliation bool `json:"PackagesRequirePatientAffiliation,omitempty"` + + // plants require patient affiliation + PlantsRequirePatientAffiliation bool `json:"PlantsRequirePatientAffiliation,omitempty"` + + // sales delivery require patient number + SalesDeliveryRequirePatientNumber bool `json:"SalesDeliveryRequirePatientNumber,omitempty"` + + // sales require caregiver number + SalesRequireCaregiverNumber bool `json:"SalesRequireCaregiverNumber,omitempty"` + + // sales require caregiver patient number + SalesRequireCaregiverPatientNumber bool `json:"SalesRequireCaregiverPatientNumber,omitempty"` + + // sales require external patient identification method + SalesRequireExternalPatientIdentificationMethod bool `json:"SalesRequireExternalPatientIdentificationMethod,omitempty"` + + // sales require external patient number + SalesRequireExternalPatientNumber bool `json:"SalesRequireExternalPatientNumber,omitempty"` + + // sales require patient number + SalesRequirePatientNumber bool `json:"SalesRequirePatientNumber,omitempty"` +} + +// Validate validates this facility facility type +func (m *FacilityFacilityType) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FacilityFacilityType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FacilityFacilityType) UnmarshalBinary(b []byte) error { + var res FacilityFacilityType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/facility_response.go b/api/metrc-gw/metrc_gw_models/facility_response.go new file mode 100644 index 0000000..7e77f05 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/facility_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FacilityResponse facility response +// +// swagger:model FacilityResponse +type FacilityResponse struct { + + // data + Data []*Facility `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this facility response +func (m *FacilityResponse) 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 *FacilityResponse) 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 *FacilityResponse) 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 +} + +// MarshalBinary interface implementation +func (m *FacilityResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FacilityResponse) UnmarshalBinary(b []byte) error { + var res FacilityResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest.go b/api/metrc-gw/metrc_gw_models/harvest.go new file mode 100644 index 0000000..a3733da --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Harvest harvest +// +// swagger:model Harvest +type Harvest struct { + + // current weight + CurrentWeight float64 `json:"CurrentWeight,omitempty"` + + // drying room Id + DryingRoomID float64 `json:"DryingRoomId,omitempty"` + + // drying room name + DryingRoomName string `json:"DryingRoomName,omitempty"` + + // harvest start date + HarvestStartDate string `json:"HarvestStartDate,omitempty"` + + // harvest type + HarvestType string `json:"HarvestType,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // is on hold + IsOnHold bool `json:"IsOnHold,omitempty"` + + // last modified + LastModified string `json:"LastModified,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // package count + PackageCount float64 `json:"PackageCount,omitempty"` + + // plant count + PlantCount float64 `json:"PlantCount,omitempty"` + + // source strain count + SourceStrainCount float64 `json:"SourceStrainCount,omitempty"` + + // total packaged weight + TotalPackagedWeight float64 `json:"TotalPackagedWeight,omitempty"` + + // total restored weight + TotalRestoredWeight float64 `json:"TotalRestoredWeight,omitempty"` + + // total waste weight + TotalWasteWeight float64 `json:"TotalWasteWeight,omitempty"` + + // total wet weight + TotalWetWeight float64 `json:"TotalWetWeight,omitempty"` + + // unit of weight name + UnitOfWeightName string `json:"UnitOfWeightName,omitempty"` +} + +// Validate validates this harvest +func (m *Harvest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Harvest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Harvest) UnmarshalBinary(b []byte) error { + var res Harvest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_package.go b/api/metrc-gw/metrc_gw_models/harvest_package.go new file mode 100644 index 0000000..e0e93de --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_package.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestPackage harvest package +// +// swagger:model HarvestPackage +type HarvestPackage struct { + + // actual date + ActualDate string `json:"ActualDate,omitempty"` + + // ingredients + Ingredients []*HarvestPackageIngredient `json:"Ingredients"` + + // is production batch + IsProductionBatch bool `json:"IsProductionBatch,omitempty"` + + // item + Item string `json:"Item,omitempty"` + + // patient license number + PatientLicenseNumber string `json:"PatientLicenseNumber,omitempty"` + + // product requires remediation + ProductRequiresRemediation bool `json:"ProductRequiresRemediation,omitempty"` + + // production batch number + ProductionBatchNumber string `json:"ProductionBatchNumber,omitempty"` + + // remediate product + RemediateProduct bool `json:"RemediateProduct,omitempty"` + + // remediation date + RemediationDate string `json:"RemediationDate,omitempty"` + + // remediation method Id + RemediationMethodID string `json:"RemediationMethodId,omitempty"` + + // remediation steps + RemediationSteps string `json:"RemediationSteps,omitempty"` + + // room + Room string `json:"Room,omitempty"` + + // tag + Tag string `json:"Tag,omitempty"` + + // unit of weight + UnitOfWeight string `json:"UnitOfWeight,omitempty"` +} + +// Validate validates this harvest package +func (m *HarvestPackage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIngredients(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HarvestPackage) validateIngredients(formats strfmt.Registry) error { + + if swag.IsZero(m.Ingredients) { // not required + return nil + } + + for i := 0; i < len(m.Ingredients); i++ { + if swag.IsZero(m.Ingredients[i]) { // not required + continue + } + + if m.Ingredients[i] != nil { + if err := m.Ingredients[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Ingredients" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HarvestPackage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestPackage) UnmarshalBinary(b []byte) error { + var res HarvestPackage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_package_ingredient.go b/api/metrc-gw/metrc_gw_models/harvest_package_ingredient.go new file mode 100644 index 0000000..b31366b --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_package_ingredient.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestPackageIngredient harvest package ingredient +// +// swagger:model HarvestPackageIngredient +type HarvestPackageIngredient struct { + + // harvest Id + HarvestID float64 `json:"HarvestId,omitempty"` + + // harvest name + HarvestName string `json:"HarvestName,omitempty"` + + // unit of weight + UnitOfWeight string `json:"UnitOfWeight,omitempty"` + + // weight + Weight float64 `json:"Weight,omitempty"` +} + +// Validate validates this harvest package ingredient +func (m *HarvestPackageIngredient) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HarvestPackageIngredient) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestPackageIngredient) UnmarshalBinary(b []byte) error { + var res HarvestPackageIngredient + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_package_request.go b/api/metrc-gw/metrc_gw_models/harvest_package_request.go new file mode 100644 index 0000000..d81c25b --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_package_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestPackageRequest harvest package request +// +// swagger:model HarvestPackageRequest +type HarvestPackageRequest struct { + + // data + Data []*HarvestPackage `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this harvest package request +func (m *HarvestPackageRequest) 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 *HarvestPackageRequest) 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 *HarvestPackageRequest) 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 +} + +// MarshalBinary interface implementation +func (m *HarvestPackageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestPackageRequest) UnmarshalBinary(b []byte) error { + var res HarvestPackageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_response.go b/api/metrc-gw/metrc_gw_models/harvest_response.go new file mode 100644 index 0000000..d418bdd --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestResponse harvest response +// +// swagger:model HarvestResponse +type HarvestResponse struct { + + // data + Data []*Harvest `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this harvest response +func (m *HarvestResponse) 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 *HarvestResponse) 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 *HarvestResponse) 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 +} + +// MarshalBinary interface implementation +func (m *HarvestResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestResponse) UnmarshalBinary(b []byte) error { + var res HarvestResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_update.go b/api/metrc-gw/metrc_gw_models/harvest_update.go new file mode 100644 index 0000000..2ec0c45 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_update.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestUpdate harvest update +// +// swagger:model HarvestUpdate +type HarvestUpdate struct { + + // actual date + ActualDate string `json:"ActualDate,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // unit of weight + UnitOfWeight string `json:"UnitOfWeight,omitempty"` + + // waste type + WasteType string `json:"WasteType,omitempty"` + + // waste weight + WasteWeight float64 `json:"WasteWeight,omitempty"` + + // operation Id + OperationID string `json:"operationId,omitempty"` +} + +// Validate validates this harvest update +func (m *HarvestUpdate) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HarvestUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestUpdate) UnmarshalBinary(b []byte) error { + var res HarvestUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_update_request.go b/api/metrc-gw/metrc_gw_models/harvest_update_request.go new file mode 100644 index 0000000..9d87c28 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_update_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestUpdateRequest harvest update request +// +// swagger:model HarvestUpdateRequest +type HarvestUpdateRequest struct { + + // data + Data []*HarvestUpdate `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this harvest update request +func (m *HarvestUpdateRequest) 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 *HarvestUpdateRequest) 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 *HarvestUpdateRequest) 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 +} + +// MarshalBinary interface implementation +func (m *HarvestUpdateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestUpdateRequest) UnmarshalBinary(b []byte) error { + var res HarvestUpdateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_update_response.go b/api/metrc-gw/metrc_gw_models/harvest_update_response.go new file mode 100644 index 0000000..d3cf19f --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_update_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestUpdateResponse harvest update response +// +// swagger:model HarvestUpdateResponse +type HarvestUpdateResponse struct { + + // data + Data []*HarvestUpdate `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this harvest update response +func (m *HarvestUpdateResponse) 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 *HarvestUpdateResponse) 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 *HarvestUpdateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *HarvestUpdateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestUpdateResponse) UnmarshalBinary(b []byte) error { + var res HarvestUpdateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_waste_type.go b/api/metrc-gw/metrc_gw_models/harvest_waste_type.go new file mode 100644 index 0000000..9bd1781 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_waste_type.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestWasteType harvest waste type +// +// swagger:model HarvestWasteType +type HarvestWasteType struct { + + // name + Name string `json:"Name,omitempty"` +} + +// Validate validates this harvest waste type +func (m *HarvestWasteType) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HarvestWasteType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestWasteType) UnmarshalBinary(b []byte) error { + var res HarvestWasteType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/harvest_waste_type_response.go b/api/metrc-gw/metrc_gw_models/harvest_waste_type_response.go new file mode 100644 index 0000000..fbd3532 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/harvest_waste_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HarvestWasteTypeResponse harvest waste type response +// +// swagger:model HarvestWasteTypeResponse +type HarvestWasteTypeResponse struct { + + // data + Data []*HarvestWasteType `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this harvest waste type response +func (m *HarvestWasteTypeResponse) 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 *HarvestWasteTypeResponse) 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 *HarvestWasteTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *HarvestWasteTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HarvestWasteTypeResponse) UnmarshalBinary(b []byte) error { + var res HarvestWasteTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/invalid_error.go b/api/metrc-gw/metrc_gw_models/invalid_error.go new file mode 100644 index 0000000..392d68b --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/metrc-gw/metrc_gw_models/item.go b/api/metrc-gw/metrc_gw_models/item.go new file mode 100644 index 0000000..e2560e8 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/item.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Item item +// +// swagger:model Item +type Item struct { + + // administration method + AdministrationMethod string `json:"AdministrationMethod,omitempty"` + + // approval status + ApprovalStatus string `json:"ApprovalStatus,omitempty"` + + // default lab testing state + DefaultLabTestingState string `json:"DefaultLabTestingState,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // ingredients + Ingredients string `json:"Ingredients,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // product category name + ProductCategoryName string `json:"ProductCategoryName,omitempty"` + + // product category type + ProductCategoryType string `json:"ProductCategoryType,omitempty"` + + // quantity type + QuantityType string `json:"QuantityType,omitempty"` + + // serving size + ServingSize string `json:"ServingSize,omitempty"` + + // unit of measure name + UnitOfMeasureName string `json:"UnitOfMeasureName,omitempty"` + + // unit weight + UnitWeight float64 `json:"UnitWeight,omitempty"` + + // unit weight unit of measure name + UnitWeightUnitOfMeasureName string `json:"UnitWeightUnitOfMeasureName,omitempty"` +} + +// Validate validates this item +func (m *Item) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Item) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Item) UnmarshalBinary(b []byte) error { + var res Item + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/item_request.go b/api/metrc-gw/metrc_gw_models/item_request.go new file mode 100644 index 0000000..032d354 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/item_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ItemRequest item request +// +// swagger:model ItemRequest +type ItemRequest struct { + + // data + Data []*Item `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this item request +func (m *ItemRequest) 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 *ItemRequest) 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 *ItemRequest) 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 +} + +// MarshalBinary interface implementation +func (m *ItemRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ItemRequest) UnmarshalBinary(b []byte) error { + var res ItemRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/item_response.go b/api/metrc-gw/metrc_gw_models/item_response.go new file mode 100644 index 0000000..d175935 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/item_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ItemResponse item response +// +// swagger:model ItemResponse +type ItemResponse struct { + + // data + Data []*Item `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this item response +func (m *ItemResponse) 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 *ItemResponse) 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 *ItemResponse) 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 +} + +// MarshalBinary interface implementation +func (m *ItemResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ItemResponse) UnmarshalBinary(b []byte) error { + var res ItemResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/lab_test_state.go b/api/metrc-gw/metrc_gw_models/lab_test_state.go new file mode 100644 index 0000000..cc4ae13 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/lab_test_state.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LabTestState lab test state +// +// swagger:model LabTestState +type LabTestState struct { + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this lab test state +func (m *LabTestState) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LabTestState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LabTestState) UnmarshalBinary(b []byte) error { + var res LabTestState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/lab_test_state_response.go b/api/metrc-gw/metrc_gw_models/lab_test_state_response.go new file mode 100644 index 0000000..3adc945 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/lab_test_state_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LabTestStateResponse lab test state response +// +// swagger:model LabTestStateResponse +type LabTestStateResponse struct { + + // data + Data []*LabTestState `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this lab test state response +func (m *LabTestStateResponse) 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 *LabTestStateResponse) 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 *LabTestStateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *LabTestStateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LabTestStateResponse) UnmarshalBinary(b []byte) error { + var res LabTestStateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/lab_test_type.go b/api/metrc-gw/metrc_gw_models/lab_test_type.go new file mode 100644 index 0000000..7e3c04e --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/lab_test_type.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LabTestType lab test type +// +// swagger:model LabTestType +type LabTestType struct { + + // always passes + AlwaysPasses bool `json:"AlwaysPasses,omitempty"` + + // dependency mode + DependencyMode float64 `json:"DependencyMode,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // requires test result + RequiresTestResult bool `json:"RequiresTestResult,omitempty"` +} + +// Validate validates this lab test type +func (m *LabTestType) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LabTestType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LabTestType) UnmarshalBinary(b []byte) error { + var res LabTestType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/lab_test_type_response.go b/api/metrc-gw/metrc_gw_models/lab_test_type_response.go new file mode 100644 index 0000000..3aecba9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/lab_test_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LabTestTypeResponse lab test type response +// +// swagger:model LabTestTypeResponse +type LabTestTypeResponse struct { + + // data + Data []*LabTestType `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this lab test type response +func (m *LabTestTypeResponse) 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 *LabTestTypeResponse) 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 *LabTestTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *LabTestTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LabTestTypeResponse) UnmarshalBinary(b []byte) error { + var res LabTestTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/license.go b/api/metrc-gw/metrc_gw_models/license.go new file mode 100644 index 0000000..23cd2b9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/license.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// License license +// +// swagger:model License +type License struct { + + // end date + // Required: true + EndDate *string `json:"EndDate"` + + // license type + // Required: true + LicenseType *string `json:"LicenseType"` + + // number + // Required: true + Number *string `json:"Number"` + + // start date + // Required: true + StartDate *string `json:"StartDate"` +} + +// Validate validates this license +func (m *License) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLicenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNumber(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *License) validateEndDate(formats strfmt.Registry) error { + + if err := validate.Required("EndDate", "body", m.EndDate); err != nil { + return err + } + + return nil +} + +func (m *License) validateLicenseType(formats strfmt.Registry) error { + + if err := validate.Required("LicenseType", "body", m.LicenseType); err != nil { + return err + } + + return nil +} + +func (m *License) validateNumber(formats strfmt.Registry) error { + + if err := validate.Required("Number", "body", m.Number); err != nil { + return err + } + + return nil +} + +func (m *License) validateStartDate(formats strfmt.Registry) error { + + if err := validate.Required("StartDate", "body", m.StartDate); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *License) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *License) UnmarshalBinary(b []byte) error { + var res License + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/package.go b/api/metrc-gw/metrc_gw_models/package.go new file mode 100644 index 0000000..49099e6 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/package.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Package package +// +// swagger:model Package +type Package struct { + + // archived date + ArchivedDate string `json:"ArchivedDate,omitempty"` + + // contains remediated product + ContainsRemediatedProduct bool `json:"ContainsRemediatedProduct,omitempty"` + + // finished date + FinishedDate string `json:"FinishedDate,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // initial lab testing state + InitialLabTestingState string `json:"InitialLabTestingState,omitempty"` + + // is on hold + IsOnHold bool `json:"IsOnHold,omitempty"` + + // is process validation testing sample + IsProcessValidationTestingSample bool `json:"IsProcessValidationTestingSample,omitempty"` + + // is production batch + IsProductionBatch bool `json:"IsProductionBatch,omitempty"` + + // is testing sample + IsTestingSample bool `json:"IsTestingSample,omitempty"` + + // lab testing state + LabTestingState string `json:"LabTestingState,omitempty"` + + // lab testing state date + LabTestingStateDate string `json:"LabTestingStateDate,omitempty"` + + // label + Label string `json:"Label,omitempty"` + + // last modified + LastModified string `json:"LastModified,omitempty"` + + // package type + PackageType string `json:"PackageType,omitempty"` + + // packaged date + PackagedDate string `json:"PackagedDate,omitempty"` + + // patient license number + PatientLicenseNumber string `json:"PatientLicenseNumber,omitempty"` + + // product category name + ProductCategoryName string `json:"ProductCategoryName,omitempty"` + + // product Id + ProductID float64 `json:"ProductId,omitempty"` + + // product name + ProductName string `json:"ProductName,omitempty"` + + // product requires remediation + ProductRequiresRemediation bool `json:"ProductRequiresRemediation,omitempty"` + + // production batch number + ProductionBatchNumber string `json:"ProductionBatchNumber,omitempty"` + + // quantity + Quantity float64 `json:"Quantity,omitempty"` + + // received date time + ReceivedDateTime string `json:"ReceivedDateTime,omitempty"` + + // received from facility license number + ReceivedFromFacilityLicenseNumber string `json:"ReceivedFromFacilityLicenseNumber,omitempty"` + + // received from facility name + ReceivedFromFacilityName string `json:"ReceivedFromFacilityName,omitempty"` + + // received from manifest number + ReceivedFromManifestNumber string `json:"ReceivedFromManifestNumber,omitempty"` + + // remediation date + RemediationDate string `json:"RemediationDate,omitempty"` + + // room Id + RoomID string `json:"RoomId,omitempty"` + + // room name + RoomName string `json:"RoomName,omitempty"` + + // source harvest names + SourceHarvestNames string `json:"SourceHarvestNames,omitempty"` + + // unit of measure abbreviation + UnitOfMeasureAbbreviation string `json:"UnitOfMeasureAbbreviation,omitempty"` + + // unit of measure name + UnitOfMeasureName string `json:"UnitOfMeasureName,omitempty"` +} + +// Validate validates this package +func (m *Package) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Package) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Package) UnmarshalBinary(b []byte) error { + var res Package + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/package_adjustment_reason.go b/api/metrc-gw/metrc_gw_models/package_adjustment_reason.go new file mode 100644 index 0000000..6361f42 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/package_adjustment_reason.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PackageAdjustmentReason package adjustment reason +// +// swagger:model PackageAdjustmentReason +type PackageAdjustmentReason struct { + + // name + Name string `json:"Name,omitempty"` + + // requires note + RequiresNote bool `json:"RequiresNote,omitempty"` +} + +// Validate validates this package adjustment reason +func (m *PackageAdjustmentReason) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PackageAdjustmentReason) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackageAdjustmentReason) UnmarshalBinary(b []byte) error { + var res PackageAdjustmentReason + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/package_adjustment_reason_response.go b/api/metrc-gw/metrc_gw_models/package_adjustment_reason_response.go new file mode 100644 index 0000000..9910786 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/package_adjustment_reason_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PackageAdjustmentReasonResponse package adjustment reason response +// +// swagger:model PackageAdjustmentReasonResponse +type PackageAdjustmentReasonResponse struct { + + // data + Data []*PackageAdjustmentReason `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this package adjustment reason response +func (m *PackageAdjustmentReasonResponse) 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 *PackageAdjustmentReasonResponse) 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 *PackageAdjustmentReasonResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PackageAdjustmentReasonResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackageAdjustmentReasonResponse) UnmarshalBinary(b []byte) error { + var res PackageAdjustmentReasonResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/package_request.go b/api/metrc-gw/metrc_gw_models/package_request.go new file mode 100644 index 0000000..4a9eb6b --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/package_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PackageRequest package request +// +// swagger:model PackageRequest +type PackageRequest struct { + + // data + Data []*Package `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this package request +func (m *PackageRequest) 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 *PackageRequest) 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 *PackageRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PackageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackageRequest) UnmarshalBinary(b []byte) error { + var res PackageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/package_response.go b/api/metrc-gw/metrc_gw_models/package_response.go new file mode 100644 index 0000000..3e40597 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/package_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PackageResponse package response +// +// swagger:model PackageResponse +type PackageResponse struct { + + // data + Data []*Package `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this package response +func (m *PackageResponse) 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 *PackageResponse) 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 *PackageResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PackageResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackageResponse) UnmarshalBinary(b []byte) error { + var res PackageResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/package_type.go b/api/metrc-gw/metrc_gw_models/package_type.go new file mode 100644 index 0000000..732b15f --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/package_type.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PackageType package type +// +// swagger:model PackageType +type PackageType struct { + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this package type +func (m *PackageType) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PackageType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackageType) UnmarshalBinary(b []byte) error { + var res PackageType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/package_type_response.go b/api/metrc-gw/metrc_gw_models/package_type_response.go new file mode 100644 index 0000000..99802c8 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/package_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PackageTypeResponse package type response +// +// swagger:model PackageTypeResponse +type PackageTypeResponse struct { + + // data + Data []*PackageType `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this package type response +func (m *PackageTypeResponse) 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 *PackageTypeResponse) 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 *PackageTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PackageTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PackageTypeResponse) UnmarshalBinary(b []byte) error { + var res PackageTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/pagination.go b/api/metrc-gw/metrc_gw_models/pagination.go new file mode 100644 index 0000000..23357fd --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/pagination.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // next link + NextLink string `json:"next_link,omitempty"` + + // The Limit for a Request + PLimit int64 `json:"p_limit,omitempty"` + + // The Offset for a Request + POffset int64 `json:"p_offset,omitempty"` + + // The number of records in a Response + PageSize int64 `json:"page_size,omitempty"` + + // The total number of records available for a Response + SetSize int64 `json:"set_size,omitempty"` +} + +// Validate validates this pagination +func (m *Pagination) Validate(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/metrc-gw/metrc_gw_models/plant.go b/api/metrc-gw/metrc_gw_models/plant.go new file mode 100644 index 0000000..377c79b --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Plant plant +// +// swagger:model Plant +type Plant struct { + + // growth phase + GrowthPhase string `json:"GrowthPhase,omitempty"` + + // harvest count + HarvestCount float64 `json:"HarvestCount,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // is on hold + IsOnHold bool `json:"IsOnHold,omitempty"` + + // label + Label string `json:"Label,omitempty"` + + // last modified + LastModified string `json:"LastModified,omitempty"` + + // plant batch Id + PlantBatchID float64 `json:"PlantBatchId,omitempty"` + + // plant batch name + PlantBatchName string `json:"PlantBatchName,omitempty"` + + // plant batch type name + PlantBatchTypeName string `json:"PlantBatchTypeName,omitempty"` + + // planted date + PlantedDate string `json:"PlantedDate,omitempty"` + + // room Id + RoomID float64 `json:"RoomId,omitempty"` + + // room name + RoomName string `json:"RoomName,omitempty"` + + // state + State string `json:"State,omitempty"` + + // strain Id + StrainID float64 `json:"StrainId,omitempty"` + + // strain name + StrainName string `json:"StrainName,omitempty"` + + // vegetative date + VegetativeDate string `json:"VegetativeDate,omitempty"` +} + +// Validate validates this plant +func (m *Plant) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Plant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Plant) UnmarshalBinary(b []byte) error { + var res Plant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_batch.go b/api/metrc-gw/metrc_gw_models/plant_batch.go new file mode 100644 index 0000000..add59ec --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_batch.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantBatch plant batch +// +// swagger:model PlantBatch +type PlantBatch struct { + + // count + Count float64 `json:"Count,omitempty"` + + // destroyed count + DestroyedCount float64 `json:"DestroyedCount,omitempty"` + + // harvested count + HarvestedCount float64 `json:"HarvestedCount,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // last modified + LastModified string `json:"LastModified,omitempty"` + + // live count + LiveCount float64 `json:"LiveCount,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // packaged count + PackagedCount float64 `json:"PackagedCount,omitempty"` + + // patient license number + PatientLicenseNumber string `json:"PatientLicenseNumber,omitempty"` + + // planted date + PlantedDate string `json:"PlantedDate,omitempty"` + + // room Id + RoomID string `json:"RoomId,omitempty"` + + // room name + RoomName string `json:"RoomName,omitempty"` + + // source package Id + SourcePackageID float64 `json:"SourcePackageId,omitempty"` + + // source package label + SourcePackageLabel string `json:"SourcePackageLabel,omitempty"` + + // source plant Id + SourcePlantID float64 `json:"SourcePlantId,omitempty"` + + // source plant label + SourcePlantLabel string `json:"SourcePlantLabel,omitempty"` + + // strain Id + StrainID float64 `json:"StrainId,omitempty"` + + // strain name + StrainName string `json:"StrainName,omitempty"` + + // tracked count + TrackedCount float64 `json:"TrackedCount,omitempty"` + + // type + Type string `json:"Type,omitempty"` + + // untracked count + UntrackedCount float64 `json:"UntrackedCount,omitempty"` +} + +// Validate validates this plant batch +func (m *PlantBatch) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PlantBatch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantBatch) UnmarshalBinary(b []byte) error { + var res PlantBatch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_batch_request.go b/api/metrc-gw/metrc_gw_models/plant_batch_request.go new file mode 100644 index 0000000..2919502 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_batch_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantBatchRequest plant batch request +// +// swagger:model PlantBatchRequest +type PlantBatchRequest struct { + + // data + Data []*PlantBatch `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this plant batch request +func (m *PlantBatchRequest) 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 *PlantBatchRequest) 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 *PlantBatchRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PlantBatchRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantBatchRequest) UnmarshalBinary(b []byte) error { + var res PlantBatchRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_batch_response.go b/api/metrc-gw/metrc_gw_models/plant_batch_response.go new file mode 100644 index 0000000..e53b8ef --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_batch_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantBatchResponse plant batch response +// +// swagger:model PlantBatchResponse +type PlantBatchResponse struct { + + // data + Data []*PlantBatch `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this plant batch response +func (m *PlantBatchResponse) 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 *PlantBatchResponse) 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 *PlantBatchResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PlantBatchResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantBatchResponse) UnmarshalBinary(b []byte) error { + var res PlantBatchResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_growth_phase.go b/api/metrc-gw/metrc_gw_models/plant_growth_phase.go new file mode 100644 index 0000000..a6326fe --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_growth_phase.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantGrowthPhase plant growth phase +// +// swagger:model PlantGrowthPhase +type PlantGrowthPhase struct { + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this plant growth phase +func (m *PlantGrowthPhase) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PlantGrowthPhase) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantGrowthPhase) UnmarshalBinary(b []byte) error { + var res PlantGrowthPhase + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_growth_phase_response.go b/api/metrc-gw/metrc_gw_models/plant_growth_phase_response.go new file mode 100644 index 0000000..03a02ab --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_growth_phase_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantGrowthPhaseResponse plant growth phase response +// +// swagger:model PlantGrowthPhaseResponse +type PlantGrowthPhaseResponse struct { + + // data + Data []*PlantGrowthPhase `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this plant growth phase response +func (m *PlantGrowthPhaseResponse) 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 *PlantGrowthPhaseResponse) 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 *PlantGrowthPhaseResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PlantGrowthPhaseResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantGrowthPhaseResponse) UnmarshalBinary(b []byte) error { + var res PlantGrowthPhaseResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_request.go b/api/metrc-gw/metrc_gw_models/plant_request.go new file mode 100644 index 0000000..a1452c1 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantRequest plant request +// +// swagger:model PlantRequest +type PlantRequest struct { + + // data + Data []*Plant `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this plant request +func (m *PlantRequest) 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 *PlantRequest) 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 *PlantRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PlantRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantRequest) UnmarshalBinary(b []byte) error { + var res PlantRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_response.go b/api/metrc-gw/metrc_gw_models/plant_response.go new file mode 100644 index 0000000..bcb06d9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantResponse plant response +// +// swagger:model PlantResponse +type PlantResponse struct { + + // data + Data []*Plant `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this plant response +func (m *PlantResponse) 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 *PlantResponse) 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 *PlantResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PlantResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantResponse) UnmarshalBinary(b []byte) error { + var res PlantResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_waste_method.go b/api/metrc-gw/metrc_gw_models/plant_waste_method.go new file mode 100644 index 0000000..8559173 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_waste_method.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantWasteMethod plant waste method +// +// swagger:model PlantWasteMethod +type PlantWasteMethod struct { + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this plant waste method +func (m *PlantWasteMethod) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PlantWasteMethod) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantWasteMethod) UnmarshalBinary(b []byte) error { + var res PlantWasteMethod + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_waste_method_response.go b/api/metrc-gw/metrc_gw_models/plant_waste_method_response.go new file mode 100644 index 0000000..1b6be75 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_waste_method_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantWasteMethodResponse plant waste method response +// +// swagger:model PlantWasteMethodResponse +type PlantWasteMethodResponse struct { + + // data + Data []*PlantWasteMethod `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this plant waste method response +func (m *PlantWasteMethodResponse) 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 *PlantWasteMethodResponse) 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 *PlantWasteMethodResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PlantWasteMethodResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantWasteMethodResponse) UnmarshalBinary(b []byte) error { + var res PlantWasteMethodResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/plant_waste_reason_response.go b/api/metrc-gw/metrc_gw_models/plant_waste_reason_response.go new file mode 100644 index 0000000..aabcdb8 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/plant_waste_reason_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlantWasteReasonResponse plant waste reason response +// +// swagger:model PlantWasteReasonResponse +type PlantWasteReasonResponse struct { + + // data + Data []*PlantWasteMethod `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this plant waste reason response +func (m *PlantWasteReasonResponse) 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 *PlantWasteReasonResponse) 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 *PlantWasteReasonResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PlantWasteReasonResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlantWasteReasonResponse) UnmarshalBinary(b []byte) error { + var res PlantWasteReasonResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/product_category.go b/api/metrc-gw/metrc_gw_models/product_category.go new file mode 100644 index 0000000..2a59db9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/product_category.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductCategory product category +// +// swagger:model ProductCategory +type ProductCategory struct { + + // can be remediated + CanBeRemediated bool `json:"CanBeRemediated,omitempty"` + + // can contain seeds + CanContainSeeds bool `json:"CanContainSeeds,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // product category type + ProductCategoryType string `json:"ProductCategoryType,omitempty"` + + // quantity type + QuantityType string `json:"QuantityType,omitempty"` + + // requires administration method + RequiresAdministrationMethod bool `json:"RequiresAdministrationMethod,omitempty"` + + // requires ingredients + RequiresIngredients bool `json:"RequiresIngredients,omitempty"` + + // requires item brand + RequiresItemBrand bool `json:"RequiresItemBrand,omitempty"` + + // requires product photo + RequiresProductPhoto bool `json:"RequiresProductPhoto,omitempty"` + + // requires serving size + RequiresServingSize bool `json:"RequiresServingSize,omitempty"` + + // requires strain + RequiresStrain bool `json:"RequiresStrain,omitempty"` + + // requires supply duration days + RequiresSupplyDurationDays bool `json:"RequiresSupplyDurationDays,omitempty"` + + // requires unit cbd content + RequiresUnitCbdContent bool `json:"RequiresUnitCbdContent,omitempty"` + + // requires unit cbd percent + RequiresUnitCbdPercent bool `json:"RequiresUnitCbdPercent,omitempty"` + + // requires unit thc content + RequiresUnitThcContent bool `json:"RequiresUnitThcContent,omitempty"` + + // requires unit thc percent + RequiresUnitThcPercent bool `json:"RequiresUnitThcPercent,omitempty"` + + // requires unit volume + RequiresUnitVolume bool `json:"RequiresUnitVolume,omitempty"` + + // requires unit weight + RequiresUnitWeight bool `json:"RequiresUnitWeight,omitempty"` +} + +// Validate validates this product category +func (m *ProductCategory) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProductCategory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductCategory) UnmarshalBinary(b []byte) error { + var res ProductCategory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/product_category_response.go b/api/metrc-gw/metrc_gw_models/product_category_response.go new file mode 100644 index 0000000..b6e8783 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/product_category_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductCategoryResponse product category response +// +// swagger:model ProductCategoryResponse +type ProductCategoryResponse struct { + + // data + Data []*ProductCategory `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this product category response +func (m *ProductCategoryResponse) 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 *ProductCategoryResponse) 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 *ProductCategoryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *ProductCategoryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductCategoryResponse) UnmarshalBinary(b []byte) error { + var res ProductCategoryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/request_meta.go b/api/metrc-gw/metrc_gw_models/request_meta.go new file mode 100644 index 0000000..c72c4be --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/request_meta.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 { + + // license + // Required: true + License *string `json:"license"` + + // Operation ID + OperationID string `json:"operation_id,omitempty"` + + // production + // Required: true + Production *bool `json:"production"` + + // reseller + // Required: true + Reseller *string `json:"reseller"` + + // state + // Required: true + State *string `json:"state"` + + // Taxnexus Account Number for recording transactions + TaxnexusAccount string `json:"taxnexus_account,omitempty"` + + // test only + TestOnly bool `json:"test_only,omitempty"` + + // transaction date + TransactionDate string `json:"transaction_date,omitempty"` + + // user + // Required: true + User *string `json:"user"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLicense(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProduction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReseller(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(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 *RequestMeta) validateLicense(formats strfmt.Registry) error { + + if err := validate.Required("license", "body", m.License); err != nil { + return err + } + + return nil +} + +func (m *RequestMeta) validateProduction(formats strfmt.Registry) error { + + if err := validate.Required("production", "body", m.Production); err != nil { + return err + } + + return nil +} + +func (m *RequestMeta) validateReseller(formats strfmt.Registry) error { + + if err := validate.Required("reseller", "body", m.Reseller); err != nil { + return err + } + + return nil +} + +func (m *RequestMeta) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + return nil +} + +func (m *RequestMeta) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + 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/metrc-gw/metrc_gw_models/response_meta.go b/api/metrc-gw/metrc_gw_models/response_meta.go new file mode 100644 index 0000000..9ad7f9c --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/response_meta.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 + Taxnexusaccount string `json:"taxnexusaccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(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/metrc-gw/metrc_gw_models/room.go b/api/metrc-gw/metrc_gw_models/room.go new file mode 100644 index 0000000..9f5f345 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/room.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Room room +// +// swagger:model Room +type Room struct { + + // Id + ID float64 `json:"Id,omitempty"` + + // name + Name string `json:"Name,omitempty"` +} + +// Validate validates this room +func (m *Room) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Room) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Room) UnmarshalBinary(b []byte) error { + var res Room + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/room_request.go b/api/metrc-gw/metrc_gw_models/room_request.go new file mode 100644 index 0000000..d68020a --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/room_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RoomRequest room request +// +// swagger:model RoomRequest +type RoomRequest struct { + + // data + Data []*Room `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this room request +func (m *RoomRequest) 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 *RoomRequest) 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 *RoomRequest) 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 +} + +// MarshalBinary interface implementation +func (m *RoomRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoomRequest) UnmarshalBinary(b []byte) error { + var res RoomRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/room_response.go b/api/metrc-gw/metrc_gw_models/room_response.go new file mode 100644 index 0000000..d1866dd --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/room_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RoomResponse room response +// +// swagger:model RoomResponse +type RoomResponse struct { + + // data + Data []*Room `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this room response +func (m *RoomResponse) 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 *RoomResponse) 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 *RoomResponse) 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 +} + +// MarshalBinary interface implementation +func (m *RoomResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoomResponse) UnmarshalBinary(b []byte) error { + var res RoomResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_delivery.go b/api/metrc-gw/metrc_gw_models/sales_delivery.go new file mode 100644 index 0000000..b570d89 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_delivery.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesDelivery sales delivery +// +// swagger:model SalesDelivery +type SalesDelivery struct { + + // driver name + DriverName string `json:"DriverName,omitempty"` + + // driver occupational license number + DriverOccupationalLicenseNumber string `json:"DriverOccupationalLicenseNumber,omitempty"` + + // driver vehicle license number + DriverVehicleLicenseNumber string `json:"DriverVehicleLicenseNumber,omitempty"` + + // estimated arrival date time + EstimatedArrivalDateTime string `json:"EstimatedArrivalDateTime,omitempty"` + + // estimated departure date time + EstimatedDepartureDateTime string `json:"EstimatedDepartureDateTime,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // phone number for questions + PhoneNumberForQuestions string `json:"PhoneNumberForQuestions,omitempty"` + + // planned route + PlannedRoute string `json:"PlannedRoute,omitempty"` + + // recipient address city + RecipientAddressCity string `json:"RecipientAddressCity,omitempty"` + + // recipient address postal code + RecipientAddressPostalCode string `json:"RecipientAddressPostalCode,omitempty"` + + // recipient address state + RecipientAddressState string `json:"RecipientAddressState,omitempty"` + + // recipient address street1 + RecipientAddressStreet1 string `json:"RecipientAddressStreet1,omitempty"` + + // recipient address street2 + RecipientAddressStreet2 string `json:"RecipientAddressStreet2,omitempty"` + + // sales customer type + SalesCustomerType string `json:"SalesCustomerType,omitempty"` + + // sales date time + SalesDateTime string `json:"SalesDateTime,omitempty"` + + // transactions + Transactions []*Transaction `json:"Transactions"` + + // vehicle license plate number + VehicleLicensePlateNumber string `json:"VehicleLicensePlateNumber,omitempty"` + + // vehicle make + VehicleMake string `json:"VehicleMake,omitempty"` + + // vehicle model + VehicleModel string `json:"VehicleModel,omitempty"` +} + +// Validate validates this sales delivery +func (m *SalesDelivery) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTransactions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SalesDelivery) validateTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.Transactions) { // not required + return nil + } + + for i := 0; i < len(m.Transactions); i++ { + if swag.IsZero(m.Transactions[i]) { // not required + continue + } + + if m.Transactions[i] != nil { + if err := m.Transactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Transactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SalesDelivery) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesDelivery) UnmarshalBinary(b []byte) error { + var res SalesDelivery + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_delivery_request.go b/api/metrc-gw/metrc_gw_models/sales_delivery_request.go new file mode 100644 index 0000000..cb83d96 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_delivery_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesDeliveryRequest sales delivery request +// +// swagger:model SalesDeliveryRequest +type SalesDeliveryRequest struct { + + // data + Data []*SalesDelivery `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this sales delivery request +func (m *SalesDeliveryRequest) 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 *SalesDeliveryRequest) 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 *SalesDeliveryRequest) 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 +} + +// MarshalBinary interface implementation +func (m *SalesDeliveryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesDeliveryRequest) UnmarshalBinary(b []byte) error { + var res SalesDeliveryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_delivery_response.go b/api/metrc-gw/metrc_gw_models/sales_delivery_response.go new file mode 100644 index 0000000..f37347a --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_delivery_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesDeliveryResponse sales delivery response +// +// swagger:model SalesDeliveryResponse +type SalesDeliveryResponse struct { + + // data + Data []*SalesDelivery `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this sales delivery response +func (m *SalesDeliveryResponse) 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 *SalesDeliveryResponse) 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 *SalesDeliveryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SalesDeliveryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesDeliveryResponse) UnmarshalBinary(b []byte) error { + var res SalesDeliveryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_delivery_return_reason.go b/api/metrc-gw/metrc_gw_models/sales_delivery_return_reason.go new file mode 100644 index 0000000..df278ba --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_delivery_return_reason.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesDeliveryReturnReason sales delivery return reason +// +// swagger:model SalesDeliveryReturnReason +type SalesDeliveryReturnReason struct { + + // name + Name string `json:"Name,omitempty"` + + // requires note + RequiresNote bool `json:"RequiresNote,omitempty"` +} + +// Validate validates this sales delivery return reason +func (m *SalesDeliveryReturnReason) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SalesDeliveryReturnReason) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesDeliveryReturnReason) UnmarshalBinary(b []byte) error { + var res SalesDeliveryReturnReason + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_delivery_return_reason_response.go b/api/metrc-gw/metrc_gw_models/sales_delivery_return_reason_response.go new file mode 100644 index 0000000..22fc097 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_delivery_return_reason_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesDeliveryReturnReasonResponse sales delivery return reason response +// +// swagger:model SalesDeliveryReturnReasonResponse +type SalesDeliveryReturnReasonResponse struct { + + // data + Data []*SalesDeliveryReturnReason `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this sales delivery return reason response +func (m *SalesDeliveryReturnReasonResponse) 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 *SalesDeliveryReturnReasonResponse) 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 *SalesDeliveryReturnReasonResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SalesDeliveryReturnReasonResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesDeliveryReturnReasonResponse) UnmarshalBinary(b []byte) error { + var res SalesDeliveryReturnReasonResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_receipt.go b/api/metrc-gw/metrc_gw_models/sales_receipt.go new file mode 100644 index 0000000..1fc9f45 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_receipt.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesReceipt sales receipt +// +// swagger:model SalesReceipt +type SalesReceipt struct { + + // archived date + ArchivedDate string `json:"ArchivedDate,omitempty"` + + // caregiver license number + CaregiverLicenseNumber string `json:"CaregiverLicenseNumber,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // identification method + IdentificationMethod string `json:"IdentificationMethod,omitempty"` + + // is final + IsFinal bool `json:"IsFinal,omitempty"` + + // last modified + LastModified string `json:"LastModified,omitempty"` + + // patient license number + PatientLicenseNumber string `json:"PatientLicenseNumber,omitempty"` + + // receipt number + ReceiptNumber string `json:"ReceiptNumber,omitempty"` + + // sales customer type + SalesCustomerType string `json:"SalesCustomerType,omitempty"` + + // sales date time + SalesDateTime string `json:"SalesDateTime,omitempty"` + + // total packages + TotalPackages float64 `json:"TotalPackages,omitempty"` + + // total price + TotalPrice float64 `json:"TotalPrice,omitempty"` + + // transactions + Transactions []*Transaction `json:"Transactions"` +} + +// Validate validates this sales receipt +func (m *SalesReceipt) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTransactions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SalesReceipt) validateTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.Transactions) { // not required + return nil + } + + for i := 0; i < len(m.Transactions); i++ { + if swag.IsZero(m.Transactions[i]) { // not required + continue + } + + if m.Transactions[i] != nil { + if err := m.Transactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Transactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SalesReceipt) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesReceipt) UnmarshalBinary(b []byte) error { + var res SalesReceipt + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_receipt_request.go b/api/metrc-gw/metrc_gw_models/sales_receipt_request.go new file mode 100644 index 0000000..6aee77d --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_receipt_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesReceiptRequest sales receipt request +// +// swagger:model SalesReceiptRequest +type SalesReceiptRequest struct { + + // data + Data []*SalesReceipt `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this sales receipt request +func (m *SalesReceiptRequest) 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 *SalesReceiptRequest) 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 *SalesReceiptRequest) 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 +} + +// MarshalBinary interface implementation +func (m *SalesReceiptRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesReceiptRequest) UnmarshalBinary(b []byte) error { + var res SalesReceiptRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_receipt_response.go b/api/metrc-gw/metrc_gw_models/sales_receipt_response.go new file mode 100644 index 0000000..3ba3956 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_receipt_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesReceiptResponse sales receipt response +// +// swagger:model SalesReceiptResponse +type SalesReceiptResponse struct { + + // data + Data []*SalesReceipt `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this sales receipt response +func (m *SalesReceiptResponse) 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 *SalesReceiptResponse) 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 *SalesReceiptResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SalesReceiptResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesReceiptResponse) UnmarshalBinary(b []byte) error { + var res SalesReceiptResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/sales_transaction_date_response.go b/api/metrc-gw/metrc_gw_models/sales_transaction_date_response.go new file mode 100644 index 0000000..7371ecd --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/sales_transaction_date_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SalesTransactionDateResponse sales transaction date response +// +// swagger:model SalesTransactionDateResponse +type SalesTransactionDateResponse struct { + + // data + Data []*Room `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this sales transaction date response +func (m *SalesTransactionDateResponse) 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 *SalesTransactionDateResponse) 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 *SalesTransactionDateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SalesTransactionDateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SalesTransactionDateResponse) UnmarshalBinary(b []byte) error { + var res SalesTransactionDateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/strain.go b/api/metrc-gw/metrc_gw_models/strain.go new file mode 100644 index 0000000..4f5ed0f --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/strain.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Strain strain +// +// swagger:model Strain +type Strain struct { + + // genetics + Genetics string `json:"Genetics,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // indica percentage + IndicaPercentage float64 `json:"IndicaPercentage,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // sativa percentage + SativaPercentage float64 `json:"SativaPercentage,omitempty"` + + // testing status + TestingStatus string `json:"TestingStatus,omitempty"` +} + +// Validate validates this strain +func (m *Strain) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Strain) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Strain) UnmarshalBinary(b []byte) error { + var res Strain + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/strain_request.go b/api/metrc-gw/metrc_gw_models/strain_request.go new file mode 100644 index 0000000..05a3536 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/strain_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StrainRequest strain request +// +// swagger:model StrainRequest +type StrainRequest struct { + + // data + Data []*Strain `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this strain request +func (m *StrainRequest) 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 *StrainRequest) 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 *StrainRequest) 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 +} + +// MarshalBinary interface implementation +func (m *StrainRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StrainRequest) UnmarshalBinary(b []byte) error { + var res StrainRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/strain_response.go b/api/metrc-gw/metrc_gw_models/strain_response.go new file mode 100644 index 0000000..eb85db3 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/strain_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StrainResponse strain response +// +// swagger:model StrainResponse +type StrainResponse struct { + + // data + Data []*Strain `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this strain response +func (m *StrainResponse) 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 *StrainResponse) 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 *StrainResponse) 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 +} + +// MarshalBinary interface implementation +func (m *StrainResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StrainResponse) UnmarshalBinary(b []byte) error { + var res StrainResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/transaction.go b/api/metrc-gw/metrc_gw_models/transaction.go new file mode 100644 index 0000000..ad4b71b --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/transaction.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Transaction transaction +// +// swagger:model Transaction +type Transaction struct { + + // archived date + ArchivedDate string `json:"ArchivedDate,omitempty"` + + // last modified + LastModified string `json:"LastModified,omitempty"` + + // package Id + PackageID float64 `json:"PackageId,omitempty"` + + // package label + PackageLabel string `json:"PackageLabel,omitempty"` + + // product name + ProductName string `json:"ProductName,omitempty"` + + // quantity sold + QuantitySold float64 `json:"QuantitySold,omitempty"` + + // sales delivery state + SalesDeliveryState string `json:"SalesDeliveryState,omitempty"` + + // total price + TotalPrice float64 `json:"TotalPrice,omitempty"` + + // unit of measure abbreviation + UnitOfMeasureAbbreviation string `json:"UnitOfMeasureAbbreviation,omitempty"` + + // unit of measure name + UnitOfMeasureName string `json:"UnitOfMeasureName,omitempty"` +} + +// Validate validates this transaction +func (m *Transaction) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Transaction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Transaction) UnmarshalBinary(b []byte) error { + var res Transaction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/transaction_request.go b/api/metrc-gw/metrc_gw_models/transaction_request.go new file mode 100644 index 0000000..91bab04 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/transaction_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransactionRequest transaction request +// +// swagger:model TransactionRequest +type TransactionRequest struct { + + // data + Data []*Transaction `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this transaction request +func (m *TransactionRequest) 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 *TransactionRequest) 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 *TransactionRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TransactionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionRequest) UnmarshalBinary(b []byte) error { + var res TransactionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/transaction_response.go b/api/metrc-gw/metrc_gw_models/transaction_response.go new file mode 100644 index 0000000..db781c4 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/transaction_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransactionResponse transaction response +// +// swagger:model TransactionResponse +type TransactionResponse struct { + + // data + Data []*Transaction `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this transaction response +func (m *TransactionResponse) 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 *TransactionResponse) 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 *TransactionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TransactionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionResponse) UnmarshalBinary(b []byte) error { + var res TransactionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/transfer.go b/api/metrc-gw/metrc_gw_models/transfer.go new file mode 100644 index 0000000..0481dc9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/transfer.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Transfer transfer +// +// swagger:model Transfer +type Transfer struct { + + // actual arrival date time + ActualArrivalDateTime string `json:"ActualArrivalDateTime,omitempty"` + + // actual departure date time + ActualDepartureDateTime string `json:"ActualDepartureDateTime,omitempty"` + + // contains plant package + ContainsPlantPackage bool `json:"ContainsPlantPackage,omitempty"` + + // contains product package + ContainsProductPackage bool `json:"ContainsProductPackage,omitempty"` + + // contains product requires remediation + ContainsProductRequiresRemediation bool `json:"ContainsProductRequiresRemediation,omitempty"` + + // contains remediated product package + ContainsRemediatedProductPackage bool `json:"ContainsRemediatedProductPackage,omitempty"` + + // contains testing sample + ContainsTestingSample bool `json:"ContainsTestingSample,omitempty"` + + // created by user name + CreatedByUserName string `json:"CreatedByUserName,omitempty"` + + // created date time + CreatedDateTime string `json:"CreatedDateTime,omitempty"` + + // delivery count + DeliveryCount float64 `json:"DeliveryCount,omitempty"` + + // delivery Id + DeliveryID float64 `json:"DeliveryId,omitempty"` + + // delivery package count + DeliveryPackageCount float64 `json:"DeliveryPackageCount,omitempty"` + + // delivery received package count + DeliveryReceivedPackageCount float64 `json:"DeliveryReceivedPackageCount,omitempty"` + + // driver name + DriverName string `json:"DriverName,omitempty"` + + // driver occupational license number + DriverOccupationalLicenseNumber string `json:"DriverOccupationalLicenseNumber,omitempty"` + + // driver vehicle license number + DriverVehicleLicenseNumber string `json:"DriverVehicleLicenseNumber,omitempty"` + + // estimated arrival date time + EstimatedArrivalDateTime string `json:"EstimatedArrivalDateTime,omitempty"` + + // estimated departure date time + EstimatedDepartureDateTime string `json:"EstimatedDepartureDateTime,omitempty"` + + // Id + ID float64 `json:"Id,omitempty"` + + // last modified + LastModified string `json:"LastModified,omitempty"` + + // manifest number + ManifestNumber string `json:"ManifestNumber,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // package count + PackageCount float64 `json:"PackageCount,omitempty"` + + // received date time + ReceivedDateTime string `json:"ReceivedDateTime,omitempty"` + + // received delivery count + ReceivedDeliveryCount float64 `json:"ReceivedDeliveryCount,omitempty"` + + // received package count + ReceivedPackageCount float64 `json:"ReceivedPackageCount,omitempty"` + + // recipient facility license number + RecipientFacilityLicenseNumber string `json:"RecipientFacilityLicenseNumber,omitempty"` + + // recipient facility name + RecipientFacilityName string `json:"RecipientFacilityName,omitempty"` + + // shipment license type + ShipmentLicenseType float64 `json:"ShipmentLicenseType,omitempty"` + + // shipment transaction type + ShipmentTransactionType string `json:"ShipmentTransactionType,omitempty"` + + // shipment type name + ShipmentTypeName string `json:"ShipmentTypeName,omitempty"` + + // shipper facility license number + ShipperFacilityLicenseNumber string `json:"ShipperFacilityLicenseNumber,omitempty"` + + // shipper facility name + ShipperFacilityName string `json:"ShipperFacilityName,omitempty"` + + // transporter facility license number + TransporterFacilityLicenseNumber string `json:"TransporterFacilityLicenseNumber,omitempty"` + + // transporter facility name + TransporterFacilityName string `json:"TransporterFacilityName,omitempty"` + + // vehicle license plate number + VehicleLicensePlateNumber string `json:"VehicleLicensePlateNumber,omitempty"` + + // vehicle make + VehicleMake string `json:"VehicleMake,omitempty"` + + // vehicle model + VehicleModel string `json:"VehicleModel,omitempty"` +} + +// Validate validates this transfer +func (m *Transfer) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Transfer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Transfer) UnmarshalBinary(b []byte) error { + var res Transfer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/transfer_response.go b/api/metrc-gw/metrc_gw_models/transfer_response.go new file mode 100644 index 0000000..77a9d6a --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/transfer_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransferResponse transfer response +// +// swagger:model TransferResponse +type TransferResponse struct { + + // data + Data []*Transfer `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this transfer response +func (m *TransferResponse) 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 *TransferResponse) 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 *TransferResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TransferResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransferResponse) UnmarshalBinary(b []byte) error { + var res TransferResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/units_of_measure.go b/api/metrc-gw/metrc_gw_models/units_of_measure.go new file mode 100644 index 0000000..cebe7dc --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/units_of_measure.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UnitsOfMeasure units of measure +// +// swagger:model UnitsOfMeasure +type UnitsOfMeasure struct { + + // abbreviation + Abbreviation string `json:"Abbreviation,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // quantity type + QuantityType string `json:"QuantityType,omitempty"` +} + +// Validate validates this units of measure +func (m *UnitsOfMeasure) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UnitsOfMeasure) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UnitsOfMeasure) UnmarshalBinary(b []byte) error { + var res UnitsOfMeasure + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/metrc-gw/metrc_gw_models/units_of_measure_response.go b/api/metrc-gw/metrc_gw_models/units_of_measure_response.go new file mode 100644 index 0000000..a9105c9 --- /dev/null +++ b/api/metrc-gw/metrc_gw_models/units_of_measure_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package metrc_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UnitsOfMeasureResponse units of measure response +// +// swagger:model UnitsOfMeasureResponse +type UnitsOfMeasureResponse struct { + + // data + Data []*UnitsOfMeasure `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this units of measure response +func (m *UnitsOfMeasureResponse) 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 *UnitsOfMeasureResponse) 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 *UnitsOfMeasureResponse) 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 +} + +// MarshalBinary interface implementation +func (m *UnitsOfMeasureResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UnitsOfMeasureResponse) UnmarshalBinary(b []byte) error { + var res UnitsOfMeasureResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_client/cash_receipt/cash_receipt_client.go b/api/ops/ops_client/cash_receipt/cash_receipt_client.go new file mode 100644 index 0000000..7283c51 --- /dev/null +++ b/api/ops/ops_client/cash_receipt/cash_receipt_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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 cash receipt API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cash receipt API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteCashReceipt(params *DeleteCashReceiptParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCashReceiptOK, error) + + GetCashReceipts(params *GetCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCashReceiptsOK, error) + + PostCashReceipts(params *PostCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCashReceiptsOK, error) + + PutCashReceipts(params *PutCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCashReceiptsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteCashReceipt deletes a cash receipt + + Delete cash receipt by ID +*/ +func (a *Client) DeleteCashReceipt(params *DeleteCashReceiptParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCashReceiptOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteCashReceiptParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteCashReceipt", + Method: "DELETE", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteCashReceiptReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteCashReceiptOK) + 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 deleteCashReceipt: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCashReceipts gets a list of cash receipts + + Return a list of available Taxnexus Cash Receipts +*/ +func (a *Client) GetCashReceipts(params *GetCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCashReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCashReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCashReceipts", + Method: "GET", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCashReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCashReceiptsOK) + 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 getCashReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCashReceipts creates new cash receipts + + Create New Cash Receipts +*/ +func (a *Client) PostCashReceipts(params *PostCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCashReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCashReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCashReceipts", + Method: "POST", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCashReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCashReceiptsOK) + 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 postCashReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutCashReceipts puts a list of cash receipts + + Put a list of Cash Receipts +*/ +func (a *Client) PutCashReceipts(params *PutCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCashReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutCashReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putCashReceipts", + Method: "PUT", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutCashReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutCashReceiptsOK) + 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 putCashReceipts: 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/ops/ops_client/cash_receipt/delete_cash_receipt_parameters.go b/api/ops/ops_client/cash_receipt/delete_cash_receipt_parameters.go new file mode 100644 index 0000000..d02263c --- /dev/null +++ b/api/ops/ops_client/cash_receipt/delete_cash_receipt_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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" +) + +// NewDeleteCashReceiptParams creates a new DeleteCashReceiptParams object +// with the default values initialized. +func NewDeleteCashReceiptParams() *DeleteCashReceiptParams { + var () + return &DeleteCashReceiptParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteCashReceiptParamsWithTimeout creates a new DeleteCashReceiptParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteCashReceiptParamsWithTimeout(timeout time.Duration) *DeleteCashReceiptParams { + var () + return &DeleteCashReceiptParams{ + + timeout: timeout, + } +} + +// NewDeleteCashReceiptParamsWithContext creates a new DeleteCashReceiptParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteCashReceiptParamsWithContext(ctx context.Context) *DeleteCashReceiptParams { + var () + return &DeleteCashReceiptParams{ + + Context: ctx, + } +} + +// NewDeleteCashReceiptParamsWithHTTPClient creates a new DeleteCashReceiptParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteCashReceiptParamsWithHTTPClient(client *http.Client) *DeleteCashReceiptParams { + var () + return &DeleteCashReceiptParams{ + HTTPClient: client, + } +} + +/*DeleteCashReceiptParams contains all the parameters to send to the API endpoint +for the delete cash receipt operation typically these are written to a http.Request +*/ +type DeleteCashReceiptParams struct { + + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete cash receipt params +func (o *DeleteCashReceiptParams) WithTimeout(timeout time.Duration) *DeleteCashReceiptParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete cash receipt params +func (o *DeleteCashReceiptParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete cash receipt params +func (o *DeleteCashReceiptParams) WithContext(ctx context.Context) *DeleteCashReceiptParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete cash receipt params +func (o *DeleteCashReceiptParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete cash receipt params +func (o *DeleteCashReceiptParams) WithHTTPClient(client *http.Client) *DeleteCashReceiptParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete cash receipt params +func (o *DeleteCashReceiptParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete cash receipt params +func (o *DeleteCashReceiptParams) WithID(id *string) *DeleteCashReceiptParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete cash receipt params +func (o *DeleteCashReceiptParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteCashReceiptParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/cash_receipt/delete_cash_receipt_responses.go b/api/ops/ops_client/cash_receipt/delete_cash_receipt_responses.go new file mode 100644 index 0000000..36643ea --- /dev/null +++ b/api/ops/ops_client/cash_receipt/delete_cash_receipt_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeleteCashReceiptReader is a Reader for the DeleteCashReceipt structure. +type DeleteCashReceiptReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteCashReceiptReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteCashReceiptOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteCashReceiptUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteCashReceiptForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteCashReceiptNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteCashReceiptUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteCashReceiptInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteCashReceiptOK creates a DeleteCashReceiptOK with default headers values +func NewDeleteCashReceiptOK() *DeleteCashReceiptOK { + return &DeleteCashReceiptOK{} +} + +/*DeleteCashReceiptOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteCashReceiptOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.DeleteResponse +} + +func (o *DeleteCashReceiptOK) Error() string { + return fmt.Sprintf("[DELETE /cashreceipts][%d] deleteCashReceiptOK %+v", 200, o.Payload) +} + +func (o *DeleteCashReceiptOK) GetPayload() *ops_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteCashReceiptOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCashReceiptUnauthorized creates a DeleteCashReceiptUnauthorized with default headers values +func NewDeleteCashReceiptUnauthorized() *DeleteCashReceiptUnauthorized { + return &DeleteCashReceiptUnauthorized{} +} + +/*DeleteCashReceiptUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteCashReceiptUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteCashReceiptUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /cashreceipts][%d] deleteCashReceiptUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteCashReceiptUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteCashReceiptUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCashReceiptForbidden creates a DeleteCashReceiptForbidden with default headers values +func NewDeleteCashReceiptForbidden() *DeleteCashReceiptForbidden { + return &DeleteCashReceiptForbidden{} +} + +/*DeleteCashReceiptForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteCashReceiptForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteCashReceiptForbidden) Error() string { + return fmt.Sprintf("[DELETE /cashreceipts][%d] deleteCashReceiptForbidden %+v", 403, o.Payload) +} + +func (o *DeleteCashReceiptForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteCashReceiptForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCashReceiptNotFound creates a DeleteCashReceiptNotFound with default headers values +func NewDeleteCashReceiptNotFound() *DeleteCashReceiptNotFound { + return &DeleteCashReceiptNotFound{} +} + +/*DeleteCashReceiptNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteCashReceiptNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteCashReceiptNotFound) Error() string { + return fmt.Sprintf("[DELETE /cashreceipts][%d] deleteCashReceiptNotFound %+v", 404, o.Payload) +} + +func (o *DeleteCashReceiptNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteCashReceiptNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCashReceiptUnprocessableEntity creates a DeleteCashReceiptUnprocessableEntity with default headers values +func NewDeleteCashReceiptUnprocessableEntity() *DeleteCashReceiptUnprocessableEntity { + return &DeleteCashReceiptUnprocessableEntity{} +} + +/*DeleteCashReceiptUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteCashReceiptUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteCashReceiptUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /cashreceipts][%d] deleteCashReceiptUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteCashReceiptUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteCashReceiptUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteCashReceiptInternalServerError creates a DeleteCashReceiptInternalServerError with default headers values +func NewDeleteCashReceiptInternalServerError() *DeleteCashReceiptInternalServerError { + return &DeleteCashReceiptInternalServerError{} +} + +/*DeleteCashReceiptInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteCashReceiptInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteCashReceiptInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /cashreceipts][%d] deleteCashReceiptInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteCashReceiptInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteCashReceiptInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/cash_receipt/get_cash_receipts_parameters.go b/api/ops/ops_client/cash_receipt/get_cash_receipts_parameters.go new file mode 100644 index 0000000..7a7ad3b --- /dev/null +++ b/api/ops/ops_client/cash_receipt/get_cash_receipts_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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" +) + +// NewGetCashReceiptsParams creates a new GetCashReceiptsParams object +// with the default values initialized. +func NewGetCashReceiptsParams() *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCashReceiptsParamsWithTimeout creates a new GetCashReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCashReceiptsParamsWithTimeout(timeout time.Duration) *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + + timeout: timeout, + } +} + +// NewGetCashReceiptsParamsWithContext creates a new GetCashReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCashReceiptsParamsWithContext(ctx context.Context) *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + + Context: ctx, + } +} + +// NewGetCashReceiptsParamsWithHTTPClient creates a new GetCashReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCashReceiptsParamsWithHTTPClient(client *http.Client) *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + HTTPClient: client, + } +} + +/*GetCashReceiptsParams contains all the parameters to send to the API endpoint +for the get cash receipts operation typically these are written to a http.Request +*/ +type GetCashReceiptsParams struct { + + /*CashReceiptID + Taxnexus Record Id of a Cash Receipt + + */ + CashReceiptID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cash receipts params +func (o *GetCashReceiptsParams) WithTimeout(timeout time.Duration) *GetCashReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cash receipts params +func (o *GetCashReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cash receipts params +func (o *GetCashReceiptsParams) WithContext(ctx context.Context) *GetCashReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cash receipts params +func (o *GetCashReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cash receipts params +func (o *GetCashReceiptsParams) WithHTTPClient(client *http.Client) *GetCashReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cash receipts params +func (o *GetCashReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCashReceiptID adds the cashReceiptID to the get cash receipts params +func (o *GetCashReceiptsParams) WithCashReceiptID(cashReceiptID *string) *GetCashReceiptsParams { + o.SetCashReceiptID(cashReceiptID) + return o +} + +// SetCashReceiptID adds the cashReceiptId to the get cash receipts params +func (o *GetCashReceiptsParams) SetCashReceiptID(cashReceiptID *string) { + o.CashReceiptID = cashReceiptID +} + +// WithLimit adds the limit to the get cash receipts params +func (o *GetCashReceiptsParams) WithLimit(limit *int64) *GetCashReceiptsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get cash receipts params +func (o *GetCashReceiptsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get cash receipts params +func (o *GetCashReceiptsParams) WithOffset(offset *int64) *GetCashReceiptsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get cash receipts params +func (o *GetCashReceiptsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCashReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CashReceiptID != nil { + + // query param cashReceiptId + var qrCashReceiptID string + if o.CashReceiptID != nil { + qrCashReceiptID = *o.CashReceiptID + } + qCashReceiptID := qrCashReceiptID + if qCashReceiptID != "" { + if err := r.SetQueryParam("cashReceiptId", qCashReceiptID); 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/ops/ops_client/cash_receipt/get_cash_receipts_responses.go b/api/ops/ops_client/cash_receipt/get_cash_receipts_responses.go new file mode 100644 index 0000000..7b7ddd8 --- /dev/null +++ b/api/ops/ops_client/cash_receipt/get_cash_receipts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetCashReceiptsReader is a Reader for the GetCashReceipts structure. +type GetCashReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCashReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCashReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCashReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCashReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCashReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCashReceiptsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCashReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCashReceiptsOK creates a GetCashReceiptsOK with default headers values +func NewGetCashReceiptsOK() *GetCashReceiptsOK { + return &GetCashReceiptsOK{} +} + +/*GetCashReceiptsOK handles this case with default header values. + +Taxnexus Response with Cash Receipt objects +*/ +type GetCashReceiptsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.CashReceiptResponse +} + +func (o *GetCashReceiptsOK) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsOK %+v", 200, o.Payload) +} + +func (o *GetCashReceiptsOK) GetPayload() *ops_models.CashReceiptResponse { + return o.Payload +} + +func (o *GetCashReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.CashReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsUnauthorized creates a GetCashReceiptsUnauthorized with default headers values +func NewGetCashReceiptsUnauthorized() *GetCashReceiptsUnauthorized { + return &GetCashReceiptsUnauthorized{} +} + +/*GetCashReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCashReceiptsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetCashReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCashReceiptsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsForbidden creates a GetCashReceiptsForbidden with default headers values +func NewGetCashReceiptsForbidden() *GetCashReceiptsForbidden { + return &GetCashReceiptsForbidden{} +} + +/*GetCashReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCashReceiptsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetCashReceiptsForbidden) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *GetCashReceiptsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsNotFound creates a GetCashReceiptsNotFound with default headers values +func NewGetCashReceiptsNotFound() *GetCashReceiptsNotFound { + return &GetCashReceiptsNotFound{} +} + +/*GetCashReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCashReceiptsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetCashReceiptsNotFound) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *GetCashReceiptsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsUnprocessableEntity creates a GetCashReceiptsUnprocessableEntity with default headers values +func NewGetCashReceiptsUnprocessableEntity() *GetCashReceiptsUnprocessableEntity { + return &GetCashReceiptsUnprocessableEntity{} +} + +/*GetCashReceiptsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCashReceiptsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetCashReceiptsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCashReceiptsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsInternalServerError creates a GetCashReceiptsInternalServerError with default headers values +func NewGetCashReceiptsInternalServerError() *GetCashReceiptsInternalServerError { + return &GetCashReceiptsInternalServerError{} +} + +/*GetCashReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCashReceiptsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetCashReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCashReceiptsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/cash_receipt/post_cash_receipts_parameters.go b/api/ops/ops_client/cash_receipt/post_cash_receipts_parameters.go new file mode 100644 index 0000000..92d6e41 --- /dev/null +++ b/api/ops/ops_client/cash_receipt/post_cash_receipts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostCashReceiptsParams creates a new PostCashReceiptsParams object +// with the default values initialized. +func NewPostCashReceiptsParams() *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCashReceiptsParamsWithTimeout creates a new PostCashReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCashReceiptsParamsWithTimeout(timeout time.Duration) *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + + timeout: timeout, + } +} + +// NewPostCashReceiptsParamsWithContext creates a new PostCashReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCashReceiptsParamsWithContext(ctx context.Context) *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + + Context: ctx, + } +} + +// NewPostCashReceiptsParamsWithHTTPClient creates a new PostCashReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCashReceiptsParamsWithHTTPClient(client *http.Client) *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + HTTPClient: client, + } +} + +/*PostCashReceiptsParams contains all the parameters to send to the API endpoint +for the post cash receipts operation typically these are written to a http.Request +*/ +type PostCashReceiptsParams struct { + + /*CashReceiptRequest + A request with an array of Cash Receipot Objects + + */ + CashReceiptRequest *ops_models.CashReceiptRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post cash receipts params +func (o *PostCashReceiptsParams) WithTimeout(timeout time.Duration) *PostCashReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post cash receipts params +func (o *PostCashReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post cash receipts params +func (o *PostCashReceiptsParams) WithContext(ctx context.Context) *PostCashReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post cash receipts params +func (o *PostCashReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post cash receipts params +func (o *PostCashReceiptsParams) WithHTTPClient(client *http.Client) *PostCashReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post cash receipts params +func (o *PostCashReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCashReceiptRequest adds the cashReceiptRequest to the post cash receipts params +func (o *PostCashReceiptsParams) WithCashReceiptRequest(cashReceiptRequest *ops_models.CashReceiptRequest) *PostCashReceiptsParams { + o.SetCashReceiptRequest(cashReceiptRequest) + return o +} + +// SetCashReceiptRequest adds the cashReceiptRequest to the post cash receipts params +func (o *PostCashReceiptsParams) SetCashReceiptRequest(cashReceiptRequest *ops_models.CashReceiptRequest) { + o.CashReceiptRequest = cashReceiptRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCashReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CashReceiptRequest != nil { + if err := r.SetBodyParam(o.CashReceiptRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/cash_receipt/post_cash_receipts_responses.go b/api/ops/ops_client/cash_receipt/post_cash_receipts_responses.go new file mode 100644 index 0000000..3a8bfb4 --- /dev/null +++ b/api/ops/ops_client/cash_receipt/post_cash_receipts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostCashReceiptsReader is a Reader for the PostCashReceipts structure. +type PostCashReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCashReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCashReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCashReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCashReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCashReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostCashReceiptsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCashReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostCashReceiptsOK creates a PostCashReceiptsOK with default headers values +func NewPostCashReceiptsOK() *PostCashReceiptsOK { + return &PostCashReceiptsOK{} +} + +/*PostCashReceiptsOK handles this case with default header values. + +Taxnexus Response with Cash Receipt objects +*/ +type PostCashReceiptsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.CashReceiptResponse +} + +func (o *PostCashReceiptsOK) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsOK %+v", 200, o.Payload) +} + +func (o *PostCashReceiptsOK) GetPayload() *ops_models.CashReceiptResponse { + return o.Payload +} + +func (o *PostCashReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.CashReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsUnauthorized creates a PostCashReceiptsUnauthorized with default headers values +func NewPostCashReceiptsUnauthorized() *PostCashReceiptsUnauthorized { + return &PostCashReceiptsUnauthorized{} +} + +/*PostCashReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostCashReceiptsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostCashReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCashReceiptsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsForbidden creates a PostCashReceiptsForbidden with default headers values +func NewPostCashReceiptsForbidden() *PostCashReceiptsForbidden { + return &PostCashReceiptsForbidden{} +} + +/*PostCashReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostCashReceiptsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostCashReceiptsForbidden) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *PostCashReceiptsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsNotFound creates a PostCashReceiptsNotFound with default headers values +func NewPostCashReceiptsNotFound() *PostCashReceiptsNotFound { + return &PostCashReceiptsNotFound{} +} + +/*PostCashReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostCashReceiptsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostCashReceiptsNotFound) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *PostCashReceiptsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsUnprocessableEntity creates a PostCashReceiptsUnprocessableEntity with default headers values +func NewPostCashReceiptsUnprocessableEntity() *PostCashReceiptsUnprocessableEntity { + return &PostCashReceiptsUnprocessableEntity{} +} + +/*PostCashReceiptsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostCashReceiptsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostCashReceiptsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostCashReceiptsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsInternalServerError creates a PostCashReceiptsInternalServerError with default headers values +func NewPostCashReceiptsInternalServerError() *PostCashReceiptsInternalServerError { + return &PostCashReceiptsInternalServerError{} +} + +/*PostCashReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostCashReceiptsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostCashReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCashReceiptsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/cash_receipt/put_cash_receipts_parameters.go b/api/ops/ops_client/cash_receipt/put_cash_receipts_parameters.go new file mode 100644 index 0000000..a4a488b --- /dev/null +++ b/api/ops/ops_client/cash_receipt/put_cash_receipts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutCashReceiptsParams creates a new PutCashReceiptsParams object +// with the default values initialized. +func NewPutCashReceiptsParams() *PutCashReceiptsParams { + var () + return &PutCashReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutCashReceiptsParamsWithTimeout creates a new PutCashReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutCashReceiptsParamsWithTimeout(timeout time.Duration) *PutCashReceiptsParams { + var () + return &PutCashReceiptsParams{ + + timeout: timeout, + } +} + +// NewPutCashReceiptsParamsWithContext creates a new PutCashReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutCashReceiptsParamsWithContext(ctx context.Context) *PutCashReceiptsParams { + var () + return &PutCashReceiptsParams{ + + Context: ctx, + } +} + +// NewPutCashReceiptsParamsWithHTTPClient creates a new PutCashReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutCashReceiptsParamsWithHTTPClient(client *http.Client) *PutCashReceiptsParams { + var () + return &PutCashReceiptsParams{ + HTTPClient: client, + } +} + +/*PutCashReceiptsParams contains all the parameters to send to the API endpoint +for the put cash receipts operation typically these are written to a http.Request +*/ +type PutCashReceiptsParams struct { + + /*CashReceiptRequest + A request with an array of Cash Receipot Objects + + */ + CashReceiptRequest *ops_models.CashReceiptRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cash receipts params +func (o *PutCashReceiptsParams) WithTimeout(timeout time.Duration) *PutCashReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cash receipts params +func (o *PutCashReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cash receipts params +func (o *PutCashReceiptsParams) WithContext(ctx context.Context) *PutCashReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cash receipts params +func (o *PutCashReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cash receipts params +func (o *PutCashReceiptsParams) WithHTTPClient(client *http.Client) *PutCashReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cash receipts params +func (o *PutCashReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCashReceiptRequest adds the cashReceiptRequest to the put cash receipts params +func (o *PutCashReceiptsParams) WithCashReceiptRequest(cashReceiptRequest *ops_models.CashReceiptRequest) *PutCashReceiptsParams { + o.SetCashReceiptRequest(cashReceiptRequest) + return o +} + +// SetCashReceiptRequest adds the cashReceiptRequest to the put cash receipts params +func (o *PutCashReceiptsParams) SetCashReceiptRequest(cashReceiptRequest *ops_models.CashReceiptRequest) { + o.CashReceiptRequest = cashReceiptRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutCashReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CashReceiptRequest != nil { + if err := r.SetBodyParam(o.CashReceiptRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/cash_receipt/put_cash_receipts_responses.go b/api/ops/ops_client/cash_receipt/put_cash_receipts_responses.go new file mode 100644 index 0000000..4ba5868 --- /dev/null +++ b/api/ops/ops_client/cash_receipt/put_cash_receipts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipt + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutCashReceiptsReader is a Reader for the PutCashReceipts structure. +type PutCashReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutCashReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutCashReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutCashReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutCashReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutCashReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutCashReceiptsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutCashReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutCashReceiptsOK creates a PutCashReceiptsOK with default headers values +func NewPutCashReceiptsOK() *PutCashReceiptsOK { + return &PutCashReceiptsOK{} +} + +/*PutCashReceiptsOK handles this case with default header values. + +Taxnexus Response with Cash Receipt objects +*/ +type PutCashReceiptsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.CashReceiptResponse +} + +func (o *PutCashReceiptsOK) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReceiptsOK %+v", 200, o.Payload) +} + +func (o *PutCashReceiptsOK) GetPayload() *ops_models.CashReceiptResponse { + return o.Payload +} + +func (o *PutCashReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.CashReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReceiptsUnauthorized creates a PutCashReceiptsUnauthorized with default headers values +func NewPutCashReceiptsUnauthorized() *PutCashReceiptsUnauthorized { + return &PutCashReceiptsUnauthorized{} +} + +/*PutCashReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutCashReceiptsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutCashReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutCashReceiptsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutCashReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReceiptsForbidden creates a PutCashReceiptsForbidden with default headers values +func NewPutCashReceiptsForbidden() *PutCashReceiptsForbidden { + return &PutCashReceiptsForbidden{} +} + +/*PutCashReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutCashReceiptsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutCashReceiptsForbidden) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *PutCashReceiptsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutCashReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReceiptsNotFound creates a PutCashReceiptsNotFound with default headers values +func NewPutCashReceiptsNotFound() *PutCashReceiptsNotFound { + return &PutCashReceiptsNotFound{} +} + +/*PutCashReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutCashReceiptsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutCashReceiptsNotFound) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *PutCashReceiptsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutCashReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReceiptsUnprocessableEntity creates a PutCashReceiptsUnprocessableEntity with default headers values +func NewPutCashReceiptsUnprocessableEntity() *PutCashReceiptsUnprocessableEntity { + return &PutCashReceiptsUnprocessableEntity{} +} + +/*PutCashReceiptsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutCashReceiptsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutCashReceiptsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReceiptsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutCashReceiptsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutCashReceiptsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReceiptsInternalServerError creates a PutCashReceiptsInternalServerError with default headers values +func NewPutCashReceiptsInternalServerError() *PutCashReceiptsInternalServerError { + return &PutCashReceiptsInternalServerError{} +} + +/*PutCashReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutCashReceiptsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutCashReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutCashReceiptsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutCashReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/charge/charge_client.go b/api/ops/ops_client/charge/charge_client.go new file mode 100644 index 0000000..bbe5f3e --- /dev/null +++ b/api/ops/ops_client/charge/charge_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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 charge API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for charge API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteCharge(params *DeleteChargeParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteChargeOK, error) + + GetCharges(params *GetChargesParams, authInfo runtime.ClientAuthInfoWriter) (*GetChargesOK, error) + + PostCharges(params *PostChargesParams, authInfo runtime.ClientAuthInfoWriter) (*PostChargesOK, error) + + PutCharges(params *PutChargesParams, authInfo runtime.ClientAuthInfoWriter) (*PutChargesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteCharge deletes a charge + + Delete a Charge by ID +*/ +func (a *Client) DeleteCharge(params *DeleteChargeParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteChargeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteChargeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteCharge", + Method: "DELETE", + PathPattern: "/charges", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteChargeReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteChargeOK) + 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 deleteCharge: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetCharges gets a list of charges + + Return a list of available Taxnexus Charges +*/ +func (a *Client) GetCharges(params *GetChargesParams, authInfo runtime.ClientAuthInfoWriter) (*GetChargesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetChargesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCharges", + Method: "GET", + PathPattern: "/charges", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetChargesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetChargesOK) + 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 getCharges: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCharges creates new charges + + Create New Charges +*/ +func (a *Client) PostCharges(params *PostChargesParams, authInfo runtime.ClientAuthInfoWriter) (*PostChargesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostChargesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCharges", + Method: "POST", + PathPattern: "/charges", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostChargesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostChargesOK) + 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 postCharges: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutCharges puts a list of charges + + Put a list of Charges +*/ +func (a *Client) PutCharges(params *PutChargesParams, authInfo runtime.ClientAuthInfoWriter) (*PutChargesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutChargesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putCharges", + Method: "PUT", + PathPattern: "/charges", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutChargesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutChargesOK) + 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 putCharges: 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/ops/ops_client/charge/delete_charge_parameters.go b/api/ops/ops_client/charge/delete_charge_parameters.go new file mode 100644 index 0000000..122a252 --- /dev/null +++ b/api/ops/ops_client/charge/delete_charge_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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" +) + +// NewDeleteChargeParams creates a new DeleteChargeParams object +// with the default values initialized. +func NewDeleteChargeParams() *DeleteChargeParams { + var () + return &DeleteChargeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteChargeParamsWithTimeout creates a new DeleteChargeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteChargeParamsWithTimeout(timeout time.Duration) *DeleteChargeParams { + var () + return &DeleteChargeParams{ + + timeout: timeout, + } +} + +// NewDeleteChargeParamsWithContext creates a new DeleteChargeParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteChargeParamsWithContext(ctx context.Context) *DeleteChargeParams { + var () + return &DeleteChargeParams{ + + Context: ctx, + } +} + +// NewDeleteChargeParamsWithHTTPClient creates a new DeleteChargeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteChargeParamsWithHTTPClient(client *http.Client) *DeleteChargeParams { + var () + return &DeleteChargeParams{ + HTTPClient: client, + } +} + +/*DeleteChargeParams contains all the parameters to send to the API endpoint +for the delete charge operation typically these are written to a http.Request +*/ +type DeleteChargeParams struct { + + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete charge params +func (o *DeleteChargeParams) WithTimeout(timeout time.Duration) *DeleteChargeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete charge params +func (o *DeleteChargeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete charge params +func (o *DeleteChargeParams) WithContext(ctx context.Context) *DeleteChargeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete charge params +func (o *DeleteChargeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete charge params +func (o *DeleteChargeParams) WithHTTPClient(client *http.Client) *DeleteChargeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete charge params +func (o *DeleteChargeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete charge params +func (o *DeleteChargeParams) WithID(id *string) *DeleteChargeParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete charge params +func (o *DeleteChargeParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteChargeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/charge/delete_charge_responses.go b/api/ops/ops_client/charge/delete_charge_responses.go new file mode 100644 index 0000000..b075d99 --- /dev/null +++ b/api/ops/ops_client/charge/delete_charge_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeleteChargeReader is a Reader for the DeleteCharge structure. +type DeleteChargeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteChargeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteChargeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteChargeUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteChargeForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteChargeNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteChargeUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteChargeInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteChargeOK creates a DeleteChargeOK with default headers values +func NewDeleteChargeOK() *DeleteChargeOK { + return &DeleteChargeOK{} +} + +/*DeleteChargeOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteChargeOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.DeleteResponse +} + +func (o *DeleteChargeOK) Error() string { + return fmt.Sprintf("[DELETE /charges][%d] deleteChargeOK %+v", 200, o.Payload) +} + +func (o *DeleteChargeOK) GetPayload() *ops_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteChargeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteChargeUnauthorized creates a DeleteChargeUnauthorized with default headers values +func NewDeleteChargeUnauthorized() *DeleteChargeUnauthorized { + return &DeleteChargeUnauthorized{} +} + +/*DeleteChargeUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteChargeUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteChargeUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /charges][%d] deleteChargeUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteChargeUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteChargeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteChargeForbidden creates a DeleteChargeForbidden with default headers values +func NewDeleteChargeForbidden() *DeleteChargeForbidden { + return &DeleteChargeForbidden{} +} + +/*DeleteChargeForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteChargeForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteChargeForbidden) Error() string { + return fmt.Sprintf("[DELETE /charges][%d] deleteChargeForbidden %+v", 403, o.Payload) +} + +func (o *DeleteChargeForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteChargeForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteChargeNotFound creates a DeleteChargeNotFound with default headers values +func NewDeleteChargeNotFound() *DeleteChargeNotFound { + return &DeleteChargeNotFound{} +} + +/*DeleteChargeNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteChargeNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteChargeNotFound) Error() string { + return fmt.Sprintf("[DELETE /charges][%d] deleteChargeNotFound %+v", 404, o.Payload) +} + +func (o *DeleteChargeNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteChargeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteChargeUnprocessableEntity creates a DeleteChargeUnprocessableEntity with default headers values +func NewDeleteChargeUnprocessableEntity() *DeleteChargeUnprocessableEntity { + return &DeleteChargeUnprocessableEntity{} +} + +/*DeleteChargeUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteChargeUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteChargeUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /charges][%d] deleteChargeUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteChargeUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteChargeUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteChargeInternalServerError creates a DeleteChargeInternalServerError with default headers values +func NewDeleteChargeInternalServerError() *DeleteChargeInternalServerError { + return &DeleteChargeInternalServerError{} +} + +/*DeleteChargeInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteChargeInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteChargeInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /charges][%d] deleteChargeInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteChargeInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteChargeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/charge/get_charges_parameters.go b/api/ops/ops_client/charge/get_charges_parameters.go new file mode 100644 index 0000000..644437f --- /dev/null +++ b/api/ops/ops_client/charge/get_charges_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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" +) + +// NewGetChargesParams creates a new GetChargesParams object +// with the default values initialized. +func NewGetChargesParams() *GetChargesParams { + var () + return &GetChargesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetChargesParamsWithTimeout creates a new GetChargesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetChargesParamsWithTimeout(timeout time.Duration) *GetChargesParams { + var () + return &GetChargesParams{ + + timeout: timeout, + } +} + +// NewGetChargesParamsWithContext creates a new GetChargesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetChargesParamsWithContext(ctx context.Context) *GetChargesParams { + var () + return &GetChargesParams{ + + Context: ctx, + } +} + +// NewGetChargesParamsWithHTTPClient creates a new GetChargesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetChargesParamsWithHTTPClient(client *http.Client) *GetChargesParams { + var () + return &GetChargesParams{ + HTTPClient: client, + } +} + +/*GetChargesParams contains all the parameters to send to the API endpoint +for the get charges operation typically these are written to a http.Request +*/ +type GetChargesParams struct { + + /*ChargeID + Taxnexus Record Id of a Charge + + */ + ChargeID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get charges params +func (o *GetChargesParams) WithTimeout(timeout time.Duration) *GetChargesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get charges params +func (o *GetChargesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get charges params +func (o *GetChargesParams) WithContext(ctx context.Context) *GetChargesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get charges params +func (o *GetChargesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get charges params +func (o *GetChargesParams) WithHTTPClient(client *http.Client) *GetChargesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get charges params +func (o *GetChargesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChargeID adds the chargeID to the get charges params +func (o *GetChargesParams) WithChargeID(chargeID *string) *GetChargesParams { + o.SetChargeID(chargeID) + return o +} + +// SetChargeID adds the chargeId to the get charges params +func (o *GetChargesParams) SetChargeID(chargeID *string) { + o.ChargeID = chargeID +} + +// WithLimit adds the limit to the get charges params +func (o *GetChargesParams) WithLimit(limit *int64) *GetChargesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get charges params +func (o *GetChargesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get charges params +func (o *GetChargesParams) WithOffset(offset *int64) *GetChargesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get charges params +func (o *GetChargesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetChargesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ChargeID != nil { + + // query param chargeId + var qrChargeID string + if o.ChargeID != nil { + qrChargeID = *o.ChargeID + } + qChargeID := qrChargeID + if qChargeID != "" { + if err := r.SetQueryParam("chargeId", qChargeID); 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/ops/ops_client/charge/get_charges_responses.go b/api/ops/ops_client/charge/get_charges_responses.go new file mode 100644 index 0000000..162fa34 --- /dev/null +++ b/api/ops/ops_client/charge/get_charges_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetChargesReader is a Reader for the GetCharges structure. +type GetChargesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetChargesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetChargesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetChargesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetChargesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetChargesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetChargesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetChargesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetChargesOK creates a GetChargesOK with default headers values +func NewGetChargesOK() *GetChargesOK { + return &GetChargesOK{} +} + +/*GetChargesOK handles this case with default header values. + +Taxnexus Response with Charge objects +*/ +type GetChargesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.ChargeResponse +} + +func (o *GetChargesOK) Error() string { + return fmt.Sprintf("[GET /charges][%d] getChargesOK %+v", 200, o.Payload) +} + +func (o *GetChargesOK) GetPayload() *ops_models.ChargeResponse { + return o.Payload +} + +func (o *GetChargesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.ChargeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetChargesUnauthorized creates a GetChargesUnauthorized with default headers values +func NewGetChargesUnauthorized() *GetChargesUnauthorized { + return &GetChargesUnauthorized{} +} + +/*GetChargesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetChargesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetChargesUnauthorized) Error() string { + return fmt.Sprintf("[GET /charges][%d] getChargesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetChargesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetChargesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetChargesForbidden creates a GetChargesForbidden with default headers values +func NewGetChargesForbidden() *GetChargesForbidden { + return &GetChargesForbidden{} +} + +/*GetChargesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetChargesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetChargesForbidden) Error() string { + return fmt.Sprintf("[GET /charges][%d] getChargesForbidden %+v", 403, o.Payload) +} + +func (o *GetChargesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetChargesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetChargesNotFound creates a GetChargesNotFound with default headers values +func NewGetChargesNotFound() *GetChargesNotFound { + return &GetChargesNotFound{} +} + +/*GetChargesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetChargesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetChargesNotFound) Error() string { + return fmt.Sprintf("[GET /charges][%d] getChargesNotFound %+v", 404, o.Payload) +} + +func (o *GetChargesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetChargesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetChargesUnprocessableEntity creates a GetChargesUnprocessableEntity with default headers values +func NewGetChargesUnprocessableEntity() *GetChargesUnprocessableEntity { + return &GetChargesUnprocessableEntity{} +} + +/*GetChargesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetChargesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetChargesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /charges][%d] getChargesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetChargesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetChargesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetChargesInternalServerError creates a GetChargesInternalServerError with default headers values +func NewGetChargesInternalServerError() *GetChargesInternalServerError { + return &GetChargesInternalServerError{} +} + +/*GetChargesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetChargesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetChargesInternalServerError) Error() string { + return fmt.Sprintf("[GET /charges][%d] getChargesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetChargesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetChargesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/charge/post_charges_parameters.go b/api/ops/ops_client/charge/post_charges_parameters.go new file mode 100644 index 0000000..7d25879 --- /dev/null +++ b/api/ops/ops_client/charge/post_charges_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostChargesParams creates a new PostChargesParams object +// with the default values initialized. +func NewPostChargesParams() *PostChargesParams { + var () + return &PostChargesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostChargesParamsWithTimeout creates a new PostChargesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostChargesParamsWithTimeout(timeout time.Duration) *PostChargesParams { + var () + return &PostChargesParams{ + + timeout: timeout, + } +} + +// NewPostChargesParamsWithContext creates a new PostChargesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostChargesParamsWithContext(ctx context.Context) *PostChargesParams { + var () + return &PostChargesParams{ + + Context: ctx, + } +} + +// NewPostChargesParamsWithHTTPClient creates a new PostChargesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostChargesParamsWithHTTPClient(client *http.Client) *PostChargesParams { + var () + return &PostChargesParams{ + HTTPClient: client, + } +} + +/*PostChargesParams contains all the parameters to send to the API endpoint +for the post charges operation typically these are written to a http.Request +*/ +type PostChargesParams struct { + + /*ChargeRequest + A request with an array of Charge Objects + + */ + ChargeRequest *ops_models.ChargeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post charges params +func (o *PostChargesParams) WithTimeout(timeout time.Duration) *PostChargesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post charges params +func (o *PostChargesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post charges params +func (o *PostChargesParams) WithContext(ctx context.Context) *PostChargesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post charges params +func (o *PostChargesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post charges params +func (o *PostChargesParams) WithHTTPClient(client *http.Client) *PostChargesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post charges params +func (o *PostChargesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChargeRequest adds the chargeRequest to the post charges params +func (o *PostChargesParams) WithChargeRequest(chargeRequest *ops_models.ChargeRequest) *PostChargesParams { + o.SetChargeRequest(chargeRequest) + return o +} + +// SetChargeRequest adds the chargeRequest to the post charges params +func (o *PostChargesParams) SetChargeRequest(chargeRequest *ops_models.ChargeRequest) { + o.ChargeRequest = chargeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostChargesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ChargeRequest != nil { + if err := r.SetBodyParam(o.ChargeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/charge/post_charges_responses.go b/api/ops/ops_client/charge/post_charges_responses.go new file mode 100644 index 0000000..44285fa --- /dev/null +++ b/api/ops/ops_client/charge/post_charges_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostChargesReader is a Reader for the PostCharges structure. +type PostChargesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostChargesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostChargesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostChargesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostChargesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostChargesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostChargesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostChargesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostChargesOK creates a PostChargesOK with default headers values +func NewPostChargesOK() *PostChargesOK { + return &PostChargesOK{} +} + +/*PostChargesOK handles this case with default header values. + +Taxnexus Response with Charge objects +*/ +type PostChargesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.ChargeResponse +} + +func (o *PostChargesOK) Error() string { + return fmt.Sprintf("[POST /charges][%d] postChargesOK %+v", 200, o.Payload) +} + +func (o *PostChargesOK) GetPayload() *ops_models.ChargeResponse { + return o.Payload +} + +func (o *PostChargesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.ChargeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostChargesUnauthorized creates a PostChargesUnauthorized with default headers values +func NewPostChargesUnauthorized() *PostChargesUnauthorized { + return &PostChargesUnauthorized{} +} + +/*PostChargesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostChargesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostChargesUnauthorized) Error() string { + return fmt.Sprintf("[POST /charges][%d] postChargesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostChargesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostChargesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostChargesForbidden creates a PostChargesForbidden with default headers values +func NewPostChargesForbidden() *PostChargesForbidden { + return &PostChargesForbidden{} +} + +/*PostChargesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostChargesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostChargesForbidden) Error() string { + return fmt.Sprintf("[POST /charges][%d] postChargesForbidden %+v", 403, o.Payload) +} + +func (o *PostChargesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostChargesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostChargesNotFound creates a PostChargesNotFound with default headers values +func NewPostChargesNotFound() *PostChargesNotFound { + return &PostChargesNotFound{} +} + +/*PostChargesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostChargesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostChargesNotFound) Error() string { + return fmt.Sprintf("[POST /charges][%d] postChargesNotFound %+v", 404, o.Payload) +} + +func (o *PostChargesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostChargesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostChargesUnprocessableEntity creates a PostChargesUnprocessableEntity with default headers values +func NewPostChargesUnprocessableEntity() *PostChargesUnprocessableEntity { + return &PostChargesUnprocessableEntity{} +} + +/*PostChargesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostChargesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostChargesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /charges][%d] postChargesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostChargesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostChargesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostChargesInternalServerError creates a PostChargesInternalServerError with default headers values +func NewPostChargesInternalServerError() *PostChargesInternalServerError { + return &PostChargesInternalServerError{} +} + +/*PostChargesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostChargesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostChargesInternalServerError) Error() string { + return fmt.Sprintf("[POST /charges][%d] postChargesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostChargesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostChargesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/charge/put_charges_parameters.go b/api/ops/ops_client/charge/put_charges_parameters.go new file mode 100644 index 0000000..e240607 --- /dev/null +++ b/api/ops/ops_client/charge/put_charges_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutChargesParams creates a new PutChargesParams object +// with the default values initialized. +func NewPutChargesParams() *PutChargesParams { + var () + return &PutChargesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutChargesParamsWithTimeout creates a new PutChargesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutChargesParamsWithTimeout(timeout time.Duration) *PutChargesParams { + var () + return &PutChargesParams{ + + timeout: timeout, + } +} + +// NewPutChargesParamsWithContext creates a new PutChargesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutChargesParamsWithContext(ctx context.Context) *PutChargesParams { + var () + return &PutChargesParams{ + + Context: ctx, + } +} + +// NewPutChargesParamsWithHTTPClient creates a new PutChargesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutChargesParamsWithHTTPClient(client *http.Client) *PutChargesParams { + var () + return &PutChargesParams{ + HTTPClient: client, + } +} + +/*PutChargesParams contains all the parameters to send to the API endpoint +for the put charges operation typically these are written to a http.Request +*/ +type PutChargesParams struct { + + /*ChargeRequest + A request with an array of Charge Objects + + */ + ChargeRequest *ops_models.ChargeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put charges params +func (o *PutChargesParams) WithTimeout(timeout time.Duration) *PutChargesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put charges params +func (o *PutChargesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put charges params +func (o *PutChargesParams) WithContext(ctx context.Context) *PutChargesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put charges params +func (o *PutChargesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put charges params +func (o *PutChargesParams) WithHTTPClient(client *http.Client) *PutChargesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put charges params +func (o *PutChargesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChargeRequest adds the chargeRequest to the put charges params +func (o *PutChargesParams) WithChargeRequest(chargeRequest *ops_models.ChargeRequest) *PutChargesParams { + o.SetChargeRequest(chargeRequest) + return o +} + +// SetChargeRequest adds the chargeRequest to the put charges params +func (o *PutChargesParams) SetChargeRequest(chargeRequest *ops_models.ChargeRequest) { + o.ChargeRequest = chargeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutChargesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ChargeRequest != nil { + if err := r.SetBodyParam(o.ChargeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/charge/put_charges_responses.go b/api/ops/ops_client/charge/put_charges_responses.go new file mode 100644 index 0000000..eebeb6e --- /dev/null +++ b/api/ops/ops_client/charge/put_charges_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package charge + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutChargesReader is a Reader for the PutCharges structure. +type PutChargesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutChargesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutChargesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutChargesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutChargesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutChargesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutChargesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutChargesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutChargesOK creates a PutChargesOK with default headers values +func NewPutChargesOK() *PutChargesOK { + return &PutChargesOK{} +} + +/*PutChargesOK handles this case with default header values. + +Taxnexus Response with an array of Message objects in response to a PUT +*/ +type PutChargesOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.PutResponse +} + +func (o *PutChargesOK) Error() string { + return fmt.Sprintf("[PUT /charges][%d] putChargesOK %+v", 200, o.Payload) +} + +func (o *PutChargesOK) GetPayload() *ops_models.PutResponse { + return o.Payload +} + +func (o *PutChargesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.PutResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutChargesUnauthorized creates a PutChargesUnauthorized with default headers values +func NewPutChargesUnauthorized() *PutChargesUnauthorized { + return &PutChargesUnauthorized{} +} + +/*PutChargesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutChargesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutChargesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /charges][%d] putChargesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutChargesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutChargesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutChargesForbidden creates a PutChargesForbidden with default headers values +func NewPutChargesForbidden() *PutChargesForbidden { + return &PutChargesForbidden{} +} + +/*PutChargesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutChargesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutChargesForbidden) Error() string { + return fmt.Sprintf("[PUT /charges][%d] putChargesForbidden %+v", 403, o.Payload) +} + +func (o *PutChargesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutChargesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutChargesNotFound creates a PutChargesNotFound with default headers values +func NewPutChargesNotFound() *PutChargesNotFound { + return &PutChargesNotFound{} +} + +/*PutChargesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutChargesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutChargesNotFound) Error() string { + return fmt.Sprintf("[PUT /charges][%d] putChargesNotFound %+v", 404, o.Payload) +} + +func (o *PutChargesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutChargesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutChargesUnprocessableEntity creates a PutChargesUnprocessableEntity with default headers values +func NewPutChargesUnprocessableEntity() *PutChargesUnprocessableEntity { + return &PutChargesUnprocessableEntity{} +} + +/*PutChargesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutChargesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutChargesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /charges][%d] putChargesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutChargesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutChargesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutChargesInternalServerError creates a PutChargesInternalServerError with default headers values +func NewPutChargesInternalServerError() *PutChargesInternalServerError { + return &PutChargesInternalServerError{} +} + +/*PutChargesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutChargesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutChargesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /charges][%d] putChargesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutChargesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutChargesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/cors/cash_receipt_options_parameters.go b/api/ops/ops_client/cors/cash_receipt_options_parameters.go new file mode 100644 index 0000000..419f21b --- /dev/null +++ b/api/ops/ops_client/cors/cash_receipt_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewCashReceiptOptionsParams creates a new CashReceiptOptionsParams object +// with the default values initialized. +func NewCashReceiptOptionsParams() *CashReceiptOptionsParams { + + return &CashReceiptOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCashReceiptOptionsParamsWithTimeout creates a new CashReceiptOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCashReceiptOptionsParamsWithTimeout(timeout time.Duration) *CashReceiptOptionsParams { + + return &CashReceiptOptionsParams{ + + timeout: timeout, + } +} + +// NewCashReceiptOptionsParamsWithContext creates a new CashReceiptOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewCashReceiptOptionsParamsWithContext(ctx context.Context) *CashReceiptOptionsParams { + + return &CashReceiptOptionsParams{ + + Context: ctx, + } +} + +// NewCashReceiptOptionsParamsWithHTTPClient creates a new CashReceiptOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCashReceiptOptionsParamsWithHTTPClient(client *http.Client) *CashReceiptOptionsParams { + + return &CashReceiptOptionsParams{ + HTTPClient: client, + } +} + +/*CashReceiptOptionsParams contains all the parameters to send to the API endpoint +for the cash receipt options operation typically these are written to a http.Request +*/ +type CashReceiptOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cash receipt options params +func (o *CashReceiptOptionsParams) WithTimeout(timeout time.Duration) *CashReceiptOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cash receipt options params +func (o *CashReceiptOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cash receipt options params +func (o *CashReceiptOptionsParams) WithContext(ctx context.Context) *CashReceiptOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cash receipt options params +func (o *CashReceiptOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cash receipt options params +func (o *CashReceiptOptionsParams) WithHTTPClient(client *http.Client) *CashReceiptOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cash receipt options params +func (o *CashReceiptOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CashReceiptOptionsParams) 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/ops/ops_client/cors/cash_receipt_options_responses.go b/api/ops/ops_client/cors/cash_receipt_options_responses.go new file mode 100644 index 0000000..394f84c --- /dev/null +++ b/api/ops/ops_client/cors/cash_receipt_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// CashReceiptOptionsReader is a Reader for the CashReceiptOptions structure. +type CashReceiptOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CashReceiptOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCashReceiptOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCashReceiptOptionsOK creates a CashReceiptOptionsOK with default headers values +func NewCashReceiptOptionsOK() *CashReceiptOptionsOK { + return &CashReceiptOptionsOK{} +} + +/*CashReceiptOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type CashReceiptOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *CashReceiptOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /cashreceipts][%d] cashReceiptOptionsOK ", 200) +} + +func (o *CashReceiptOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/charge_options_parameters.go b/api/ops/ops_client/cors/charge_options_parameters.go new file mode 100644 index 0000000..a5767e2 --- /dev/null +++ b/api/ops/ops_client/cors/charge_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewChargeOptionsParams creates a new ChargeOptionsParams object +// with the default values initialized. +func NewChargeOptionsParams() *ChargeOptionsParams { + + return &ChargeOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewChargeOptionsParamsWithTimeout creates a new ChargeOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewChargeOptionsParamsWithTimeout(timeout time.Duration) *ChargeOptionsParams { + + return &ChargeOptionsParams{ + + timeout: timeout, + } +} + +// NewChargeOptionsParamsWithContext creates a new ChargeOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewChargeOptionsParamsWithContext(ctx context.Context) *ChargeOptionsParams { + + return &ChargeOptionsParams{ + + Context: ctx, + } +} + +// NewChargeOptionsParamsWithHTTPClient creates a new ChargeOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewChargeOptionsParamsWithHTTPClient(client *http.Client) *ChargeOptionsParams { + + return &ChargeOptionsParams{ + HTTPClient: client, + } +} + +/*ChargeOptionsParams contains all the parameters to send to the API endpoint +for the charge options operation typically these are written to a http.Request +*/ +type ChargeOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the charge options params +func (o *ChargeOptionsParams) WithTimeout(timeout time.Duration) *ChargeOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the charge options params +func (o *ChargeOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the charge options params +func (o *ChargeOptionsParams) WithContext(ctx context.Context) *ChargeOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the charge options params +func (o *ChargeOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the charge options params +func (o *ChargeOptionsParams) WithHTTPClient(client *http.Client) *ChargeOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the charge options params +func (o *ChargeOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ChargeOptionsParams) 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/ops/ops_client/cors/charge_options_responses.go b/api/ops/ops_client/cors/charge_options_responses.go new file mode 100644 index 0000000..18adb89 --- /dev/null +++ b/api/ops/ops_client/cors/charge_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// ChargeOptionsReader is a Reader for the ChargeOptions structure. +type ChargeOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ChargeOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewChargeOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewChargeOptionsOK creates a ChargeOptionsOK with default headers values +func NewChargeOptionsOK() *ChargeOptionsOK { + return &ChargeOptionsOK{} +} + +/*ChargeOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type ChargeOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *ChargeOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /charges][%d] chargeOptionsOK ", 200) +} + +func (o *ChargeOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/cors_client.go b/api/ops/ops_client/cors/cors_client.go new file mode 100644 index 0000000..cbb9cd8 --- /dev/null +++ b/api/ops/ops_client/cors/cors_client.go @@ -0,0 +1,544 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + CashReceiptOptions(params *CashReceiptOptionsParams) (*CashReceiptOptionsOK, error) + + ChargeOptions(params *ChargeOptionsParams) (*ChargeOptionsOK, error) + + EftOptions(params *EftOptionsParams) (*EftOptionsOK, error) + + InvoiceOptions(params *InvoiceOptionsParams) (*InvoiceOptionsOK, error) + + OrdersOptions(params *OrdersOptionsParams) (*OrdersOptionsOK, error) + + PaymentMethodOptions(params *PaymentMethodOptionsParams) (*PaymentMethodOptionsOK, error) + + PoOptions(params *PoOptionsParams) (*PoOptionsOK, error) + + ProductOptions(params *ProductOptionsParams) (*ProductOptionsOK, error) + + ProductOptionsObservable(params *ProductOptionsObservableParams) (*ProductOptionsObservableOK, error) + + QuoteOptions(params *QuoteOptionsParams) (*QuoteOptionsOK, error) + + TaxInvoiceOptions(params *TaxInvoiceOptionsParams) (*TaxInvoiceOptionsOK, error) + + TaxOrderOptions(params *TaxOrderOptionsParams) (*TaxOrderOptionsOK, error) + + TaxPoOptions(params *TaxPoOptionsParams) (*TaxPoOptionsOK, error) + + TaxQuoteOptions(params *TaxQuoteOptionsParams) (*TaxQuoteOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CashReceiptOptions CORS support +*/ +func (a *Client) CashReceiptOptions(params *CashReceiptOptionsParams) (*CashReceiptOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCashReceiptOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "cashReceiptOptions", + Method: "OPTIONS", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CashReceiptOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CashReceiptOptionsOK) + 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 cashReceiptOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ChargeOptions CORS support +*/ +func (a *Client) ChargeOptions(params *ChargeOptionsParams) (*ChargeOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewChargeOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "chargeOptions", + Method: "OPTIONS", + PathPattern: "/charges", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ChargeOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ChargeOptionsOK) + 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 chargeOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + EftOptions CORS support +*/ +func (a *Client) EftOptions(params *EftOptionsParams) (*EftOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewEftOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "eftOptions", + Method: "OPTIONS", + PathPattern: "/efts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &EftOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*EftOptionsOK) + 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 eftOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + InvoiceOptions CORS support +*/ +func (a *Client) InvoiceOptions(params *InvoiceOptionsParams) (*InvoiceOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewInvoiceOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "invoiceOptions", + Method: "OPTIONS", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &InvoiceOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*InvoiceOptionsOK) + 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 invoiceOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + OrdersOptions CORS support +*/ +func (a *Client) OrdersOptions(params *OrdersOptionsParams) (*OrdersOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOrdersOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ordersOptions", + Method: "OPTIONS", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OrdersOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OrdersOptionsOK) + 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 ordersOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PaymentMethodOptions CORS support +*/ +func (a *Client) PaymentMethodOptions(params *PaymentMethodOptionsParams) (*PaymentMethodOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPaymentMethodOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "paymentMethodOptions", + Method: "OPTIONS", + PathPattern: "/paymentmethods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PaymentMethodOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PaymentMethodOptionsOK) + 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 paymentMethodOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PoOptions CORS support +*/ +func (a *Client) PoOptions(params *PoOptionsParams) (*PoOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPoOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "poOptions", + Method: "OPTIONS", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PoOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PoOptionsOK) + 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 poOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ProductOptions CORS support +*/ +func (a *Client) ProductOptions(params *ProductOptionsParams) (*ProductOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewProductOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "productOptions", + Method: "OPTIONS", + PathPattern: "/products", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ProductOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ProductOptionsOK) + 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 productOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ProductOptionsObservable CORS support +*/ +func (a *Client) ProductOptionsObservable(params *ProductOptionsObservableParams) (*ProductOptionsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewProductOptionsObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "productOptionsObservable", + Method: "OPTIONS", + PathPattern: "/products/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ProductOptionsObservableReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ProductOptionsObservableOK) + 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 productOptionsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + QuoteOptions CORS support +*/ +func (a *Client) QuoteOptions(params *QuoteOptionsParams) (*QuoteOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewQuoteOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "quoteOptions", + Method: "OPTIONS", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &QuoteOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*QuoteOptionsOK) + 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 quoteOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TaxInvoiceOptions CORS support +*/ +func (a *Client) TaxInvoiceOptions(params *TaxInvoiceOptionsParams) (*TaxInvoiceOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaxInvoiceOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "taxInvoiceOptions", + Method: "OPTIONS", + PathPattern: "/taxes/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaxInvoiceOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaxInvoiceOptionsOK) + 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 taxInvoiceOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TaxOrderOptions CORS support +*/ +func (a *Client) TaxOrderOptions(params *TaxOrderOptionsParams) (*TaxOrderOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaxOrderOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "taxOrderOptions", + Method: "OPTIONS", + PathPattern: "/taxes/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaxOrderOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaxOrderOptionsOK) + 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 taxOrderOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TaxPoOptions CORS support +*/ +func (a *Client) TaxPoOptions(params *TaxPoOptionsParams) (*TaxPoOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaxPoOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "taxPoOptions", + Method: "OPTIONS", + PathPattern: "/taxes/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaxPoOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaxPoOptionsOK) + 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 taxPoOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TaxQuoteOptions CORS support +*/ +func (a *Client) TaxQuoteOptions(params *TaxQuoteOptionsParams) (*TaxQuoteOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaxQuoteOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "taxQuoteOptions", + Method: "OPTIONS", + PathPattern: "/taxes/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaxQuoteOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaxQuoteOptionsOK) + 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 taxQuoteOptions: 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/ops/ops_client/cors/eft_options_parameters.go b/api/ops/ops_client/cors/eft_options_parameters.go new file mode 100644 index 0000000..126e00d --- /dev/null +++ b/api/ops/ops_client/cors/eft_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewEftOptionsParams creates a new EftOptionsParams object +// with the default values initialized. +func NewEftOptionsParams() *EftOptionsParams { + + return &EftOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewEftOptionsParamsWithTimeout creates a new EftOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewEftOptionsParamsWithTimeout(timeout time.Duration) *EftOptionsParams { + + return &EftOptionsParams{ + + timeout: timeout, + } +} + +// NewEftOptionsParamsWithContext creates a new EftOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewEftOptionsParamsWithContext(ctx context.Context) *EftOptionsParams { + + return &EftOptionsParams{ + + Context: ctx, + } +} + +// NewEftOptionsParamsWithHTTPClient creates a new EftOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewEftOptionsParamsWithHTTPClient(client *http.Client) *EftOptionsParams { + + return &EftOptionsParams{ + HTTPClient: client, + } +} + +/*EftOptionsParams contains all the parameters to send to the API endpoint +for the eft options operation typically these are written to a http.Request +*/ +type EftOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the eft options params +func (o *EftOptionsParams) WithTimeout(timeout time.Duration) *EftOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the eft options params +func (o *EftOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the eft options params +func (o *EftOptionsParams) WithContext(ctx context.Context) *EftOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the eft options params +func (o *EftOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the eft options params +func (o *EftOptionsParams) WithHTTPClient(client *http.Client) *EftOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the eft options params +func (o *EftOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *EftOptionsParams) 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/ops/ops_client/cors/eft_options_responses.go b/api/ops/ops_client/cors/eft_options_responses.go new file mode 100644 index 0000000..2309f44 --- /dev/null +++ b/api/ops/ops_client/cors/eft_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// EftOptionsReader is a Reader for the EftOptions structure. +type EftOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *EftOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewEftOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewEftOptionsOK creates a EftOptionsOK with default headers values +func NewEftOptionsOK() *EftOptionsOK { + return &EftOptionsOK{} +} + +/*EftOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type EftOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *EftOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /efts][%d] eftOptionsOK ", 200) +} + +func (o *EftOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/invoice_options_parameters.go b/api/ops/ops_client/cors/invoice_options_parameters.go new file mode 100644 index 0000000..072dfad --- /dev/null +++ b/api/ops/ops_client/cors/invoice_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewInvoiceOptionsParams creates a new InvoiceOptionsParams object +// with the default values initialized. +func NewInvoiceOptionsParams() *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewInvoiceOptionsParamsWithTimeout creates a new InvoiceOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewInvoiceOptionsParamsWithTimeout(timeout time.Duration) *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + + timeout: timeout, + } +} + +// NewInvoiceOptionsParamsWithContext creates a new InvoiceOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewInvoiceOptionsParamsWithContext(ctx context.Context) *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + + Context: ctx, + } +} + +// NewInvoiceOptionsParamsWithHTTPClient creates a new InvoiceOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewInvoiceOptionsParamsWithHTTPClient(client *http.Client) *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + HTTPClient: client, + } +} + +/*InvoiceOptionsParams contains all the parameters to send to the API endpoint +for the invoice options operation typically these are written to a http.Request +*/ +type InvoiceOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the invoice options params +func (o *InvoiceOptionsParams) WithTimeout(timeout time.Duration) *InvoiceOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the invoice options params +func (o *InvoiceOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the invoice options params +func (o *InvoiceOptionsParams) WithContext(ctx context.Context) *InvoiceOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the invoice options params +func (o *InvoiceOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the invoice options params +func (o *InvoiceOptionsParams) WithHTTPClient(client *http.Client) *InvoiceOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the invoice options params +func (o *InvoiceOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *InvoiceOptionsParams) 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/ops/ops_client/cors/invoice_options_responses.go b/api/ops/ops_client/cors/invoice_options_responses.go new file mode 100644 index 0000000..42563f1 --- /dev/null +++ b/api/ops/ops_client/cors/invoice_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// InvoiceOptionsReader is a Reader for the InvoiceOptions structure. +type InvoiceOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InvoiceOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewInvoiceOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewInvoiceOptionsOK creates a InvoiceOptionsOK with default headers values +func NewInvoiceOptionsOK() *InvoiceOptionsOK { + return &InvoiceOptionsOK{} +} + +/*InvoiceOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type InvoiceOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *InvoiceOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /invoices][%d] invoiceOptionsOK ", 200) +} + +func (o *InvoiceOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/orders_options_parameters.go b/api/ops/ops_client/cors/orders_options_parameters.go new file mode 100644 index 0000000..108f99d --- /dev/null +++ b/api/ops/ops_client/cors/orders_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewOrdersOptionsParams creates a new OrdersOptionsParams object +// with the default values initialized. +func NewOrdersOptionsParams() *OrdersOptionsParams { + + return &OrdersOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOrdersOptionsParamsWithTimeout creates a new OrdersOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOrdersOptionsParamsWithTimeout(timeout time.Duration) *OrdersOptionsParams { + + return &OrdersOptionsParams{ + + timeout: timeout, + } +} + +// NewOrdersOptionsParamsWithContext creates a new OrdersOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewOrdersOptionsParamsWithContext(ctx context.Context) *OrdersOptionsParams { + + return &OrdersOptionsParams{ + + Context: ctx, + } +} + +// NewOrdersOptionsParamsWithHTTPClient creates a new OrdersOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOrdersOptionsParamsWithHTTPClient(client *http.Client) *OrdersOptionsParams { + + return &OrdersOptionsParams{ + HTTPClient: client, + } +} + +/*OrdersOptionsParams contains all the parameters to send to the API endpoint +for the orders options operation typically these are written to a http.Request +*/ +type OrdersOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the orders options params +func (o *OrdersOptionsParams) WithTimeout(timeout time.Duration) *OrdersOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the orders options params +func (o *OrdersOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the orders options params +func (o *OrdersOptionsParams) WithContext(ctx context.Context) *OrdersOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the orders options params +func (o *OrdersOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the orders options params +func (o *OrdersOptionsParams) WithHTTPClient(client *http.Client) *OrdersOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the orders options params +func (o *OrdersOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *OrdersOptionsParams) 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/ops/ops_client/cors/orders_options_responses.go b/api/ops/ops_client/cors/orders_options_responses.go new file mode 100644 index 0000000..5fdc694 --- /dev/null +++ b/api/ops/ops_client/cors/orders_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// OrdersOptionsReader is a Reader for the OrdersOptions structure. +type OrdersOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OrdersOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOrdersOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewOrdersOptionsOK creates a OrdersOptionsOK with default headers values +func NewOrdersOptionsOK() *OrdersOptionsOK { + return &OrdersOptionsOK{} +} + +/*OrdersOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type OrdersOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *OrdersOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /orders][%d] ordersOptionsOK ", 200) +} + +func (o *OrdersOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/payment_method_options_parameters.go b/api/ops/ops_client/cors/payment_method_options_parameters.go new file mode 100644 index 0000000..689460a --- /dev/null +++ b/api/ops/ops_client/cors/payment_method_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewPaymentMethodOptionsParams creates a new PaymentMethodOptionsParams object +// with the default values initialized. +func NewPaymentMethodOptionsParams() *PaymentMethodOptionsParams { + + return &PaymentMethodOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPaymentMethodOptionsParamsWithTimeout creates a new PaymentMethodOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPaymentMethodOptionsParamsWithTimeout(timeout time.Duration) *PaymentMethodOptionsParams { + + return &PaymentMethodOptionsParams{ + + timeout: timeout, + } +} + +// NewPaymentMethodOptionsParamsWithContext creates a new PaymentMethodOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPaymentMethodOptionsParamsWithContext(ctx context.Context) *PaymentMethodOptionsParams { + + return &PaymentMethodOptionsParams{ + + Context: ctx, + } +} + +// NewPaymentMethodOptionsParamsWithHTTPClient creates a new PaymentMethodOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPaymentMethodOptionsParamsWithHTTPClient(client *http.Client) *PaymentMethodOptionsParams { + + return &PaymentMethodOptionsParams{ + HTTPClient: client, + } +} + +/*PaymentMethodOptionsParams contains all the parameters to send to the API endpoint +for the payment method options operation typically these are written to a http.Request +*/ +type PaymentMethodOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the payment method options params +func (o *PaymentMethodOptionsParams) WithTimeout(timeout time.Duration) *PaymentMethodOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the payment method options params +func (o *PaymentMethodOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the payment method options params +func (o *PaymentMethodOptionsParams) WithContext(ctx context.Context) *PaymentMethodOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the payment method options params +func (o *PaymentMethodOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the payment method options params +func (o *PaymentMethodOptionsParams) WithHTTPClient(client *http.Client) *PaymentMethodOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the payment method options params +func (o *PaymentMethodOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PaymentMethodOptionsParams) 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/ops/ops_client/cors/payment_method_options_responses.go b/api/ops/ops_client/cors/payment_method_options_responses.go new file mode 100644 index 0000000..e9a6de5 --- /dev/null +++ b/api/ops/ops_client/cors/payment_method_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// PaymentMethodOptionsReader is a Reader for the PaymentMethodOptions structure. +type PaymentMethodOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PaymentMethodOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPaymentMethodOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPaymentMethodOptionsOK creates a PaymentMethodOptionsOK with default headers values +func NewPaymentMethodOptionsOK() *PaymentMethodOptionsOK { + return &PaymentMethodOptionsOK{} +} + +/*PaymentMethodOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type PaymentMethodOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *PaymentMethodOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /paymentmethods][%d] paymentMethodOptionsOK ", 200) +} + +func (o *PaymentMethodOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/po_options_parameters.go b/api/ops/ops_client/cors/po_options_parameters.go new file mode 100644 index 0000000..fe27155 --- /dev/null +++ b/api/ops/ops_client/cors/po_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewPoOptionsParams creates a new PoOptionsParams object +// with the default values initialized. +func NewPoOptionsParams() *PoOptionsParams { + + return &PoOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPoOptionsParamsWithTimeout creates a new PoOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPoOptionsParamsWithTimeout(timeout time.Duration) *PoOptionsParams { + + return &PoOptionsParams{ + + timeout: timeout, + } +} + +// NewPoOptionsParamsWithContext creates a new PoOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPoOptionsParamsWithContext(ctx context.Context) *PoOptionsParams { + + return &PoOptionsParams{ + + Context: ctx, + } +} + +// NewPoOptionsParamsWithHTTPClient creates a new PoOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPoOptionsParamsWithHTTPClient(client *http.Client) *PoOptionsParams { + + return &PoOptionsParams{ + HTTPClient: client, + } +} + +/*PoOptionsParams contains all the parameters to send to the API endpoint +for the po options operation typically these are written to a http.Request +*/ +type PoOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the po options params +func (o *PoOptionsParams) WithTimeout(timeout time.Duration) *PoOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the po options params +func (o *PoOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the po options params +func (o *PoOptionsParams) WithContext(ctx context.Context) *PoOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the po options params +func (o *PoOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the po options params +func (o *PoOptionsParams) WithHTTPClient(client *http.Client) *PoOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the po options params +func (o *PoOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PoOptionsParams) 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/ops/ops_client/cors/po_options_responses.go b/api/ops/ops_client/cors/po_options_responses.go new file mode 100644 index 0000000..42d670d --- /dev/null +++ b/api/ops/ops_client/cors/po_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// PoOptionsReader is a Reader for the PoOptions structure. +type PoOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PoOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPoOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPoOptionsOK creates a PoOptionsOK with default headers values +func NewPoOptionsOK() *PoOptionsOK { + return &PoOptionsOK{} +} + +/*PoOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type PoOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *PoOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /pos][%d] poOptionsOK ", 200) +} + +func (o *PoOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/product_options_observable_parameters.go b/api/ops/ops_client/cors/product_options_observable_parameters.go new file mode 100644 index 0000000..910ccd6 --- /dev/null +++ b/api/ops/ops_client/cors/product_options_observable_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewProductOptionsObservableParams creates a new ProductOptionsObservableParams object +// with the default values initialized. +func NewProductOptionsObservableParams() *ProductOptionsObservableParams { + + return &ProductOptionsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewProductOptionsObservableParamsWithTimeout creates a new ProductOptionsObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewProductOptionsObservableParamsWithTimeout(timeout time.Duration) *ProductOptionsObservableParams { + + return &ProductOptionsObservableParams{ + + timeout: timeout, + } +} + +// NewProductOptionsObservableParamsWithContext creates a new ProductOptionsObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewProductOptionsObservableParamsWithContext(ctx context.Context) *ProductOptionsObservableParams { + + return &ProductOptionsObservableParams{ + + Context: ctx, + } +} + +// NewProductOptionsObservableParamsWithHTTPClient creates a new ProductOptionsObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewProductOptionsObservableParamsWithHTTPClient(client *http.Client) *ProductOptionsObservableParams { + + return &ProductOptionsObservableParams{ + HTTPClient: client, + } +} + +/*ProductOptionsObservableParams contains all the parameters to send to the API endpoint +for the product options observable operation typically these are written to a http.Request +*/ +type ProductOptionsObservableParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the product options observable params +func (o *ProductOptionsObservableParams) WithTimeout(timeout time.Duration) *ProductOptionsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the product options observable params +func (o *ProductOptionsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the product options observable params +func (o *ProductOptionsObservableParams) WithContext(ctx context.Context) *ProductOptionsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the product options observable params +func (o *ProductOptionsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the product options observable params +func (o *ProductOptionsObservableParams) WithHTTPClient(client *http.Client) *ProductOptionsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the product options observable params +func (o *ProductOptionsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ProductOptionsObservableParams) 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/ops/ops_client/cors/product_options_observable_responses.go b/api/ops/ops_client/cors/product_options_observable_responses.go new file mode 100644 index 0000000..5e03271 --- /dev/null +++ b/api/ops/ops_client/cors/product_options_observable_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// ProductOptionsObservableReader is a Reader for the ProductOptionsObservable structure. +type ProductOptionsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProductOptionsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewProductOptionsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewProductOptionsObservableOK creates a ProductOptionsObservableOK with default headers values +func NewProductOptionsObservableOK() *ProductOptionsObservableOK { + return &ProductOptionsObservableOK{} +} + +/*ProductOptionsObservableOK handles this case with default header values. + +CORS OPTIONS response +*/ +type ProductOptionsObservableOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *ProductOptionsObservableOK) Error() string { + return fmt.Sprintf("[OPTIONS /products/observable][%d] productOptionsObservableOK ", 200) +} + +func (o *ProductOptionsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/product_options_parameters.go b/api/ops/ops_client/cors/product_options_parameters.go new file mode 100644 index 0000000..ca0bea5 --- /dev/null +++ b/api/ops/ops_client/cors/product_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewProductOptionsParams creates a new ProductOptionsParams object +// with the default values initialized. +func NewProductOptionsParams() *ProductOptionsParams { + + return &ProductOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewProductOptionsParamsWithTimeout creates a new ProductOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewProductOptionsParamsWithTimeout(timeout time.Duration) *ProductOptionsParams { + + return &ProductOptionsParams{ + + timeout: timeout, + } +} + +// NewProductOptionsParamsWithContext creates a new ProductOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewProductOptionsParamsWithContext(ctx context.Context) *ProductOptionsParams { + + return &ProductOptionsParams{ + + Context: ctx, + } +} + +// NewProductOptionsParamsWithHTTPClient creates a new ProductOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewProductOptionsParamsWithHTTPClient(client *http.Client) *ProductOptionsParams { + + return &ProductOptionsParams{ + HTTPClient: client, + } +} + +/*ProductOptionsParams contains all the parameters to send to the API endpoint +for the product options operation typically these are written to a http.Request +*/ +type ProductOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the product options params +func (o *ProductOptionsParams) WithTimeout(timeout time.Duration) *ProductOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the product options params +func (o *ProductOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the product options params +func (o *ProductOptionsParams) WithContext(ctx context.Context) *ProductOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the product options params +func (o *ProductOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the product options params +func (o *ProductOptionsParams) WithHTTPClient(client *http.Client) *ProductOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the product options params +func (o *ProductOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ProductOptionsParams) 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/ops/ops_client/cors/product_options_responses.go b/api/ops/ops_client/cors/product_options_responses.go new file mode 100644 index 0000000..aadcc31 --- /dev/null +++ b/api/ops/ops_client/cors/product_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// ProductOptionsReader is a Reader for the ProductOptions structure. +type ProductOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProductOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewProductOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewProductOptionsOK creates a ProductOptionsOK with default headers values +func NewProductOptionsOK() *ProductOptionsOK { + return &ProductOptionsOK{} +} + +/*ProductOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type ProductOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *ProductOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /products][%d] productOptionsOK ", 200) +} + +func (o *ProductOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/quote_options_parameters.go b/api/ops/ops_client/cors/quote_options_parameters.go new file mode 100644 index 0000000..a062c8b --- /dev/null +++ b/api/ops/ops_client/cors/quote_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewQuoteOptionsParams creates a new QuoteOptionsParams object +// with the default values initialized. +func NewQuoteOptionsParams() *QuoteOptionsParams { + + return &QuoteOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewQuoteOptionsParamsWithTimeout creates a new QuoteOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewQuoteOptionsParamsWithTimeout(timeout time.Duration) *QuoteOptionsParams { + + return &QuoteOptionsParams{ + + timeout: timeout, + } +} + +// NewQuoteOptionsParamsWithContext creates a new QuoteOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewQuoteOptionsParamsWithContext(ctx context.Context) *QuoteOptionsParams { + + return &QuoteOptionsParams{ + + Context: ctx, + } +} + +// NewQuoteOptionsParamsWithHTTPClient creates a new QuoteOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewQuoteOptionsParamsWithHTTPClient(client *http.Client) *QuoteOptionsParams { + + return &QuoteOptionsParams{ + HTTPClient: client, + } +} + +/*QuoteOptionsParams contains all the parameters to send to the API endpoint +for the quote options operation typically these are written to a http.Request +*/ +type QuoteOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the quote options params +func (o *QuoteOptionsParams) WithTimeout(timeout time.Duration) *QuoteOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the quote options params +func (o *QuoteOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the quote options params +func (o *QuoteOptionsParams) WithContext(ctx context.Context) *QuoteOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the quote options params +func (o *QuoteOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the quote options params +func (o *QuoteOptionsParams) WithHTTPClient(client *http.Client) *QuoteOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the quote options params +func (o *QuoteOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *QuoteOptionsParams) 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/ops/ops_client/cors/quote_options_responses.go b/api/ops/ops_client/cors/quote_options_responses.go new file mode 100644 index 0000000..0148ba0 --- /dev/null +++ b/api/ops/ops_client/cors/quote_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// QuoteOptionsReader is a Reader for the QuoteOptions structure. +type QuoteOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *QuoteOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewQuoteOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewQuoteOptionsOK creates a QuoteOptionsOK with default headers values +func NewQuoteOptionsOK() *QuoteOptionsOK { + return &QuoteOptionsOK{} +} + +/*QuoteOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type QuoteOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *QuoteOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /quotes][%d] quoteOptionsOK ", 200) +} + +func (o *QuoteOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/tax_invoice_options_parameters.go b/api/ops/ops_client/cors/tax_invoice_options_parameters.go new file mode 100644 index 0000000..06ecbcf --- /dev/null +++ b/api/ops/ops_client/cors/tax_invoice_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewTaxInvoiceOptionsParams creates a new TaxInvoiceOptionsParams object +// with the default values initialized. +func NewTaxInvoiceOptionsParams() *TaxInvoiceOptionsParams { + + return &TaxInvoiceOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaxInvoiceOptionsParamsWithTimeout creates a new TaxInvoiceOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaxInvoiceOptionsParamsWithTimeout(timeout time.Duration) *TaxInvoiceOptionsParams { + + return &TaxInvoiceOptionsParams{ + + timeout: timeout, + } +} + +// NewTaxInvoiceOptionsParamsWithContext creates a new TaxInvoiceOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaxInvoiceOptionsParamsWithContext(ctx context.Context) *TaxInvoiceOptionsParams { + + return &TaxInvoiceOptionsParams{ + + Context: ctx, + } +} + +// NewTaxInvoiceOptionsParamsWithHTTPClient creates a new TaxInvoiceOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaxInvoiceOptionsParamsWithHTTPClient(client *http.Client) *TaxInvoiceOptionsParams { + + return &TaxInvoiceOptionsParams{ + HTTPClient: client, + } +} + +/*TaxInvoiceOptionsParams contains all the parameters to send to the API endpoint +for the tax invoice options operation typically these are written to a http.Request +*/ +type TaxInvoiceOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tax invoice options params +func (o *TaxInvoiceOptionsParams) WithTimeout(timeout time.Duration) *TaxInvoiceOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tax invoice options params +func (o *TaxInvoiceOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tax invoice options params +func (o *TaxInvoiceOptionsParams) WithContext(ctx context.Context) *TaxInvoiceOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tax invoice options params +func (o *TaxInvoiceOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tax invoice options params +func (o *TaxInvoiceOptionsParams) WithHTTPClient(client *http.Client) *TaxInvoiceOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tax invoice options params +func (o *TaxInvoiceOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaxInvoiceOptionsParams) 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/ops/ops_client/cors/tax_invoice_options_responses.go b/api/ops/ops_client/cors/tax_invoice_options_responses.go new file mode 100644 index 0000000..a05b406 --- /dev/null +++ b/api/ops/ops_client/cors/tax_invoice_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// TaxInvoiceOptionsReader is a Reader for the TaxInvoiceOptions structure. +type TaxInvoiceOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaxInvoiceOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaxInvoiceOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTaxInvoiceOptionsOK creates a TaxInvoiceOptionsOK with default headers values +func NewTaxInvoiceOptionsOK() *TaxInvoiceOptionsOK { + return &TaxInvoiceOptionsOK{} +} + +/*TaxInvoiceOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type TaxInvoiceOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *TaxInvoiceOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxes/invoices][%d] taxInvoiceOptionsOK ", 200) +} + +func (o *TaxInvoiceOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/tax_order_options_parameters.go b/api/ops/ops_client/cors/tax_order_options_parameters.go new file mode 100644 index 0000000..64801c4 --- /dev/null +++ b/api/ops/ops_client/cors/tax_order_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewTaxOrderOptionsParams creates a new TaxOrderOptionsParams object +// with the default values initialized. +func NewTaxOrderOptionsParams() *TaxOrderOptionsParams { + + return &TaxOrderOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaxOrderOptionsParamsWithTimeout creates a new TaxOrderOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaxOrderOptionsParamsWithTimeout(timeout time.Duration) *TaxOrderOptionsParams { + + return &TaxOrderOptionsParams{ + + timeout: timeout, + } +} + +// NewTaxOrderOptionsParamsWithContext creates a new TaxOrderOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaxOrderOptionsParamsWithContext(ctx context.Context) *TaxOrderOptionsParams { + + return &TaxOrderOptionsParams{ + + Context: ctx, + } +} + +// NewTaxOrderOptionsParamsWithHTTPClient creates a new TaxOrderOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaxOrderOptionsParamsWithHTTPClient(client *http.Client) *TaxOrderOptionsParams { + + return &TaxOrderOptionsParams{ + HTTPClient: client, + } +} + +/*TaxOrderOptionsParams contains all the parameters to send to the API endpoint +for the tax order options operation typically these are written to a http.Request +*/ +type TaxOrderOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tax order options params +func (o *TaxOrderOptionsParams) WithTimeout(timeout time.Duration) *TaxOrderOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tax order options params +func (o *TaxOrderOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tax order options params +func (o *TaxOrderOptionsParams) WithContext(ctx context.Context) *TaxOrderOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tax order options params +func (o *TaxOrderOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tax order options params +func (o *TaxOrderOptionsParams) WithHTTPClient(client *http.Client) *TaxOrderOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tax order options params +func (o *TaxOrderOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaxOrderOptionsParams) 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/ops/ops_client/cors/tax_order_options_responses.go b/api/ops/ops_client/cors/tax_order_options_responses.go new file mode 100644 index 0000000..474a326 --- /dev/null +++ b/api/ops/ops_client/cors/tax_order_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// TaxOrderOptionsReader is a Reader for the TaxOrderOptions structure. +type TaxOrderOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaxOrderOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaxOrderOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTaxOrderOptionsOK creates a TaxOrderOptionsOK with default headers values +func NewTaxOrderOptionsOK() *TaxOrderOptionsOK { + return &TaxOrderOptionsOK{} +} + +/*TaxOrderOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type TaxOrderOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *TaxOrderOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxes/orders][%d] taxOrderOptionsOK ", 200) +} + +func (o *TaxOrderOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/tax_po_options_parameters.go b/api/ops/ops_client/cors/tax_po_options_parameters.go new file mode 100644 index 0000000..b516d51 --- /dev/null +++ b/api/ops/ops_client/cors/tax_po_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewTaxPoOptionsParams creates a new TaxPoOptionsParams object +// with the default values initialized. +func NewTaxPoOptionsParams() *TaxPoOptionsParams { + + return &TaxPoOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaxPoOptionsParamsWithTimeout creates a new TaxPoOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaxPoOptionsParamsWithTimeout(timeout time.Duration) *TaxPoOptionsParams { + + return &TaxPoOptionsParams{ + + timeout: timeout, + } +} + +// NewTaxPoOptionsParamsWithContext creates a new TaxPoOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaxPoOptionsParamsWithContext(ctx context.Context) *TaxPoOptionsParams { + + return &TaxPoOptionsParams{ + + Context: ctx, + } +} + +// NewTaxPoOptionsParamsWithHTTPClient creates a new TaxPoOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaxPoOptionsParamsWithHTTPClient(client *http.Client) *TaxPoOptionsParams { + + return &TaxPoOptionsParams{ + HTTPClient: client, + } +} + +/*TaxPoOptionsParams contains all the parameters to send to the API endpoint +for the tax po options operation typically these are written to a http.Request +*/ +type TaxPoOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tax po options params +func (o *TaxPoOptionsParams) WithTimeout(timeout time.Duration) *TaxPoOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tax po options params +func (o *TaxPoOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tax po options params +func (o *TaxPoOptionsParams) WithContext(ctx context.Context) *TaxPoOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tax po options params +func (o *TaxPoOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tax po options params +func (o *TaxPoOptionsParams) WithHTTPClient(client *http.Client) *TaxPoOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tax po options params +func (o *TaxPoOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaxPoOptionsParams) 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/ops/ops_client/cors/tax_po_options_responses.go b/api/ops/ops_client/cors/tax_po_options_responses.go new file mode 100644 index 0000000..7a1fbce --- /dev/null +++ b/api/ops/ops_client/cors/tax_po_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// TaxPoOptionsReader is a Reader for the TaxPoOptions structure. +type TaxPoOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaxPoOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaxPoOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTaxPoOptionsOK creates a TaxPoOptionsOK with default headers values +func NewTaxPoOptionsOK() *TaxPoOptionsOK { + return &TaxPoOptionsOK{} +} + +/*TaxPoOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type TaxPoOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *TaxPoOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxes/pos][%d] taxPoOptionsOK ", 200) +} + +func (o *TaxPoOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/cors/tax_quote_options_parameters.go b/api/ops/ops_client/cors/tax_quote_options_parameters.go new file mode 100644 index 0000000..d5457a0 --- /dev/null +++ b/api/ops/ops_client/cors/tax_quote_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewTaxQuoteOptionsParams creates a new TaxQuoteOptionsParams object +// with the default values initialized. +func NewTaxQuoteOptionsParams() *TaxQuoteOptionsParams { + + return &TaxQuoteOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaxQuoteOptionsParamsWithTimeout creates a new TaxQuoteOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaxQuoteOptionsParamsWithTimeout(timeout time.Duration) *TaxQuoteOptionsParams { + + return &TaxQuoteOptionsParams{ + + timeout: timeout, + } +} + +// NewTaxQuoteOptionsParamsWithContext creates a new TaxQuoteOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaxQuoteOptionsParamsWithContext(ctx context.Context) *TaxQuoteOptionsParams { + + return &TaxQuoteOptionsParams{ + + Context: ctx, + } +} + +// NewTaxQuoteOptionsParamsWithHTTPClient creates a new TaxQuoteOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaxQuoteOptionsParamsWithHTTPClient(client *http.Client) *TaxQuoteOptionsParams { + + return &TaxQuoteOptionsParams{ + HTTPClient: client, + } +} + +/*TaxQuoteOptionsParams contains all the parameters to send to the API endpoint +for the tax quote options operation typically these are written to a http.Request +*/ +type TaxQuoteOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tax quote options params +func (o *TaxQuoteOptionsParams) WithTimeout(timeout time.Duration) *TaxQuoteOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tax quote options params +func (o *TaxQuoteOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tax quote options params +func (o *TaxQuoteOptionsParams) WithContext(ctx context.Context) *TaxQuoteOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tax quote options params +func (o *TaxQuoteOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tax quote options params +func (o *TaxQuoteOptionsParams) WithHTTPClient(client *http.Client) *TaxQuoteOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tax quote options params +func (o *TaxQuoteOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaxQuoteOptionsParams) 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/ops/ops_client/cors/tax_quote_options_responses.go b/api/ops/ops_client/cors/tax_quote_options_responses.go new file mode 100644 index 0000000..6b837fd --- /dev/null +++ b/api/ops/ops_client/cors/tax_quote_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// TaxQuoteOptionsReader is a Reader for the TaxQuoteOptions structure. +type TaxQuoteOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaxQuoteOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaxQuoteOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTaxQuoteOptionsOK creates a TaxQuoteOptionsOK with default headers values +func NewTaxQuoteOptionsOK() *TaxQuoteOptionsOK { + return &TaxQuoteOptionsOK{} +} + +/*TaxQuoteOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type TaxQuoteOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *TaxQuoteOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxes/quotes][%d] taxQuoteOptionsOK ", 200) +} + +func (o *TaxQuoteOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/ops/ops_client/eft/eft_client.go b/api/ops/ops_client/eft/eft_client.go new file mode 100644 index 0000000..ca93d1b --- /dev/null +++ b/api/ops/ops_client/eft/eft_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package eft + +// 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 eft API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for eft API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetEfts(params *GetEftsParams, authInfo runtime.ClientAuthInfoWriter) (*GetEftsOK, error) + + PostEfts(params *PostEftsParams, authInfo runtime.ClientAuthInfoWriter) (*PostEftsOK, error) + + PutEfts(params *PutEftsParams, authInfo runtime.ClientAuthInfoWriter) (*PutEftsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetEfts gets a list of efts + + Return a list of available Taxnexus Efts +*/ +func (a *Client) GetEfts(params *GetEftsParams, authInfo runtime.ClientAuthInfoWriter) (*GetEftsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEftsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getEfts", + Method: "GET", + PathPattern: "/efts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetEftsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetEftsOK) + 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 getEfts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostEfts creates new efts + + Create New Efts +*/ +func (a *Client) PostEfts(params *PostEftsParams, authInfo runtime.ClientAuthInfoWriter) (*PostEftsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostEftsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postEfts", + Method: "POST", + PathPattern: "/efts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostEftsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostEftsOK) + 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 postEfts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutEfts puts a list of efts + + Put a list of Efts +*/ +func (a *Client) PutEfts(params *PutEftsParams, authInfo runtime.ClientAuthInfoWriter) (*PutEftsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutEftsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putEfts", + Method: "PUT", + PathPattern: "/efts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutEftsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutEftsOK) + 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 putEfts: 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/ops/ops_client/eft/get_efts_parameters.go b/api/ops/ops_client/eft/get_efts_parameters.go new file mode 100644 index 0000000..0f2766e --- /dev/null +++ b/api/ops/ops_client/eft/get_efts_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package eft + +// 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" +) + +// NewGetEftsParams creates a new GetEftsParams object +// with the default values initialized. +func NewGetEftsParams() *GetEftsParams { + var () + return &GetEftsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetEftsParamsWithTimeout creates a new GetEftsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetEftsParamsWithTimeout(timeout time.Duration) *GetEftsParams { + var () + return &GetEftsParams{ + + timeout: timeout, + } +} + +// NewGetEftsParamsWithContext creates a new GetEftsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetEftsParamsWithContext(ctx context.Context) *GetEftsParams { + var () + return &GetEftsParams{ + + Context: ctx, + } +} + +// NewGetEftsParamsWithHTTPClient creates a new GetEftsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetEftsParamsWithHTTPClient(client *http.Client) *GetEftsParams { + var () + return &GetEftsParams{ + HTTPClient: client, + } +} + +/*GetEftsParams contains all the parameters to send to the API endpoint +for the get efts operation typically these are written to a http.Request +*/ +type GetEftsParams struct { + + /*EftID + Taxnexus Record Id of a EFT + + */ + EftID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get efts params +func (o *GetEftsParams) WithTimeout(timeout time.Duration) *GetEftsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get efts params +func (o *GetEftsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get efts params +func (o *GetEftsParams) WithContext(ctx context.Context) *GetEftsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get efts params +func (o *GetEftsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get efts params +func (o *GetEftsParams) WithHTTPClient(client *http.Client) *GetEftsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get efts params +func (o *GetEftsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEftID adds the eftID to the get efts params +func (o *GetEftsParams) WithEftID(eftID *string) *GetEftsParams { + o.SetEftID(eftID) + return o +} + +// SetEftID adds the eftId to the get efts params +func (o *GetEftsParams) SetEftID(eftID *string) { + o.EftID = eftID +} + +// WithLimit adds the limit to the get efts params +func (o *GetEftsParams) WithLimit(limit *int64) *GetEftsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get efts params +func (o *GetEftsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get efts params +func (o *GetEftsParams) WithOffset(offset *int64) *GetEftsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get efts params +func (o *GetEftsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEftsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EftID != nil { + + // query param eftId + var qrEftID string + if o.EftID != nil { + qrEftID = *o.EftID + } + qEftID := qrEftID + if qEftID != "" { + if err := r.SetQueryParam("eftId", qEftID); 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/ops/ops_client/eft/get_efts_responses.go b/api/ops/ops_client/eft/get_efts_responses.go new file mode 100644 index 0000000..ca32e99 --- /dev/null +++ b/api/ops/ops_client/eft/get_efts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package eft + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetEftsReader is a Reader for the GetEfts structure. +type GetEftsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEftsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEftsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetEftsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetEftsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetEftsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetEftsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetEftsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetEftsOK creates a GetEftsOK with default headers values +func NewGetEftsOK() *GetEftsOK { + return &GetEftsOK{} +} + +/*GetEftsOK handles this case with default header values. + +Taxnexus Response with EFT objects +*/ +type GetEftsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.EftResponse +} + +func (o *GetEftsOK) Error() string { + return fmt.Sprintf("[GET /efts][%d] getEftsOK %+v", 200, o.Payload) +} + +func (o *GetEftsOK) GetPayload() *ops_models.EftResponse { + return o.Payload +} + +func (o *GetEftsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.EftResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEftsUnauthorized creates a GetEftsUnauthorized with default headers values +func NewGetEftsUnauthorized() *GetEftsUnauthorized { + return &GetEftsUnauthorized{} +} + +/*GetEftsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetEftsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetEftsUnauthorized) Error() string { + return fmt.Sprintf("[GET /efts][%d] getEftsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetEftsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetEftsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEftsForbidden creates a GetEftsForbidden with default headers values +func NewGetEftsForbidden() *GetEftsForbidden { + return &GetEftsForbidden{} +} + +/*GetEftsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetEftsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetEftsForbidden) Error() string { + return fmt.Sprintf("[GET /efts][%d] getEftsForbidden %+v", 403, o.Payload) +} + +func (o *GetEftsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetEftsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEftsNotFound creates a GetEftsNotFound with default headers values +func NewGetEftsNotFound() *GetEftsNotFound { + return &GetEftsNotFound{} +} + +/*GetEftsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetEftsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetEftsNotFound) Error() string { + return fmt.Sprintf("[GET /efts][%d] getEftsNotFound %+v", 404, o.Payload) +} + +func (o *GetEftsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetEftsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEftsUnprocessableEntity creates a GetEftsUnprocessableEntity with default headers values +func NewGetEftsUnprocessableEntity() *GetEftsUnprocessableEntity { + return &GetEftsUnprocessableEntity{} +} + +/*GetEftsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetEftsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetEftsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /efts][%d] getEftsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetEftsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetEftsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetEftsInternalServerError creates a GetEftsInternalServerError with default headers values +func NewGetEftsInternalServerError() *GetEftsInternalServerError { + return &GetEftsInternalServerError{} +} + +/*GetEftsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetEftsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetEftsInternalServerError) Error() string { + return fmt.Sprintf("[GET /efts][%d] getEftsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetEftsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetEftsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/eft/post_efts_parameters.go b/api/ops/ops_client/eft/post_efts_parameters.go new file mode 100644 index 0000000..213f3b6 --- /dev/null +++ b/api/ops/ops_client/eft/post_efts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package eft + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostEftsParams creates a new PostEftsParams object +// with the default values initialized. +func NewPostEftsParams() *PostEftsParams { + var () + return &PostEftsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostEftsParamsWithTimeout creates a new PostEftsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostEftsParamsWithTimeout(timeout time.Duration) *PostEftsParams { + var () + return &PostEftsParams{ + + timeout: timeout, + } +} + +// NewPostEftsParamsWithContext creates a new PostEftsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostEftsParamsWithContext(ctx context.Context) *PostEftsParams { + var () + return &PostEftsParams{ + + Context: ctx, + } +} + +// NewPostEftsParamsWithHTTPClient creates a new PostEftsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostEftsParamsWithHTTPClient(client *http.Client) *PostEftsParams { + var () + return &PostEftsParams{ + HTTPClient: client, + } +} + +/*PostEftsParams contains all the parameters to send to the API endpoint +for the post efts operation typically these are written to a http.Request +*/ +type PostEftsParams struct { + + /*EftRequest + A request with an array of EFT Objects + + */ + EftRequest *ops_models.EftRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post efts params +func (o *PostEftsParams) WithTimeout(timeout time.Duration) *PostEftsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post efts params +func (o *PostEftsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post efts params +func (o *PostEftsParams) WithContext(ctx context.Context) *PostEftsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post efts params +func (o *PostEftsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post efts params +func (o *PostEftsParams) WithHTTPClient(client *http.Client) *PostEftsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post efts params +func (o *PostEftsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEftRequest adds the eftRequest to the post efts params +func (o *PostEftsParams) WithEftRequest(eftRequest *ops_models.EftRequest) *PostEftsParams { + o.SetEftRequest(eftRequest) + return o +} + +// SetEftRequest adds the eftRequest to the post efts params +func (o *PostEftsParams) SetEftRequest(eftRequest *ops_models.EftRequest) { + o.EftRequest = eftRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostEftsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EftRequest != nil { + if err := r.SetBodyParam(o.EftRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/eft/post_efts_responses.go b/api/ops/ops_client/eft/post_efts_responses.go new file mode 100644 index 0000000..697ebe6 --- /dev/null +++ b/api/ops/ops_client/eft/post_efts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package eft + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostEftsReader is a Reader for the PostEfts structure. +type PostEftsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostEftsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostEftsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostEftsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostEftsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostEftsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostEftsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostEftsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostEftsOK creates a PostEftsOK with default headers values +func NewPostEftsOK() *PostEftsOK { + return &PostEftsOK{} +} + +/*PostEftsOK handles this case with default header values. + +Taxnexus Response with EFT objects +*/ +type PostEftsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.EftResponse +} + +func (o *PostEftsOK) Error() string { + return fmt.Sprintf("[POST /efts][%d] postEftsOK %+v", 200, o.Payload) +} + +func (o *PostEftsOK) GetPayload() *ops_models.EftResponse { + return o.Payload +} + +func (o *PostEftsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.EftResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEftsUnauthorized creates a PostEftsUnauthorized with default headers values +func NewPostEftsUnauthorized() *PostEftsUnauthorized { + return &PostEftsUnauthorized{} +} + +/*PostEftsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostEftsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostEftsUnauthorized) Error() string { + return fmt.Sprintf("[POST /efts][%d] postEftsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostEftsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostEftsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEftsForbidden creates a PostEftsForbidden with default headers values +func NewPostEftsForbidden() *PostEftsForbidden { + return &PostEftsForbidden{} +} + +/*PostEftsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostEftsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostEftsForbidden) Error() string { + return fmt.Sprintf("[POST /efts][%d] postEftsForbidden %+v", 403, o.Payload) +} + +func (o *PostEftsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostEftsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEftsNotFound creates a PostEftsNotFound with default headers values +func NewPostEftsNotFound() *PostEftsNotFound { + return &PostEftsNotFound{} +} + +/*PostEftsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostEftsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostEftsNotFound) Error() string { + return fmt.Sprintf("[POST /efts][%d] postEftsNotFound %+v", 404, o.Payload) +} + +func (o *PostEftsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostEftsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEftsUnprocessableEntity creates a PostEftsUnprocessableEntity with default headers values +func NewPostEftsUnprocessableEntity() *PostEftsUnprocessableEntity { + return &PostEftsUnprocessableEntity{} +} + +/*PostEftsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostEftsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostEftsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /efts][%d] postEftsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostEftsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostEftsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostEftsInternalServerError creates a PostEftsInternalServerError with default headers values +func NewPostEftsInternalServerError() *PostEftsInternalServerError { + return &PostEftsInternalServerError{} +} + +/*PostEftsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostEftsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostEftsInternalServerError) Error() string { + return fmt.Sprintf("[POST /efts][%d] postEftsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostEftsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostEftsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/eft/put_efts_parameters.go b/api/ops/ops_client/eft/put_efts_parameters.go new file mode 100644 index 0000000..b413cb8 --- /dev/null +++ b/api/ops/ops_client/eft/put_efts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package eft + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutEftsParams creates a new PutEftsParams object +// with the default values initialized. +func NewPutEftsParams() *PutEftsParams { + var () + return &PutEftsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutEftsParamsWithTimeout creates a new PutEftsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutEftsParamsWithTimeout(timeout time.Duration) *PutEftsParams { + var () + return &PutEftsParams{ + + timeout: timeout, + } +} + +// NewPutEftsParamsWithContext creates a new PutEftsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutEftsParamsWithContext(ctx context.Context) *PutEftsParams { + var () + return &PutEftsParams{ + + Context: ctx, + } +} + +// NewPutEftsParamsWithHTTPClient creates a new PutEftsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutEftsParamsWithHTTPClient(client *http.Client) *PutEftsParams { + var () + return &PutEftsParams{ + HTTPClient: client, + } +} + +/*PutEftsParams contains all the parameters to send to the API endpoint +for the put efts operation typically these are written to a http.Request +*/ +type PutEftsParams struct { + + /*EftRequest + A request with an array of EFT Objects + + */ + EftRequest *ops_models.EftRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put efts params +func (o *PutEftsParams) WithTimeout(timeout time.Duration) *PutEftsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put efts params +func (o *PutEftsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put efts params +func (o *PutEftsParams) WithContext(ctx context.Context) *PutEftsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put efts params +func (o *PutEftsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put efts params +func (o *PutEftsParams) WithHTTPClient(client *http.Client) *PutEftsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put efts params +func (o *PutEftsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEftRequest adds the eftRequest to the put efts params +func (o *PutEftsParams) WithEftRequest(eftRequest *ops_models.EftRequest) *PutEftsParams { + o.SetEftRequest(eftRequest) + return o +} + +// SetEftRequest adds the eftRequest to the put efts params +func (o *PutEftsParams) SetEftRequest(eftRequest *ops_models.EftRequest) { + o.EftRequest = eftRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutEftsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EftRequest != nil { + if err := r.SetBodyParam(o.EftRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/eft/put_efts_responses.go b/api/ops/ops_client/eft/put_efts_responses.go new file mode 100644 index 0000000..8df4e35 --- /dev/null +++ b/api/ops/ops_client/eft/put_efts_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package eft + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutEftsReader is a Reader for the PutEfts structure. +type PutEftsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutEftsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutEftsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutEftsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutEftsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutEftsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutEftsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutEftsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutEftsOK creates a PutEftsOK with default headers values +func NewPutEftsOK() *PutEftsOK { + return &PutEftsOK{} +} + +/*PutEftsOK handles this case with default header values. + +Taxnexus Response with an array of Message objects in response to a PUT +*/ +type PutEftsOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.PutResponse +} + +func (o *PutEftsOK) Error() string { + return fmt.Sprintf("[PUT /efts][%d] putEftsOK %+v", 200, o.Payload) +} + +func (o *PutEftsOK) GetPayload() *ops_models.PutResponse { + return o.Payload +} + +func (o *PutEftsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.PutResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEftsUnauthorized creates a PutEftsUnauthorized with default headers values +func NewPutEftsUnauthorized() *PutEftsUnauthorized { + return &PutEftsUnauthorized{} +} + +/*PutEftsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutEftsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutEftsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /efts][%d] putEftsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutEftsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutEftsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEftsForbidden creates a PutEftsForbidden with default headers values +func NewPutEftsForbidden() *PutEftsForbidden { + return &PutEftsForbidden{} +} + +/*PutEftsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutEftsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutEftsForbidden) Error() string { + return fmt.Sprintf("[PUT /efts][%d] putEftsForbidden %+v", 403, o.Payload) +} + +func (o *PutEftsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutEftsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEftsNotFound creates a PutEftsNotFound with default headers values +func NewPutEftsNotFound() *PutEftsNotFound { + return &PutEftsNotFound{} +} + +/*PutEftsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutEftsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutEftsNotFound) Error() string { + return fmt.Sprintf("[PUT /efts][%d] putEftsNotFound %+v", 404, o.Payload) +} + +func (o *PutEftsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutEftsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEftsUnprocessableEntity creates a PutEftsUnprocessableEntity with default headers values +func NewPutEftsUnprocessableEntity() *PutEftsUnprocessableEntity { + return &PutEftsUnprocessableEntity{} +} + +/*PutEftsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutEftsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutEftsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /efts][%d] putEftsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutEftsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutEftsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutEftsInternalServerError creates a PutEftsInternalServerError with default headers values +func NewPutEftsInternalServerError() *PutEftsInternalServerError { + return &PutEftsInternalServerError{} +} + +/*PutEftsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutEftsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutEftsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /efts][%d] putEftsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutEftsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutEftsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/invoice/delete_invoice_parameters.go b/api/ops/ops_client/invoice/delete_invoice_parameters.go new file mode 100644 index 0000000..01efbf4 --- /dev/null +++ b/api/ops/ops_client/invoice/delete_invoice_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" +) + +// NewDeleteInvoiceParams creates a new DeleteInvoiceParams object +// with the default values initialized. +func NewDeleteInvoiceParams() *DeleteInvoiceParams { + var () + return &DeleteInvoiceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteInvoiceParamsWithTimeout creates a new DeleteInvoiceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteInvoiceParamsWithTimeout(timeout time.Duration) *DeleteInvoiceParams { + var () + return &DeleteInvoiceParams{ + + timeout: timeout, + } +} + +// NewDeleteInvoiceParamsWithContext creates a new DeleteInvoiceParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteInvoiceParamsWithContext(ctx context.Context) *DeleteInvoiceParams { + var () + return &DeleteInvoiceParams{ + + Context: ctx, + } +} + +// NewDeleteInvoiceParamsWithHTTPClient creates a new DeleteInvoiceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteInvoiceParamsWithHTTPClient(client *http.Client) *DeleteInvoiceParams { + var () + return &DeleteInvoiceParams{ + HTTPClient: client, + } +} + +/*DeleteInvoiceParams contains all the parameters to send to the API endpoint +for the delete invoice operation typically these are written to a http.Request +*/ +type DeleteInvoiceParams struct { + + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete invoice params +func (o *DeleteInvoiceParams) WithTimeout(timeout time.Duration) *DeleteInvoiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete invoice params +func (o *DeleteInvoiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete invoice params +func (o *DeleteInvoiceParams) WithContext(ctx context.Context) *DeleteInvoiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete invoice params +func (o *DeleteInvoiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete invoice params +func (o *DeleteInvoiceParams) WithHTTPClient(client *http.Client) *DeleteInvoiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete invoice params +func (o *DeleteInvoiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete invoice params +func (o *DeleteInvoiceParams) WithID(id *string) *DeleteInvoiceParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete invoice params +func (o *DeleteInvoiceParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteInvoiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/invoice/delete_invoice_responses.go b/api/ops/ops_client/invoice/delete_invoice_responses.go new file mode 100644 index 0000000..75d8d69 --- /dev/null +++ b/api/ops/ops_client/invoice/delete_invoice_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeleteInvoiceReader is a Reader for the DeleteInvoice structure. +type DeleteInvoiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteInvoiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteInvoiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteInvoiceUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteInvoiceForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteInvoiceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteInvoiceUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteInvoiceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteInvoiceOK creates a DeleteInvoiceOK with default headers values +func NewDeleteInvoiceOK() *DeleteInvoiceOK { + return &DeleteInvoiceOK{} +} + +/*DeleteInvoiceOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteInvoiceOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.DeleteResponse +} + +func (o *DeleteInvoiceOK) Error() string { + return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceOK %+v", 200, o.Payload) +} + +func (o *DeleteInvoiceOK) GetPayload() *ops_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteInvoiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteInvoiceUnauthorized creates a DeleteInvoiceUnauthorized with default headers values +func NewDeleteInvoiceUnauthorized() *DeleteInvoiceUnauthorized { + return &DeleteInvoiceUnauthorized{} +} + +/*DeleteInvoiceUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteInvoiceUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteInvoiceUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteInvoiceUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteInvoiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteInvoiceForbidden creates a DeleteInvoiceForbidden with default headers values +func NewDeleteInvoiceForbidden() *DeleteInvoiceForbidden { + return &DeleteInvoiceForbidden{} +} + +/*DeleteInvoiceForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteInvoiceForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteInvoiceForbidden) Error() string { + return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceForbidden %+v", 403, o.Payload) +} + +func (o *DeleteInvoiceForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteInvoiceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteInvoiceNotFound creates a DeleteInvoiceNotFound with default headers values +func NewDeleteInvoiceNotFound() *DeleteInvoiceNotFound { + return &DeleteInvoiceNotFound{} +} + +/*DeleteInvoiceNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteInvoiceNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteInvoiceNotFound) Error() string { + return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceNotFound %+v", 404, o.Payload) +} + +func (o *DeleteInvoiceNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteInvoiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteInvoiceUnprocessableEntity creates a DeleteInvoiceUnprocessableEntity with default headers values +func NewDeleteInvoiceUnprocessableEntity() *DeleteInvoiceUnprocessableEntity { + return &DeleteInvoiceUnprocessableEntity{} +} + +/*DeleteInvoiceUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteInvoiceUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteInvoiceUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteInvoiceUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteInvoiceUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteInvoiceInternalServerError creates a DeleteInvoiceInternalServerError with default headers values +func NewDeleteInvoiceInternalServerError() *DeleteInvoiceInternalServerError { + return &DeleteInvoiceInternalServerError{} +} + +/*DeleteInvoiceInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteInvoiceInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteInvoiceInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /invoices][%d] deleteInvoiceInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteInvoiceInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteInvoiceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/invoice/get_invoices_parameters.go b/api/ops/ops_client/invoice/get_invoices_parameters.go new file mode 100644 index 0000000..53d938c --- /dev/null +++ b/api/ops/ops_client/invoice/get_invoices_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" +) + +// NewGetInvoicesParams creates a new GetInvoicesParams object +// with the default values initialized. +func NewGetInvoicesParams() *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetInvoicesParamsWithTimeout creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetInvoicesParamsWithTimeout(timeout time.Duration) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: timeout, + } +} + +// NewGetInvoicesParamsWithContext creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetInvoicesParamsWithContext(ctx context.Context) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + Context: ctx, + } +} + +// NewGetInvoicesParamsWithHTTPClient creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetInvoicesParamsWithHTTPClient(client *http.Client) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + HTTPClient: client, + } +} + +/*GetInvoicesParams contains all the parameters to send to the API endpoint +for the get invoices operation typically these are written to a http.Request +*/ +type GetInvoicesParams struct { + + /*InvoiceID + Taxnexus Record Id of an Invoice + + */ + InvoiceID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) WithTimeout(timeout time.Duration) *GetInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get invoices params +func (o *GetInvoicesParams) WithContext(ctx context.Context) *GetInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get invoices params +func (o *GetInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) WithHTTPClient(client *http.Client) *GetInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceID adds the invoiceID to the get invoices params +func (o *GetInvoicesParams) WithInvoiceID(invoiceID *string) *GetInvoicesParams { + o.SetInvoiceID(invoiceID) + return o +} + +// SetInvoiceID adds the invoiceId to the get invoices params +func (o *GetInvoicesParams) SetInvoiceID(invoiceID *string) { + o.InvoiceID = invoiceID +} + +// WithLimit adds the limit to the get invoices params +func (o *GetInvoicesParams) WithLimit(limit *int64) *GetInvoicesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get invoices params +func (o *GetInvoicesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get invoices params +func (o *GetInvoicesParams) WithOffset(offset *int64) *GetInvoicesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get invoices params +func (o *GetInvoicesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInvoicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.InvoiceID != nil { + + // query param invoiceId + var qrInvoiceID string + if o.InvoiceID != nil { + qrInvoiceID = *o.InvoiceID + } + qInvoiceID := qrInvoiceID + if qInvoiceID != "" { + if err := r.SetQueryParam("invoiceId", qInvoiceID); 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/ops/ops_client/invoice/get_invoices_responses.go b/api/ops/ops_client/invoice/get_invoices_responses.go new file mode 100644 index 0000000..34d269a --- /dev/null +++ b/api/ops/ops_client/invoice/get_invoices_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetInvoicesReader is a Reader for the GetInvoices structure. +type GetInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetInvoicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetInvoicesOK creates a GetInvoicesOK with default headers values +func NewGetInvoicesOK() *GetInvoicesOK { + return &GetInvoicesOK{} +} + +/*GetInvoicesOK handles this case with default header values. + +Taxnexus Response with an array of Invoice (full) objects +*/ +type GetInvoicesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.InvoiceResponse +} + +func (o *GetInvoicesOK) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesOK %+v", 200, o.Payload) +} + +func (o *GetInvoicesOK) GetPayload() *ops_models.InvoiceResponse { + return o.Payload +} + +func (o *GetInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.InvoiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnauthorized creates a GetInvoicesUnauthorized with default headers values +func NewGetInvoicesUnauthorized() *GetInvoicesUnauthorized { + return &GetInvoicesUnauthorized{} +} + +/*GetInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetInvoicesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetInvoicesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesForbidden creates a GetInvoicesForbidden with default headers values +func NewGetInvoicesForbidden() *GetInvoicesForbidden { + return &GetInvoicesForbidden{} +} + +/*GetInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetInvoicesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetInvoicesForbidden) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *GetInvoicesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesNotFound creates a GetInvoicesNotFound with default headers values +func NewGetInvoicesNotFound() *GetInvoicesNotFound { + return &GetInvoicesNotFound{} +} + +/*GetInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetInvoicesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetInvoicesNotFound) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *GetInvoicesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnprocessableEntity creates a GetInvoicesUnprocessableEntity with default headers values +func NewGetInvoicesUnprocessableEntity() *GetInvoicesUnprocessableEntity { + return &GetInvoicesUnprocessableEntity{} +} + +/*GetInvoicesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetInvoicesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetInvoicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetInvoicesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesInternalServerError creates a GetInvoicesInternalServerError with default headers values +func NewGetInvoicesInternalServerError() *GetInvoicesInternalServerError { + return &GetInvoicesInternalServerError{} +} + +/*GetInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetInvoicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetInvoicesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/invoice/invoice_client.go b/api/ops/ops_client/invoice/invoice_client.go new file mode 100644 index 0000000..d0a6d68 --- /dev/null +++ b/api/ops/ops_client/invoice/invoice_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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 invoice API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for invoice API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteInvoice(params *DeleteInvoiceParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteInvoiceOK, error) + + GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) + + PostInvoices(params *PostInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostInvoicesOK, error) + + PutInvoices(params *PutInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PutInvoicesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteInvoice deletes an invoice + + Delete an invoice by ID +*/ +func (a *Client) DeleteInvoice(params *DeleteInvoiceParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteInvoiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteInvoiceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteInvoice", + Method: "DELETE", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteInvoiceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteInvoiceOK) + 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 deleteInvoice: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetInvoices gets a list of invoices + + Return a list of available Taxnexus Invoices +*/ +func (a *Client) GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getInvoices", + Method: "GET", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetInvoicesOK) + 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 getInvoices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostInvoices creates a new invoice + + Create New Invoices +*/ +func (a *Client) PostInvoices(params *PostInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postInvoices", + Method: "POST", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostInvoicesOK) + 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 postInvoices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutInvoices puts a list of invoices + + Put a list of Invoices +*/ +func (a *Client) PutInvoices(params *PutInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PutInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putInvoices", + Method: "PUT", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutInvoicesOK) + 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 putInvoices: 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/ops/ops_client/invoice/post_invoices_parameters.go b/api/ops/ops_client/invoice/post_invoices_parameters.go new file mode 100644 index 0000000..61c6d17 --- /dev/null +++ b/api/ops/ops_client/invoice/post_invoices_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostInvoicesParams creates a new PostInvoicesParams object +// with the default values initialized. +func NewPostInvoicesParams() *PostInvoicesParams { + var () + return &PostInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostInvoicesParamsWithTimeout creates a new PostInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostInvoicesParamsWithTimeout(timeout time.Duration) *PostInvoicesParams { + var () + return &PostInvoicesParams{ + + timeout: timeout, + } +} + +// NewPostInvoicesParamsWithContext creates a new PostInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostInvoicesParamsWithContext(ctx context.Context) *PostInvoicesParams { + var () + return &PostInvoicesParams{ + + Context: ctx, + } +} + +// NewPostInvoicesParamsWithHTTPClient creates a new PostInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostInvoicesParamsWithHTTPClient(client *http.Client) *PostInvoicesParams { + var () + return &PostInvoicesParams{ + HTTPClient: client, + } +} + +/*PostInvoicesParams contains all the parameters to send to the API endpoint +for the post invoices operation typically these are written to a http.Request +*/ +type PostInvoicesParams struct { + + /*InvoiceRequest + A request with an array of Invoice Objects + + */ + InvoiceRequest *ops_models.InvoiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post invoices params +func (o *PostInvoicesParams) WithTimeout(timeout time.Duration) *PostInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post invoices params +func (o *PostInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post invoices params +func (o *PostInvoicesParams) WithContext(ctx context.Context) *PostInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post invoices params +func (o *PostInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post invoices params +func (o *PostInvoicesParams) WithHTTPClient(client *http.Client) *PostInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post invoices params +func (o *PostInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceRequest adds the invoiceRequest to the post invoices params +func (o *PostInvoicesParams) WithInvoiceRequest(invoiceRequest *ops_models.InvoiceRequest) *PostInvoicesParams { + o.SetInvoiceRequest(invoiceRequest) + return o +} + +// SetInvoiceRequest adds the invoiceRequest to the post invoices params +func (o *PostInvoicesParams) SetInvoiceRequest(invoiceRequest *ops_models.InvoiceRequest) { + o.InvoiceRequest = invoiceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostInvoicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.InvoiceRequest != nil { + if err := r.SetBodyParam(o.InvoiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/invoice/post_invoices_responses.go b/api/ops/ops_client/invoice/post_invoices_responses.go new file mode 100644 index 0000000..773fb0e --- /dev/null +++ b/api/ops/ops_client/invoice/post_invoices_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostInvoicesReader is a Reader for the PostInvoices structure. +type PostInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostInvoicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostInvoicesOK creates a PostInvoicesOK with default headers values +func NewPostInvoicesOK() *PostInvoicesOK { + return &PostInvoicesOK{} +} + +/*PostInvoicesOK handles this case with default header values. + +Taxnexus Response with an array of Invoice (full) objects +*/ +type PostInvoicesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.InvoiceResponse +} + +func (o *PostInvoicesOK) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesOK %+v", 200, o.Payload) +} + +func (o *PostInvoicesOK) GetPayload() *ops_models.InvoiceResponse { + return o.Payload +} + +func (o *PostInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.InvoiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesUnauthorized creates a PostInvoicesUnauthorized with default headers values +func NewPostInvoicesUnauthorized() *PostInvoicesUnauthorized { + return &PostInvoicesUnauthorized{} +} + +/*PostInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostInvoicesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostInvoicesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesForbidden creates a PostInvoicesForbidden with default headers values +func NewPostInvoicesForbidden() *PostInvoicesForbidden { + return &PostInvoicesForbidden{} +} + +/*PostInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostInvoicesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostInvoicesForbidden) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *PostInvoicesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesNotFound creates a PostInvoicesNotFound with default headers values +func NewPostInvoicesNotFound() *PostInvoicesNotFound { + return &PostInvoicesNotFound{} +} + +/*PostInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostInvoicesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostInvoicesNotFound) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *PostInvoicesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesUnprocessableEntity creates a PostInvoicesUnprocessableEntity with default headers values +func NewPostInvoicesUnprocessableEntity() *PostInvoicesUnprocessableEntity { + return &PostInvoicesUnprocessableEntity{} +} + +/*PostInvoicesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostInvoicesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostInvoicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostInvoicesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesInternalServerError creates a PostInvoicesInternalServerError with default headers values +func NewPostInvoicesInternalServerError() *PostInvoicesInternalServerError { + return &PostInvoicesInternalServerError{} +} + +/*PostInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostInvoicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostInvoicesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/invoice/put_invoices_parameters.go b/api/ops/ops_client/invoice/put_invoices_parameters.go new file mode 100644 index 0000000..97f5a5a --- /dev/null +++ b/api/ops/ops_client/invoice/put_invoices_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutInvoicesParams creates a new PutInvoicesParams object +// with the default values initialized. +func NewPutInvoicesParams() *PutInvoicesParams { + var () + return &PutInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutInvoicesParamsWithTimeout creates a new PutInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutInvoicesParamsWithTimeout(timeout time.Duration) *PutInvoicesParams { + var () + return &PutInvoicesParams{ + + timeout: timeout, + } +} + +// NewPutInvoicesParamsWithContext creates a new PutInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutInvoicesParamsWithContext(ctx context.Context) *PutInvoicesParams { + var () + return &PutInvoicesParams{ + + Context: ctx, + } +} + +// NewPutInvoicesParamsWithHTTPClient creates a new PutInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutInvoicesParamsWithHTTPClient(client *http.Client) *PutInvoicesParams { + var () + return &PutInvoicesParams{ + HTTPClient: client, + } +} + +/*PutInvoicesParams contains all the parameters to send to the API endpoint +for the put invoices operation typically these are written to a http.Request +*/ +type PutInvoicesParams struct { + + /*InvoiceRequest + A request with an array of Invoice Objects + + */ + InvoiceRequest *ops_models.InvoiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put invoices params +func (o *PutInvoicesParams) WithTimeout(timeout time.Duration) *PutInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put invoices params +func (o *PutInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put invoices params +func (o *PutInvoicesParams) WithContext(ctx context.Context) *PutInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put invoices params +func (o *PutInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put invoices params +func (o *PutInvoicesParams) WithHTTPClient(client *http.Client) *PutInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put invoices params +func (o *PutInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceRequest adds the invoiceRequest to the put invoices params +func (o *PutInvoicesParams) WithInvoiceRequest(invoiceRequest *ops_models.InvoiceRequest) *PutInvoicesParams { + o.SetInvoiceRequest(invoiceRequest) + return o +} + +// SetInvoiceRequest adds the invoiceRequest to the put invoices params +func (o *PutInvoicesParams) SetInvoiceRequest(invoiceRequest *ops_models.InvoiceRequest) { + o.InvoiceRequest = invoiceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutInvoicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.InvoiceRequest != nil { + if err := r.SetBodyParam(o.InvoiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/invoice/put_invoices_responses.go b/api/ops/ops_client/invoice/put_invoices_responses.go new file mode 100644 index 0000000..3547c5a --- /dev/null +++ b/api/ops/ops_client/invoice/put_invoices_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutInvoicesReader is a Reader for the PutInvoices structure. +type PutInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutInvoicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutInvoicesOK creates a PutInvoicesOK with default headers values +func NewPutInvoicesOK() *PutInvoicesOK { + return &PutInvoicesOK{} +} + +/*PutInvoicesOK handles this case with default header values. + +Taxnexus Response with an array of Message objects in response to a PUT +*/ +type PutInvoicesOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.PutResponse +} + +func (o *PutInvoicesOK) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesOK %+v", 200, o.Payload) +} + +func (o *PutInvoicesOK) GetPayload() *ops_models.PutResponse { + return o.Payload +} + +func (o *PutInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.PutResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesUnauthorized creates a PutInvoicesUnauthorized with default headers values +func NewPutInvoicesUnauthorized() *PutInvoicesUnauthorized { + return &PutInvoicesUnauthorized{} +} + +/*PutInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutInvoicesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutInvoicesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesForbidden creates a PutInvoicesForbidden with default headers values +func NewPutInvoicesForbidden() *PutInvoicesForbidden { + return &PutInvoicesForbidden{} +} + +/*PutInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutInvoicesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutInvoicesForbidden) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *PutInvoicesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesNotFound creates a PutInvoicesNotFound with default headers values +func NewPutInvoicesNotFound() *PutInvoicesNotFound { + return &PutInvoicesNotFound{} +} + +/*PutInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutInvoicesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutInvoicesNotFound) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *PutInvoicesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesUnprocessableEntity creates a PutInvoicesUnprocessableEntity with default headers values +func NewPutInvoicesUnprocessableEntity() *PutInvoicesUnprocessableEntity { + return &PutInvoicesUnprocessableEntity{} +} + +/*PutInvoicesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutInvoicesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutInvoicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutInvoicesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesInternalServerError creates a PutInvoicesInternalServerError with default headers values +func NewPutInvoicesInternalServerError() *PutInvoicesInternalServerError { + return &PutInvoicesInternalServerError{} +} + +/*PutInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutInvoicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutInvoicesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/ops_client.go b/api/ops/ops_client/ops_client.go new file mode 100644 index 0000000..4a9035a --- /dev/null +++ b/api/ops/ops_client/ops_client.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_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" + + "github.com/taxnexus/go/lib/api/ops/ops_client/cash_receipt" + "github.com/taxnexus/go/lib/api/ops/ops_client/charge" + "github.com/taxnexus/go/lib/api/ops/ops_client/cors" + "github.com/taxnexus/go/lib/api/ops/ops_client/eft" + "github.com/taxnexus/go/lib/api/ops/ops_client/invoice" + "github.com/taxnexus/go/lib/api/ops/ops_client/order" + "github.com/taxnexus/go/lib/api/ops/ops_client/payment_method" + "github.com/taxnexus/go/lib/api/ops/ops_client/product" + "github.com/taxnexus/go/lib/api/ops/ops_client/purchase_order" + "github.com/taxnexus/go/lib/api/ops/ops_client/quote" + "github.com/taxnexus/go/lib/api/ops/ops_client/tax" +) + +// Default ops HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "ops.fabric.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 ops HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Ops { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new ops HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Ops { + // 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 ops client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Ops { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Ops) + cli.Transport = transport + cli.CashReceipt = cash_receipt.New(transport, formats) + cli.Charge = charge.New(transport, formats) + cli.Cors = cors.New(transport, formats) + cli.Eft = eft.New(transport, formats) + cli.Invoice = invoice.New(transport, formats) + cli.Order = order.New(transport, formats) + cli.PaymentMethod = payment_method.New(transport, formats) + cli.Product = product.New(transport, formats) + cli.PurchaseOrder = purchase_order.New(transport, formats) + cli.Quote = quote.New(transport, formats) + cli.Tax = tax.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 +} + +// Ops is a client for ops +type Ops struct { + CashReceipt cash_receipt.ClientService + + Charge charge.ClientService + + Cors cors.ClientService + + Eft eft.ClientService + + Invoice invoice.ClientService + + Order order.ClientService + + PaymentMethod payment_method.ClientService + + Product product.ClientService + + PurchaseOrder purchase_order.ClientService + + Quote quote.ClientService + + Tax tax.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Ops) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.CashReceipt.SetTransport(transport) + c.Charge.SetTransport(transport) + c.Cors.SetTransport(transport) + c.Eft.SetTransport(transport) + c.Invoice.SetTransport(transport) + c.Order.SetTransport(transport) + c.PaymentMethod.SetTransport(transport) + c.Product.SetTransport(transport) + c.PurchaseOrder.SetTransport(transport) + c.Quote.SetTransport(transport) + c.Tax.SetTransport(transport) +} diff --git a/api/ops/ops_client/order/delete_order_parameters.go b/api/ops/ops_client/order/delete_order_parameters.go new file mode 100644 index 0000000..6904997 --- /dev/null +++ b/api/ops/ops_client/order/delete_order_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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" +) + +// NewDeleteOrderParams creates a new DeleteOrderParams object +// with the default values initialized. +func NewDeleteOrderParams() *DeleteOrderParams { + var () + return &DeleteOrderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteOrderParamsWithTimeout creates a new DeleteOrderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteOrderParamsWithTimeout(timeout time.Duration) *DeleteOrderParams { + var () + return &DeleteOrderParams{ + + timeout: timeout, + } +} + +// NewDeleteOrderParamsWithContext creates a new DeleteOrderParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteOrderParamsWithContext(ctx context.Context) *DeleteOrderParams { + var () + return &DeleteOrderParams{ + + Context: ctx, + } +} + +// NewDeleteOrderParamsWithHTTPClient creates a new DeleteOrderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteOrderParamsWithHTTPClient(client *http.Client) *DeleteOrderParams { + var () + return &DeleteOrderParams{ + HTTPClient: client, + } +} + +/*DeleteOrderParams contains all the parameters to send to the API endpoint +for the delete order operation typically these are written to a http.Request +*/ +type DeleteOrderParams struct { + + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete order params +func (o *DeleteOrderParams) WithTimeout(timeout time.Duration) *DeleteOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete order params +func (o *DeleteOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete order params +func (o *DeleteOrderParams) WithContext(ctx context.Context) *DeleteOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete order params +func (o *DeleteOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete order params +func (o *DeleteOrderParams) WithHTTPClient(client *http.Client) *DeleteOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete order params +func (o *DeleteOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete order params +func (o *DeleteOrderParams) WithID(id *string) *DeleteOrderParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete order params +func (o *DeleteOrderParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/order/delete_order_responses.go b/api/ops/ops_client/order/delete_order_responses.go new file mode 100644 index 0000000..1497f77 --- /dev/null +++ b/api/ops/ops_client/order/delete_order_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeleteOrderReader is a Reader for the DeleteOrder structure. +type DeleteOrderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteOrderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteOrderUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteOrderUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteOrderOK creates a DeleteOrderOK with default headers values +func NewDeleteOrderOK() *DeleteOrderOK { + return &DeleteOrderOK{} +} + +/*DeleteOrderOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteOrderOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.DeleteResponse +} + +func (o *DeleteOrderOK) Error() string { + return fmt.Sprintf("[DELETE /orders][%d] deleteOrderOK %+v", 200, o.Payload) +} + +func (o *DeleteOrderOK) GetPayload() *ops_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteOrderUnauthorized creates a DeleteOrderUnauthorized with default headers values +func NewDeleteOrderUnauthorized() *DeleteOrderUnauthorized { + return &DeleteOrderUnauthorized{} +} + +/*DeleteOrderUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteOrderUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteOrderUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /orders][%d] deleteOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteOrderUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteOrderForbidden creates a DeleteOrderForbidden with default headers values +func NewDeleteOrderForbidden() *DeleteOrderForbidden { + return &DeleteOrderForbidden{} +} + +/*DeleteOrderForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteOrderForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteOrderForbidden) Error() string { + return fmt.Sprintf("[DELETE /orders][%d] deleteOrderForbidden %+v", 403, o.Payload) +} + +func (o *DeleteOrderForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteOrderNotFound creates a DeleteOrderNotFound with default headers values +func NewDeleteOrderNotFound() *DeleteOrderNotFound { + return &DeleteOrderNotFound{} +} + +/*DeleteOrderNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteOrderNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteOrderNotFound) Error() string { + return fmt.Sprintf("[DELETE /orders][%d] deleteOrderNotFound %+v", 404, o.Payload) +} + +func (o *DeleteOrderNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteOrderUnprocessableEntity creates a DeleteOrderUnprocessableEntity with default headers values +func NewDeleteOrderUnprocessableEntity() *DeleteOrderUnprocessableEntity { + return &DeleteOrderUnprocessableEntity{} +} + +/*DeleteOrderUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteOrderUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteOrderUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /orders][%d] deleteOrderUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteOrderUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteOrderUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteOrderInternalServerError creates a DeleteOrderInternalServerError with default headers values +func NewDeleteOrderInternalServerError() *DeleteOrderInternalServerError { + return &DeleteOrderInternalServerError{} +} + +/*DeleteOrderInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteOrderInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteOrderInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /orders][%d] deleteOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteOrderInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/order/get_orders_parameters.go b/api/ops/ops_client/order/get_orders_parameters.go new file mode 100644 index 0000000..4a12915 --- /dev/null +++ b/api/ops/ops_client/order/get_orders_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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" +) + +// NewGetOrdersParams creates a new GetOrdersParams object +// with the default values initialized. +func NewGetOrdersParams() *GetOrdersParams { + var () + return &GetOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetOrdersParamsWithTimeout creates a new GetOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetOrdersParamsWithTimeout(timeout time.Duration) *GetOrdersParams { + var () + return &GetOrdersParams{ + + timeout: timeout, + } +} + +// NewGetOrdersParamsWithContext creates a new GetOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetOrdersParamsWithContext(ctx context.Context) *GetOrdersParams { + var () + return &GetOrdersParams{ + + Context: ctx, + } +} + +// NewGetOrdersParamsWithHTTPClient creates a new GetOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetOrdersParamsWithHTTPClient(client *http.Client) *GetOrdersParams { + var () + return &GetOrdersParams{ + HTTPClient: client, + } +} + +/*GetOrdersParams contains all the parameters to send to the API endpoint +for the get orders operation typically these are written to a http.Request +*/ +type GetOrdersParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*OrderID + Taxnexus Record Id of an Order + + */ + OrderID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get orders params +func (o *GetOrdersParams) WithTimeout(timeout time.Duration) *GetOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get orders params +func (o *GetOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get orders params +func (o *GetOrdersParams) WithContext(ctx context.Context) *GetOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get orders params +func (o *GetOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get orders params +func (o *GetOrdersParams) WithHTTPClient(client *http.Client) *GetOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get orders params +func (o *GetOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get orders params +func (o *GetOrdersParams) WithLimit(limit *int64) *GetOrdersParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get orders params +func (o *GetOrdersParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get orders params +func (o *GetOrdersParams) WithOffset(offset *int64) *GetOrdersParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get orders params +func (o *GetOrdersParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithOrderID adds the orderID to the get orders params +func (o *GetOrdersParams) WithOrderID(orderID *string) *GetOrdersParams { + o.SetOrderID(orderID) + return o +} + +// SetOrderID adds the orderId to the get orders params +func (o *GetOrdersParams) SetOrderID(orderID *string) { + o.OrderID = orderID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOrdersParams) 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.OrderID != nil { + + // query param orderId + var qrOrderID string + if o.OrderID != nil { + qrOrderID = *o.OrderID + } + qOrderID := qrOrderID + if qOrderID != "" { + if err := r.SetQueryParam("orderId", qOrderID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/order/get_orders_responses.go b/api/ops/ops_client/order/get_orders_responses.go new file mode 100644 index 0000000..432b2b1 --- /dev/null +++ b/api/ops/ops_client/order/get_orders_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetOrdersReader is a Reader for the GetOrders structure. +type GetOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetOrdersOK creates a GetOrdersOK with default headers values +func NewGetOrdersOK() *GetOrdersOK { + return &GetOrdersOK{} +} + +/*GetOrdersOK handles this case with default header values. + +Taxnexus Response with an array of Order objects +*/ +type GetOrdersOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.OrderResponse +} + +func (o *GetOrdersOK) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersOK %+v", 200, o.Payload) +} + +func (o *GetOrdersOK) GetPayload() *ops_models.OrderResponse { + return o.Payload +} + +func (o *GetOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.OrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersUnauthorized creates a GetOrdersUnauthorized with default headers values +func NewGetOrdersUnauthorized() *GetOrdersUnauthorized { + return &GetOrdersUnauthorized{} +} + +/*GetOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetOrdersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetOrdersUnauthorized) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *GetOrdersUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersForbidden creates a GetOrdersForbidden with default headers values +func NewGetOrdersForbidden() *GetOrdersForbidden { + return &GetOrdersForbidden{} +} + +/*GetOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetOrdersForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetOrdersForbidden) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersForbidden %+v", 403, o.Payload) +} + +func (o *GetOrdersForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersNotFound creates a GetOrdersNotFound with default headers values +func NewGetOrdersNotFound() *GetOrdersNotFound { + return &GetOrdersNotFound{} +} + +/*GetOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type GetOrdersNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetOrdersNotFound) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersNotFound %+v", 404, o.Payload) +} + +func (o *GetOrdersNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersUnprocessableEntity creates a GetOrdersUnprocessableEntity with default headers values +func NewGetOrdersUnprocessableEntity() *GetOrdersUnprocessableEntity { + return &GetOrdersUnprocessableEntity{} +} + +/*GetOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetOrdersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetOrdersUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersInternalServerError creates a GetOrdersInternalServerError with default headers values +func NewGetOrdersInternalServerError() *GetOrdersInternalServerError { + return &GetOrdersInternalServerError{} +} + +/*GetOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetOrdersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetOrdersInternalServerError) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *GetOrdersInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/order/order_client.go b/api/ops/ops_client/order/order_client.go new file mode 100644 index 0000000..866b463 --- /dev/null +++ b/api/ops/ops_client/order/order_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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 order API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for order API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteOrder(params *DeleteOrderParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOrderOK, error) + + GetOrders(params *GetOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrdersOK, error) + + PostOrders(params *PostOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostOrdersOK, error) + + PutOrders(params *PutOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PutOrdersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteOrder deletes an order + + Delete an order by ID +*/ +func (a *Client) DeleteOrder(params *DeleteOrderParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteOrderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteOrderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteOrder", + Method: "DELETE", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteOrderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteOrderOK) + 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 deleteOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetOrders gets a list of orders + + Return a list of Orders +*/ +func (a *Client) GetOrders(params *GetOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getOrders", + Method: "GET", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetOrdersOK) + 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 getOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostOrders creates new orders + + Create new Orders +*/ +func (a *Client) PostOrders(params *PostOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postOrders", + Method: "POST", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostOrdersOK) + 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 postOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutOrders creates new orders + + Create new Orders +*/ +func (a *Client) PutOrders(params *PutOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PutOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putOrders", + Method: "PUT", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutOrdersOK) + 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 putOrders: 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/ops/ops_client/order/post_orders_parameters.go b/api/ops/ops_client/order/post_orders_parameters.go new file mode 100644 index 0000000..c99853a --- /dev/null +++ b/api/ops/ops_client/order/post_orders_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostOrdersParams creates a new PostOrdersParams object +// with the default values initialized. +func NewPostOrdersParams() *PostOrdersParams { + var () + return &PostOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostOrdersParamsWithTimeout creates a new PostOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostOrdersParamsWithTimeout(timeout time.Duration) *PostOrdersParams { + var () + return &PostOrdersParams{ + + timeout: timeout, + } +} + +// NewPostOrdersParamsWithContext creates a new PostOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostOrdersParamsWithContext(ctx context.Context) *PostOrdersParams { + var () + return &PostOrdersParams{ + + Context: ctx, + } +} + +// NewPostOrdersParamsWithHTTPClient creates a new PostOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostOrdersParamsWithHTTPClient(client *http.Client) *PostOrdersParams { + var () + return &PostOrdersParams{ + HTTPClient: client, + } +} + +/*PostOrdersParams contains all the parameters to send to the API endpoint +for the post orders operation typically these are written to a http.Request +*/ +type PostOrdersParams struct { + + /*OrderRequest + A request with an array of Order Objects + + */ + OrderRequest *ops_models.OrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post orders params +func (o *PostOrdersParams) WithTimeout(timeout time.Duration) *PostOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post orders params +func (o *PostOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post orders params +func (o *PostOrdersParams) WithContext(ctx context.Context) *PostOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post orders params +func (o *PostOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post orders params +func (o *PostOrdersParams) WithHTTPClient(client *http.Client) *PostOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post orders params +func (o *PostOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrderRequest adds the orderRequest to the post orders params +func (o *PostOrdersParams) WithOrderRequest(orderRequest *ops_models.OrderRequest) *PostOrdersParams { + o.SetOrderRequest(orderRequest) + return o +} + +// SetOrderRequest adds the orderRequest to the post orders params +func (o *PostOrdersParams) SetOrderRequest(orderRequest *ops_models.OrderRequest) { + o.OrderRequest = orderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.OrderRequest != nil { + if err := r.SetBodyParam(o.OrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/order/post_orders_responses.go b/api/ops/ops_client/order/post_orders_responses.go new file mode 100644 index 0000000..163257d --- /dev/null +++ b/api/ops/ops_client/order/post_orders_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostOrdersReader is a Reader for the PostOrders structure. +type PostOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostOrdersOK creates a PostOrdersOK with default headers values +func NewPostOrdersOK() *PostOrdersOK { + return &PostOrdersOK{} +} + +/*PostOrdersOK handles this case with default header values. + +Taxnexus Response with an array of Order objects +*/ +type PostOrdersOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.OrderResponse +} + +func (o *PostOrdersOK) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersOK %+v", 200, o.Payload) +} + +func (o *PostOrdersOK) GetPayload() *ops_models.OrderResponse { + return o.Payload +} + +func (o *PostOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.OrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersUnauthorized creates a PostOrdersUnauthorized with default headers values +func NewPostOrdersUnauthorized() *PostOrdersUnauthorized { + return &PostOrdersUnauthorized{} +} + +/*PostOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostOrdersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostOrdersUnauthorized) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostOrdersUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersForbidden creates a PostOrdersForbidden with default headers values +func NewPostOrdersForbidden() *PostOrdersForbidden { + return &PostOrdersForbidden{} +} + +/*PostOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostOrdersForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostOrdersForbidden) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersForbidden %+v", 403, o.Payload) +} + +func (o *PostOrdersForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersNotFound creates a PostOrdersNotFound with default headers values +func NewPostOrdersNotFound() *PostOrdersNotFound { + return &PostOrdersNotFound{} +} + +/*PostOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type PostOrdersNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostOrdersNotFound) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersNotFound %+v", 404, o.Payload) +} + +func (o *PostOrdersNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersUnprocessableEntity creates a PostOrdersUnprocessableEntity with default headers values +func NewPostOrdersUnprocessableEntity() *PostOrdersUnprocessableEntity { + return &PostOrdersUnprocessableEntity{} +} + +/*PostOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostOrdersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostOrdersUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersInternalServerError creates a PostOrdersInternalServerError with default headers values +func NewPostOrdersInternalServerError() *PostOrdersInternalServerError { + return &PostOrdersInternalServerError{} +} + +/*PostOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostOrdersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostOrdersInternalServerError) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostOrdersInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/order/put_orders_parameters.go b/api/ops/ops_client/order/put_orders_parameters.go new file mode 100644 index 0000000..0fe0bc9 --- /dev/null +++ b/api/ops/ops_client/order/put_orders_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutOrdersParams creates a new PutOrdersParams object +// with the default values initialized. +func NewPutOrdersParams() *PutOrdersParams { + var () + return &PutOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutOrdersParamsWithTimeout creates a new PutOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutOrdersParamsWithTimeout(timeout time.Duration) *PutOrdersParams { + var () + return &PutOrdersParams{ + + timeout: timeout, + } +} + +// NewPutOrdersParamsWithContext creates a new PutOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutOrdersParamsWithContext(ctx context.Context) *PutOrdersParams { + var () + return &PutOrdersParams{ + + Context: ctx, + } +} + +// NewPutOrdersParamsWithHTTPClient creates a new PutOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutOrdersParamsWithHTTPClient(client *http.Client) *PutOrdersParams { + var () + return &PutOrdersParams{ + HTTPClient: client, + } +} + +/*PutOrdersParams contains all the parameters to send to the API endpoint +for the put orders operation typically these are written to a http.Request +*/ +type PutOrdersParams struct { + + /*OrderRequest + A request with an array of Order Objects + + */ + OrderRequest *ops_models.OrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put orders params +func (o *PutOrdersParams) WithTimeout(timeout time.Duration) *PutOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put orders params +func (o *PutOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put orders params +func (o *PutOrdersParams) WithContext(ctx context.Context) *PutOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put orders params +func (o *PutOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put orders params +func (o *PutOrdersParams) WithHTTPClient(client *http.Client) *PutOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put orders params +func (o *PutOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrderRequest adds the orderRequest to the put orders params +func (o *PutOrdersParams) WithOrderRequest(orderRequest *ops_models.OrderRequest) *PutOrdersParams { + o.SetOrderRequest(orderRequest) + return o +} + +// SetOrderRequest adds the orderRequest to the put orders params +func (o *PutOrdersParams) SetOrderRequest(orderRequest *ops_models.OrderRequest) { + o.OrderRequest = orderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.OrderRequest != nil { + if err := r.SetBodyParam(o.OrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/order/put_orders_responses.go b/api/ops/ops_client/order/put_orders_responses.go new file mode 100644 index 0000000..5e45d9b --- /dev/null +++ b/api/ops/ops_client/order/put_orders_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutOrdersReader is a Reader for the PutOrders structure. +type PutOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutOrdersOK creates a PutOrdersOK with default headers values +func NewPutOrdersOK() *PutOrdersOK { + return &PutOrdersOK{} +} + +/*PutOrdersOK handles this case with default header values. + +Taxnexus Response with an array of Message objects in response to a PUT +*/ +type PutOrdersOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.PutResponse +} + +func (o *PutOrdersOK) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersOK %+v", 200, o.Payload) +} + +func (o *PutOrdersOK) GetPayload() *ops_models.PutResponse { + return o.Payload +} + +func (o *PutOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.PutResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersUnauthorized creates a PutOrdersUnauthorized with default headers values +func NewPutOrdersUnauthorized() *PutOrdersUnauthorized { + return &PutOrdersUnauthorized{} +} + +/*PutOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutOrdersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutOrdersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *PutOrdersUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersForbidden creates a PutOrdersForbidden with default headers values +func NewPutOrdersForbidden() *PutOrdersForbidden { + return &PutOrdersForbidden{} +} + +/*PutOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutOrdersForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutOrdersForbidden) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersForbidden %+v", 403, o.Payload) +} + +func (o *PutOrdersForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersNotFound creates a PutOrdersNotFound with default headers values +func NewPutOrdersNotFound() *PutOrdersNotFound { + return &PutOrdersNotFound{} +} + +/*PutOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type PutOrdersNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutOrdersNotFound) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersNotFound %+v", 404, o.Payload) +} + +func (o *PutOrdersNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersUnprocessableEntity creates a PutOrdersUnprocessableEntity with default headers values +func NewPutOrdersUnprocessableEntity() *PutOrdersUnprocessableEntity { + return &PutOrdersUnprocessableEntity{} +} + +/*PutOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutOrdersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutOrdersUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersInternalServerError creates a PutOrdersInternalServerError with default headers values +func NewPutOrdersInternalServerError() *PutOrdersInternalServerError { + return &PutOrdersInternalServerError{} +} + +/*PutOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutOrdersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutOrdersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *PutOrdersInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/payment_method/delete_payment_method_parameters.go b/api/ops/ops_client/payment_method/delete_payment_method_parameters.go new file mode 100644 index 0000000..de6d67c --- /dev/null +++ b/api/ops/ops_client/payment_method/delete_payment_method_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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" +) + +// NewDeletePaymentMethodParams creates a new DeletePaymentMethodParams object +// with the default values initialized. +func NewDeletePaymentMethodParams() *DeletePaymentMethodParams { + var () + return &DeletePaymentMethodParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeletePaymentMethodParamsWithTimeout creates a new DeletePaymentMethodParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeletePaymentMethodParamsWithTimeout(timeout time.Duration) *DeletePaymentMethodParams { + var () + return &DeletePaymentMethodParams{ + + timeout: timeout, + } +} + +// NewDeletePaymentMethodParamsWithContext creates a new DeletePaymentMethodParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeletePaymentMethodParamsWithContext(ctx context.Context) *DeletePaymentMethodParams { + var () + return &DeletePaymentMethodParams{ + + Context: ctx, + } +} + +// NewDeletePaymentMethodParamsWithHTTPClient creates a new DeletePaymentMethodParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeletePaymentMethodParamsWithHTTPClient(client *http.Client) *DeletePaymentMethodParams { + var () + return &DeletePaymentMethodParams{ + HTTPClient: client, + } +} + +/*DeletePaymentMethodParams contains all the parameters to send to the API endpoint +for the delete payment method operation typically these are written to a http.Request +*/ +type DeletePaymentMethodParams struct { + + /*PaymentMethodID + Taxnexus Record Id of a PaymentMethod + + */ + PaymentMethodID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete payment method params +func (o *DeletePaymentMethodParams) WithTimeout(timeout time.Duration) *DeletePaymentMethodParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete payment method params +func (o *DeletePaymentMethodParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete payment method params +func (o *DeletePaymentMethodParams) WithContext(ctx context.Context) *DeletePaymentMethodParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete payment method params +func (o *DeletePaymentMethodParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete payment method params +func (o *DeletePaymentMethodParams) WithHTTPClient(client *http.Client) *DeletePaymentMethodParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete payment method params +func (o *DeletePaymentMethodParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaymentMethodID adds the paymentMethodID to the delete payment method params +func (o *DeletePaymentMethodParams) WithPaymentMethodID(paymentMethodID *string) *DeletePaymentMethodParams { + o.SetPaymentMethodID(paymentMethodID) + return o +} + +// SetPaymentMethodID adds the paymentMethodId to the delete payment method params +func (o *DeletePaymentMethodParams) SetPaymentMethodID(paymentMethodID *string) { + o.PaymentMethodID = paymentMethodID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeletePaymentMethodParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PaymentMethodID != nil { + + // query param paymentMethodId + var qrPaymentMethodID string + if o.PaymentMethodID != nil { + qrPaymentMethodID = *o.PaymentMethodID + } + qPaymentMethodID := qrPaymentMethodID + if qPaymentMethodID != "" { + if err := r.SetQueryParam("paymentMethodId", qPaymentMethodID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/payment_method/delete_payment_method_responses.go b/api/ops/ops_client/payment_method/delete_payment_method_responses.go new file mode 100644 index 0000000..74917ef --- /dev/null +++ b/api/ops/ops_client/payment_method/delete_payment_method_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeletePaymentMethodReader is a Reader for the DeletePaymentMethod structure. +type DeletePaymentMethodReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeletePaymentMethodReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeletePaymentMethodOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeletePaymentMethodUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeletePaymentMethodForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeletePaymentMethodNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeletePaymentMethodUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeletePaymentMethodInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeletePaymentMethodOK creates a DeletePaymentMethodOK with default headers values +func NewDeletePaymentMethodOK() *DeletePaymentMethodOK { + return &DeletePaymentMethodOK{} +} + +/*DeletePaymentMethodOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeletePaymentMethodOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.DeleteResponse +} + +func (o *DeletePaymentMethodOK) Error() string { + return fmt.Sprintf("[DELETE /paymentmethods][%d] deletePaymentMethodOK %+v", 200, o.Payload) +} + +func (o *DeletePaymentMethodOK) GetPayload() *ops_models.DeleteResponse { + return o.Payload +} + +func (o *DeletePaymentMethodOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePaymentMethodUnauthorized creates a DeletePaymentMethodUnauthorized with default headers values +func NewDeletePaymentMethodUnauthorized() *DeletePaymentMethodUnauthorized { + return &DeletePaymentMethodUnauthorized{} +} + +/*DeletePaymentMethodUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeletePaymentMethodUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePaymentMethodUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /paymentmethods][%d] deletePaymentMethodUnauthorized %+v", 401, o.Payload) +} + +func (o *DeletePaymentMethodUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePaymentMethodUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePaymentMethodForbidden creates a DeletePaymentMethodForbidden with default headers values +func NewDeletePaymentMethodForbidden() *DeletePaymentMethodForbidden { + return &DeletePaymentMethodForbidden{} +} + +/*DeletePaymentMethodForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeletePaymentMethodForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePaymentMethodForbidden) Error() string { + return fmt.Sprintf("[DELETE /paymentmethods][%d] deletePaymentMethodForbidden %+v", 403, o.Payload) +} + +func (o *DeletePaymentMethodForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePaymentMethodForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePaymentMethodNotFound creates a DeletePaymentMethodNotFound with default headers values +func NewDeletePaymentMethodNotFound() *DeletePaymentMethodNotFound { + return &DeletePaymentMethodNotFound{} +} + +/*DeletePaymentMethodNotFound handles this case with default header values. + +Resource was not found +*/ +type DeletePaymentMethodNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePaymentMethodNotFound) Error() string { + return fmt.Sprintf("[DELETE /paymentmethods][%d] deletePaymentMethodNotFound %+v", 404, o.Payload) +} + +func (o *DeletePaymentMethodNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePaymentMethodNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePaymentMethodUnprocessableEntity creates a DeletePaymentMethodUnprocessableEntity with default headers values +func NewDeletePaymentMethodUnprocessableEntity() *DeletePaymentMethodUnprocessableEntity { + return &DeletePaymentMethodUnprocessableEntity{} +} + +/*DeletePaymentMethodUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeletePaymentMethodUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePaymentMethodUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /paymentmethods][%d] deletePaymentMethodUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeletePaymentMethodUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePaymentMethodUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePaymentMethodInternalServerError creates a DeletePaymentMethodInternalServerError with default headers values +func NewDeletePaymentMethodInternalServerError() *DeletePaymentMethodInternalServerError { + return &DeletePaymentMethodInternalServerError{} +} + +/*DeletePaymentMethodInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeletePaymentMethodInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePaymentMethodInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /paymentmethods][%d] deletePaymentMethodInternalServerError %+v", 500, o.Payload) +} + +func (o *DeletePaymentMethodInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePaymentMethodInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/payment_method/get_payment_methods_parameters.go b/api/ops/ops_client/payment_method/get_payment_methods_parameters.go new file mode 100644 index 0000000..d1c0992 --- /dev/null +++ b/api/ops/ops_client/payment_method/get_payment_methods_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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" +) + +// NewGetPaymentMethodsParams creates a new GetPaymentMethodsParams object +// with the default values initialized. +func NewGetPaymentMethodsParams() *GetPaymentMethodsParams { + var () + return &GetPaymentMethodsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPaymentMethodsParamsWithTimeout creates a new GetPaymentMethodsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPaymentMethodsParamsWithTimeout(timeout time.Duration) *GetPaymentMethodsParams { + var () + return &GetPaymentMethodsParams{ + + timeout: timeout, + } +} + +// NewGetPaymentMethodsParamsWithContext creates a new GetPaymentMethodsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPaymentMethodsParamsWithContext(ctx context.Context) *GetPaymentMethodsParams { + var () + return &GetPaymentMethodsParams{ + + Context: ctx, + } +} + +// NewGetPaymentMethodsParamsWithHTTPClient creates a new GetPaymentMethodsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPaymentMethodsParamsWithHTTPClient(client *http.Client) *GetPaymentMethodsParams { + var () + return &GetPaymentMethodsParams{ + HTTPClient: client, + } +} + +/*GetPaymentMethodsParams contains all the parameters to send to the API endpoint +for the get payment methods operation typically these are written to a http.Request +*/ +type GetPaymentMethodsParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*PaymentMethodID + Taxnexus Record Id of a PaymentMethod + + */ + PaymentMethodID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get payment methods params +func (o *GetPaymentMethodsParams) WithTimeout(timeout time.Duration) *GetPaymentMethodsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get payment methods params +func (o *GetPaymentMethodsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get payment methods params +func (o *GetPaymentMethodsParams) WithContext(ctx context.Context) *GetPaymentMethodsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get payment methods params +func (o *GetPaymentMethodsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get payment methods params +func (o *GetPaymentMethodsParams) WithHTTPClient(client *http.Client) *GetPaymentMethodsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get payment methods params +func (o *GetPaymentMethodsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get payment methods params +func (o *GetPaymentMethodsParams) WithLimit(limit *int64) *GetPaymentMethodsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get payment methods params +func (o *GetPaymentMethodsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get payment methods params +func (o *GetPaymentMethodsParams) WithOffset(offset *int64) *GetPaymentMethodsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get payment methods params +func (o *GetPaymentMethodsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPaymentMethodID adds the paymentMethodID to the get payment methods params +func (o *GetPaymentMethodsParams) WithPaymentMethodID(paymentMethodID *string) *GetPaymentMethodsParams { + o.SetPaymentMethodID(paymentMethodID) + return o +} + +// SetPaymentMethodID adds the paymentMethodId to the get payment methods params +func (o *GetPaymentMethodsParams) SetPaymentMethodID(paymentMethodID *string) { + o.PaymentMethodID = paymentMethodID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPaymentMethodsParams) 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.PaymentMethodID != nil { + + // query param paymentMethodId + var qrPaymentMethodID string + if o.PaymentMethodID != nil { + qrPaymentMethodID = *o.PaymentMethodID + } + qPaymentMethodID := qrPaymentMethodID + if qPaymentMethodID != "" { + if err := r.SetQueryParam("paymentMethodId", qPaymentMethodID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/payment_method/get_payment_methods_responses.go b/api/ops/ops_client/payment_method/get_payment_methods_responses.go new file mode 100644 index 0000000..9180441 --- /dev/null +++ b/api/ops/ops_client/payment_method/get_payment_methods_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetPaymentMethodsReader is a Reader for the GetPaymentMethods structure. +type GetPaymentMethodsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPaymentMethodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPaymentMethodsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPaymentMethodsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPaymentMethodsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPaymentMethodsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPaymentMethodsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPaymentMethodsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPaymentMethodsOK creates a GetPaymentMethodsOK with default headers values +func NewGetPaymentMethodsOK() *GetPaymentMethodsOK { + return &GetPaymentMethodsOK{} +} + +/*GetPaymentMethodsOK handles this case with default header values. + +Taxnexus Response with an array of Payment Method objects +*/ +type GetPaymentMethodsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.PaymentMethodResponse +} + +func (o *GetPaymentMethodsOK) Error() string { + return fmt.Sprintf("[GET /paymentmethods][%d] getPaymentMethodsOK %+v", 200, o.Payload) +} + +func (o *GetPaymentMethodsOK) GetPayload() *ops_models.PaymentMethodResponse { + return o.Payload +} + +func (o *GetPaymentMethodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.PaymentMethodResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentMethodsUnauthorized creates a GetPaymentMethodsUnauthorized with default headers values +func NewGetPaymentMethodsUnauthorized() *GetPaymentMethodsUnauthorized { + return &GetPaymentMethodsUnauthorized{} +} + +/*GetPaymentMethodsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPaymentMethodsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPaymentMethodsUnauthorized) Error() string { + return fmt.Sprintf("[GET /paymentmethods][%d] getPaymentMethodsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPaymentMethodsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPaymentMethodsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentMethodsForbidden creates a GetPaymentMethodsForbidden with default headers values +func NewGetPaymentMethodsForbidden() *GetPaymentMethodsForbidden { + return &GetPaymentMethodsForbidden{} +} + +/*GetPaymentMethodsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPaymentMethodsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPaymentMethodsForbidden) Error() string { + return fmt.Sprintf("[GET /paymentmethods][%d] getPaymentMethodsForbidden %+v", 403, o.Payload) +} + +func (o *GetPaymentMethodsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPaymentMethodsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentMethodsNotFound creates a GetPaymentMethodsNotFound with default headers values +func NewGetPaymentMethodsNotFound() *GetPaymentMethodsNotFound { + return &GetPaymentMethodsNotFound{} +} + +/*GetPaymentMethodsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPaymentMethodsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPaymentMethodsNotFound) Error() string { + return fmt.Sprintf("[GET /paymentmethods][%d] getPaymentMethodsNotFound %+v", 404, o.Payload) +} + +func (o *GetPaymentMethodsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPaymentMethodsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentMethodsUnprocessableEntity creates a GetPaymentMethodsUnprocessableEntity with default headers values +func NewGetPaymentMethodsUnprocessableEntity() *GetPaymentMethodsUnprocessableEntity { + return &GetPaymentMethodsUnprocessableEntity{} +} + +/*GetPaymentMethodsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPaymentMethodsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPaymentMethodsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /paymentmethods][%d] getPaymentMethodsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPaymentMethodsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPaymentMethodsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentMethodsInternalServerError creates a GetPaymentMethodsInternalServerError with default headers values +func NewGetPaymentMethodsInternalServerError() *GetPaymentMethodsInternalServerError { + return &GetPaymentMethodsInternalServerError{} +} + +/*GetPaymentMethodsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPaymentMethodsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPaymentMethodsInternalServerError) Error() string { + return fmt.Sprintf("[GET /paymentmethods][%d] getPaymentMethodsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPaymentMethodsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPaymentMethodsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/payment_method/payment_method_client.go b/api/ops/ops_client/payment_method/payment_method_client.go new file mode 100644 index 0000000..855f33f --- /dev/null +++ b/api/ops/ops_client/payment_method/payment_method_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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 payment method API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for payment method API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeletePaymentMethod(params *DeletePaymentMethodParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePaymentMethodOK, error) + + GetPaymentMethods(params *GetPaymentMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPaymentMethodsOK, error) + + PostPaymentMethods(params *PostPaymentMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPaymentMethodsOK, error) + + PutPaymentMethods(params *PutPaymentMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*PutPaymentMethodsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeletePaymentMethod deletes a payment method + + Delete a PaymentMethod by ID +*/ +func (a *Client) DeletePaymentMethod(params *DeletePaymentMethodParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePaymentMethodOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeletePaymentMethodParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deletePaymentMethod", + Method: "DELETE", + PathPattern: "/paymentmethods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeletePaymentMethodReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeletePaymentMethodOK) + 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 deletePaymentMethod: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPaymentMethods gets a list of payment methods + + Return a list of available Taxnexus PaymentMethods +*/ +func (a *Client) GetPaymentMethods(params *GetPaymentMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPaymentMethodsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPaymentMethodsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPaymentMethods", + Method: "GET", + PathPattern: "/paymentmethods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPaymentMethodsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPaymentMethodsOK) + 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 getPaymentMethods: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPaymentMethods creates new payment methods + + Create New PaymentMethods +*/ +func (a *Client) PostPaymentMethods(params *PostPaymentMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPaymentMethodsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPaymentMethodsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPaymentMethods", + Method: "POST", + PathPattern: "/paymentmethods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPaymentMethodsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPaymentMethodsOK) + 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 postPaymentMethods: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPaymentMethods puts a list of payment methods + + Put a list of PaymentMethods +*/ +func (a *Client) PutPaymentMethods(params *PutPaymentMethodsParams, authInfo runtime.ClientAuthInfoWriter) (*PutPaymentMethodsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPaymentMethodsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putPaymentMethods", + Method: "PUT", + PathPattern: "/paymentmethods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPaymentMethodsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutPaymentMethodsOK) + 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 putPaymentMethods: 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/ops/ops_client/payment_method/post_payment_methods_parameters.go b/api/ops/ops_client/payment_method/post_payment_methods_parameters.go new file mode 100644 index 0000000..40e3be9 --- /dev/null +++ b/api/ops/ops_client/payment_method/post_payment_methods_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostPaymentMethodsParams creates a new PostPaymentMethodsParams object +// with the default values initialized. +func NewPostPaymentMethodsParams() *PostPaymentMethodsParams { + var () + return &PostPaymentMethodsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPaymentMethodsParamsWithTimeout creates a new PostPaymentMethodsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPaymentMethodsParamsWithTimeout(timeout time.Duration) *PostPaymentMethodsParams { + var () + return &PostPaymentMethodsParams{ + + timeout: timeout, + } +} + +// NewPostPaymentMethodsParamsWithContext creates a new PostPaymentMethodsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPaymentMethodsParamsWithContext(ctx context.Context) *PostPaymentMethodsParams { + var () + return &PostPaymentMethodsParams{ + + Context: ctx, + } +} + +// NewPostPaymentMethodsParamsWithHTTPClient creates a new PostPaymentMethodsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPaymentMethodsParamsWithHTTPClient(client *http.Client) *PostPaymentMethodsParams { + var () + return &PostPaymentMethodsParams{ + HTTPClient: client, + } +} + +/*PostPaymentMethodsParams contains all the parameters to send to the API endpoint +for the post payment methods operation typically these are written to a http.Request +*/ +type PostPaymentMethodsParams struct { + + /*PaymentMethodRequest + A request with an array of Purchase Order Objects + + */ + PaymentMethodRequest *ops_models.PaymentMethodRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post payment methods params +func (o *PostPaymentMethodsParams) WithTimeout(timeout time.Duration) *PostPaymentMethodsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post payment methods params +func (o *PostPaymentMethodsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post payment methods params +func (o *PostPaymentMethodsParams) WithContext(ctx context.Context) *PostPaymentMethodsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post payment methods params +func (o *PostPaymentMethodsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post payment methods params +func (o *PostPaymentMethodsParams) WithHTTPClient(client *http.Client) *PostPaymentMethodsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post payment methods params +func (o *PostPaymentMethodsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaymentMethodRequest adds the paymentMethodRequest to the post payment methods params +func (o *PostPaymentMethodsParams) WithPaymentMethodRequest(paymentMethodRequest *ops_models.PaymentMethodRequest) *PostPaymentMethodsParams { + o.SetPaymentMethodRequest(paymentMethodRequest) + return o +} + +// SetPaymentMethodRequest adds the paymentMethodRequest to the post payment methods params +func (o *PostPaymentMethodsParams) SetPaymentMethodRequest(paymentMethodRequest *ops_models.PaymentMethodRequest) { + o.PaymentMethodRequest = paymentMethodRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPaymentMethodsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PaymentMethodRequest != nil { + if err := r.SetBodyParam(o.PaymentMethodRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/payment_method/post_payment_methods_responses.go b/api/ops/ops_client/payment_method/post_payment_methods_responses.go new file mode 100644 index 0000000..88e3ca4 --- /dev/null +++ b/api/ops/ops_client/payment_method/post_payment_methods_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostPaymentMethodsReader is a Reader for the PostPaymentMethods structure. +type PostPaymentMethodsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPaymentMethodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPaymentMethodsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPaymentMethodsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPaymentMethodsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPaymentMethodsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPaymentMethodsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPaymentMethodsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPaymentMethodsOK creates a PostPaymentMethodsOK with default headers values +func NewPostPaymentMethodsOK() *PostPaymentMethodsOK { + return &PostPaymentMethodsOK{} +} + +/*PostPaymentMethodsOK handles this case with default header values. + +Taxnexus Response with an array of Payment Method objects +*/ +type PostPaymentMethodsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.PaymentMethodResponse +} + +func (o *PostPaymentMethodsOK) Error() string { + return fmt.Sprintf("[POST /paymentmethods][%d] postPaymentMethodsOK %+v", 200, o.Payload) +} + +func (o *PostPaymentMethodsOK) GetPayload() *ops_models.PaymentMethodResponse { + return o.Payload +} + +func (o *PostPaymentMethodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.PaymentMethodResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPaymentMethodsUnauthorized creates a PostPaymentMethodsUnauthorized with default headers values +func NewPostPaymentMethodsUnauthorized() *PostPaymentMethodsUnauthorized { + return &PostPaymentMethodsUnauthorized{} +} + +/*PostPaymentMethodsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostPaymentMethodsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPaymentMethodsUnauthorized) Error() string { + return fmt.Sprintf("[POST /paymentmethods][%d] postPaymentMethodsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPaymentMethodsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPaymentMethodsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPaymentMethodsForbidden creates a PostPaymentMethodsForbidden with default headers values +func NewPostPaymentMethodsForbidden() *PostPaymentMethodsForbidden { + return &PostPaymentMethodsForbidden{} +} + +/*PostPaymentMethodsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPaymentMethodsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPaymentMethodsForbidden) Error() string { + return fmt.Sprintf("[POST /paymentmethods][%d] postPaymentMethodsForbidden %+v", 403, o.Payload) +} + +func (o *PostPaymentMethodsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPaymentMethodsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPaymentMethodsNotFound creates a PostPaymentMethodsNotFound with default headers values +func NewPostPaymentMethodsNotFound() *PostPaymentMethodsNotFound { + return &PostPaymentMethodsNotFound{} +} + +/*PostPaymentMethodsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPaymentMethodsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPaymentMethodsNotFound) Error() string { + return fmt.Sprintf("[POST /paymentmethods][%d] postPaymentMethodsNotFound %+v", 404, o.Payload) +} + +func (o *PostPaymentMethodsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPaymentMethodsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPaymentMethodsUnprocessableEntity creates a PostPaymentMethodsUnprocessableEntity with default headers values +func NewPostPaymentMethodsUnprocessableEntity() *PostPaymentMethodsUnprocessableEntity { + return &PostPaymentMethodsUnprocessableEntity{} +} + +/*PostPaymentMethodsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPaymentMethodsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPaymentMethodsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /paymentmethods][%d] postPaymentMethodsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostPaymentMethodsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPaymentMethodsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPaymentMethodsInternalServerError creates a PostPaymentMethodsInternalServerError with default headers values +func NewPostPaymentMethodsInternalServerError() *PostPaymentMethodsInternalServerError { + return &PostPaymentMethodsInternalServerError{} +} + +/*PostPaymentMethodsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPaymentMethodsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPaymentMethodsInternalServerError) Error() string { + return fmt.Sprintf("[POST /paymentmethods][%d] postPaymentMethodsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPaymentMethodsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPaymentMethodsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/payment_method/put_payment_methods_parameters.go b/api/ops/ops_client/payment_method/put_payment_methods_parameters.go new file mode 100644 index 0000000..fc4d801 --- /dev/null +++ b/api/ops/ops_client/payment_method/put_payment_methods_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutPaymentMethodsParams creates a new PutPaymentMethodsParams object +// with the default values initialized. +func NewPutPaymentMethodsParams() *PutPaymentMethodsParams { + var () + return &PutPaymentMethodsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutPaymentMethodsParamsWithTimeout creates a new PutPaymentMethodsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutPaymentMethodsParamsWithTimeout(timeout time.Duration) *PutPaymentMethodsParams { + var () + return &PutPaymentMethodsParams{ + + timeout: timeout, + } +} + +// NewPutPaymentMethodsParamsWithContext creates a new PutPaymentMethodsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutPaymentMethodsParamsWithContext(ctx context.Context) *PutPaymentMethodsParams { + var () + return &PutPaymentMethodsParams{ + + Context: ctx, + } +} + +// NewPutPaymentMethodsParamsWithHTTPClient creates a new PutPaymentMethodsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutPaymentMethodsParamsWithHTTPClient(client *http.Client) *PutPaymentMethodsParams { + var () + return &PutPaymentMethodsParams{ + HTTPClient: client, + } +} + +/*PutPaymentMethodsParams contains all the parameters to send to the API endpoint +for the put payment methods operation typically these are written to a http.Request +*/ +type PutPaymentMethodsParams struct { + + /*PaymentMethodRequest + A request with an array of Purchase Order Objects + + */ + PaymentMethodRequest *ops_models.PaymentMethodRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put payment methods params +func (o *PutPaymentMethodsParams) WithTimeout(timeout time.Duration) *PutPaymentMethodsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put payment methods params +func (o *PutPaymentMethodsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put payment methods params +func (o *PutPaymentMethodsParams) WithContext(ctx context.Context) *PutPaymentMethodsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put payment methods params +func (o *PutPaymentMethodsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put payment methods params +func (o *PutPaymentMethodsParams) WithHTTPClient(client *http.Client) *PutPaymentMethodsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put payment methods params +func (o *PutPaymentMethodsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaymentMethodRequest adds the paymentMethodRequest to the put payment methods params +func (o *PutPaymentMethodsParams) WithPaymentMethodRequest(paymentMethodRequest *ops_models.PaymentMethodRequest) *PutPaymentMethodsParams { + o.SetPaymentMethodRequest(paymentMethodRequest) + return o +} + +// SetPaymentMethodRequest adds the paymentMethodRequest to the put payment methods params +func (o *PutPaymentMethodsParams) SetPaymentMethodRequest(paymentMethodRequest *ops_models.PaymentMethodRequest) { + o.PaymentMethodRequest = paymentMethodRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPaymentMethodsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PaymentMethodRequest != nil { + if err := r.SetBodyParam(o.PaymentMethodRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/payment_method/put_payment_methods_responses.go b/api/ops/ops_client/payment_method/put_payment_methods_responses.go new file mode 100644 index 0000000..04f2868 --- /dev/null +++ b/api/ops/ops_client/payment_method/put_payment_methods_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package payment_method + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutPaymentMethodsReader is a Reader for the PutPaymentMethods structure. +type PutPaymentMethodsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPaymentMethodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPaymentMethodsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPaymentMethodsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPaymentMethodsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPaymentMethodsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutPaymentMethodsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPaymentMethodsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutPaymentMethodsOK creates a PutPaymentMethodsOK with default headers values +func NewPutPaymentMethodsOK() *PutPaymentMethodsOK { + return &PutPaymentMethodsOK{} +} + +/*PutPaymentMethodsOK handles this case with default header values. + +Taxnexus Response with an array of Message objects in response to a PUT +*/ +type PutPaymentMethodsOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.PutResponse +} + +func (o *PutPaymentMethodsOK) Error() string { + return fmt.Sprintf("[PUT /paymentmethods][%d] putPaymentMethodsOK %+v", 200, o.Payload) +} + +func (o *PutPaymentMethodsOK) GetPayload() *ops_models.PutResponse { + return o.Payload +} + +func (o *PutPaymentMethodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.PutResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPaymentMethodsUnauthorized creates a PutPaymentMethodsUnauthorized with default headers values +func NewPutPaymentMethodsUnauthorized() *PutPaymentMethodsUnauthorized { + return &PutPaymentMethodsUnauthorized{} +} + +/*PutPaymentMethodsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutPaymentMethodsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPaymentMethodsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /paymentmethods][%d] putPaymentMethodsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutPaymentMethodsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPaymentMethodsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPaymentMethodsForbidden creates a PutPaymentMethodsForbidden with default headers values +func NewPutPaymentMethodsForbidden() *PutPaymentMethodsForbidden { + return &PutPaymentMethodsForbidden{} +} + +/*PutPaymentMethodsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutPaymentMethodsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPaymentMethodsForbidden) Error() string { + return fmt.Sprintf("[PUT /paymentmethods][%d] putPaymentMethodsForbidden %+v", 403, o.Payload) +} + +func (o *PutPaymentMethodsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPaymentMethodsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPaymentMethodsNotFound creates a PutPaymentMethodsNotFound with default headers values +func NewPutPaymentMethodsNotFound() *PutPaymentMethodsNotFound { + return &PutPaymentMethodsNotFound{} +} + +/*PutPaymentMethodsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutPaymentMethodsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPaymentMethodsNotFound) Error() string { + return fmt.Sprintf("[PUT /paymentmethods][%d] putPaymentMethodsNotFound %+v", 404, o.Payload) +} + +func (o *PutPaymentMethodsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPaymentMethodsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPaymentMethodsUnprocessableEntity creates a PutPaymentMethodsUnprocessableEntity with default headers values +func NewPutPaymentMethodsUnprocessableEntity() *PutPaymentMethodsUnprocessableEntity { + return &PutPaymentMethodsUnprocessableEntity{} +} + +/*PutPaymentMethodsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutPaymentMethodsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPaymentMethodsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /paymentmethods][%d] putPaymentMethodsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutPaymentMethodsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPaymentMethodsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPaymentMethodsInternalServerError creates a PutPaymentMethodsInternalServerError with default headers values +func NewPutPaymentMethodsInternalServerError() *PutPaymentMethodsInternalServerError { + return &PutPaymentMethodsInternalServerError{} +} + +/*PutPaymentMethodsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutPaymentMethodsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPaymentMethodsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /paymentmethods][%d] putPaymentMethodsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutPaymentMethodsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPaymentMethodsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/product/delete_product_parameters.go b/api/ops/ops_client/product/delete_product_parameters.go new file mode 100644 index 0000000..582f5ad --- /dev/null +++ b/api/ops/ops_client/product/delete_product_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" +) + +// NewDeleteProductParams creates a new DeleteProductParams object +// with the default values initialized. +func NewDeleteProductParams() *DeleteProductParams { + var () + return &DeleteProductParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteProductParamsWithTimeout creates a new DeleteProductParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteProductParamsWithTimeout(timeout time.Duration) *DeleteProductParams { + var () + return &DeleteProductParams{ + + timeout: timeout, + } +} + +// NewDeleteProductParamsWithContext creates a new DeleteProductParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteProductParamsWithContext(ctx context.Context) *DeleteProductParams { + var () + return &DeleteProductParams{ + + Context: ctx, + } +} + +// NewDeleteProductParamsWithHTTPClient creates a new DeleteProductParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteProductParamsWithHTTPClient(client *http.Client) *DeleteProductParams { + var () + return &DeleteProductParams{ + HTTPClient: client, + } +} + +/*DeleteProductParams contains all the parameters to send to the API endpoint +for the delete product operation typically these are written to a http.Request +*/ +type DeleteProductParams struct { + + /*ProductID + Taxnexus Record Id of a Product + + */ + ProductID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete product params +func (o *DeleteProductParams) WithTimeout(timeout time.Duration) *DeleteProductParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete product params +func (o *DeleteProductParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete product params +func (o *DeleteProductParams) WithContext(ctx context.Context) *DeleteProductParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete product params +func (o *DeleteProductParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete product params +func (o *DeleteProductParams) WithHTTPClient(client *http.Client) *DeleteProductParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete product params +func (o *DeleteProductParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProductID adds the productID to the delete product params +func (o *DeleteProductParams) WithProductID(productID *string) *DeleteProductParams { + o.SetProductID(productID) + return o +} + +// SetProductID adds the productId to the delete product params +func (o *DeleteProductParams) SetProductID(productID *string) { + o.ProductID = productID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteProductParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ProductID != nil { + + // query param productId + var qrProductID string + if o.ProductID != nil { + qrProductID = *o.ProductID + } + qProductID := qrProductID + if qProductID != "" { + if err := r.SetQueryParam("productId", qProductID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/product/delete_product_responses.go b/api/ops/ops_client/product/delete_product_responses.go new file mode 100644 index 0000000..6b5be0a --- /dev/null +++ b/api/ops/ops_client/product/delete_product_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeleteProductReader is a Reader for the DeleteProduct structure. +type DeleteProductReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteProductOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteProductUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteProductForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteProductNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteProductUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteProductInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteProductOK creates a DeleteProductOK with default headers values +func NewDeleteProductOK() *DeleteProductOK { + return &DeleteProductOK{} +} + +/*DeleteProductOK handles this case with default header values. + +Taxnexus Response with an array of Product objects +*/ +type DeleteProductOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.ProductResponse +} + +func (o *DeleteProductOK) Error() string { + return fmt.Sprintf("[DELETE /products][%d] deleteProductOK %+v", 200, o.Payload) +} + +func (o *DeleteProductOK) GetPayload() *ops_models.ProductResponse { + return o.Payload +} + +func (o *DeleteProductOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.ProductResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteProductUnauthorized creates a DeleteProductUnauthorized with default headers values +func NewDeleteProductUnauthorized() *DeleteProductUnauthorized { + return &DeleteProductUnauthorized{} +} + +/*DeleteProductUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteProductUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteProductUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /products][%d] deleteProductUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteProductUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteProductUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteProductForbidden creates a DeleteProductForbidden with default headers values +func NewDeleteProductForbidden() *DeleteProductForbidden { + return &DeleteProductForbidden{} +} + +/*DeleteProductForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteProductForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteProductForbidden) Error() string { + return fmt.Sprintf("[DELETE /products][%d] deleteProductForbidden %+v", 403, o.Payload) +} + +func (o *DeleteProductForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteProductForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteProductNotFound creates a DeleteProductNotFound with default headers values +func NewDeleteProductNotFound() *DeleteProductNotFound { + return &DeleteProductNotFound{} +} + +/*DeleteProductNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteProductNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteProductNotFound) Error() string { + return fmt.Sprintf("[DELETE /products][%d] deleteProductNotFound %+v", 404, o.Payload) +} + +func (o *DeleteProductNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteProductNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteProductUnprocessableEntity creates a DeleteProductUnprocessableEntity with default headers values +func NewDeleteProductUnprocessableEntity() *DeleteProductUnprocessableEntity { + return &DeleteProductUnprocessableEntity{} +} + +/*DeleteProductUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteProductUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteProductUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /products][%d] deleteProductUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteProductUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteProductUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteProductInternalServerError creates a DeleteProductInternalServerError with default headers values +func NewDeleteProductInternalServerError() *DeleteProductInternalServerError { + return &DeleteProductInternalServerError{} +} + +/*DeleteProductInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteProductInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteProductInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /products][%d] deleteProductInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteProductInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteProductInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/product/get_products_observable_parameters.go b/api/ops/ops_client/product/get_products_observable_parameters.go new file mode 100644 index 0000000..406bdd8 --- /dev/null +++ b/api/ops/ops_client/product/get_products_observable_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" +) + +// NewGetProductsObservableParams creates a new GetProductsObservableParams object +// with the default values initialized. +func NewGetProductsObservableParams() *GetProductsObservableParams { + var () + return &GetProductsObservableParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProductsObservableParamsWithTimeout creates a new GetProductsObservableParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProductsObservableParamsWithTimeout(timeout time.Duration) *GetProductsObservableParams { + var () + return &GetProductsObservableParams{ + + timeout: timeout, + } +} + +// NewGetProductsObservableParamsWithContext creates a new GetProductsObservableParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProductsObservableParamsWithContext(ctx context.Context) *GetProductsObservableParams { + var () + return &GetProductsObservableParams{ + + Context: ctx, + } +} + +// NewGetProductsObservableParamsWithHTTPClient creates a new GetProductsObservableParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProductsObservableParamsWithHTTPClient(client *http.Client) *GetProductsObservableParams { + var () + return &GetProductsObservableParams{ + HTTPClient: client, + } +} + +/*GetProductsObservableParams contains all the parameters to send to the API endpoint +for the get products observable operation typically these are written to a http.Request +*/ +type GetProductsObservableParams struct { + + /*Active + Retrieve active records? + + */ + Active *bool + /*ProductCode + Product Code of a Product + + */ + ProductCode *string + /*ProductID + Taxnexus Record Id of a Product + + */ + ProductID *string + /*Publish + Is this product published? + + */ + Publish *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get products observable params +func (o *GetProductsObservableParams) WithTimeout(timeout time.Duration) *GetProductsObservableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get products observable params +func (o *GetProductsObservableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get products observable params +func (o *GetProductsObservableParams) WithContext(ctx context.Context) *GetProductsObservableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get products observable params +func (o *GetProductsObservableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get products observable params +func (o *GetProductsObservableParams) WithHTTPClient(client *http.Client) *GetProductsObservableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get products observable params +func (o *GetProductsObservableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get products observable params +func (o *GetProductsObservableParams) WithActive(active *bool) *GetProductsObservableParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get products observable params +func (o *GetProductsObservableParams) SetActive(active *bool) { + o.Active = active +} + +// WithProductCode adds the productCode to the get products observable params +func (o *GetProductsObservableParams) WithProductCode(productCode *string) *GetProductsObservableParams { + o.SetProductCode(productCode) + return o +} + +// SetProductCode adds the productCode to the get products observable params +func (o *GetProductsObservableParams) SetProductCode(productCode *string) { + o.ProductCode = productCode +} + +// WithProductID adds the productID to the get products observable params +func (o *GetProductsObservableParams) WithProductID(productID *string) *GetProductsObservableParams { + o.SetProductID(productID) + return o +} + +// SetProductID adds the productId to the get products observable params +func (o *GetProductsObservableParams) SetProductID(productID *string) { + o.ProductID = productID +} + +// WithPublish adds the publish to the get products observable params +func (o *GetProductsObservableParams) WithPublish(publish *bool) *GetProductsObservableParams { + o.SetPublish(publish) + return o +} + +// SetPublish adds the publish to the get products observable params +func (o *GetProductsObservableParams) SetPublish(publish *bool) { + o.Publish = publish +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProductsObservableParams) 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.ProductCode != nil { + + // query param productCode + var qrProductCode string + if o.ProductCode != nil { + qrProductCode = *o.ProductCode + } + qProductCode := qrProductCode + if qProductCode != "" { + if err := r.SetQueryParam("productCode", qProductCode); err != nil { + return err + } + } + + } + + if o.ProductID != nil { + + // query param productId + var qrProductID string + if o.ProductID != nil { + qrProductID = *o.ProductID + } + qProductID := qrProductID + if qProductID != "" { + if err := r.SetQueryParam("productId", qProductID); err != nil { + return err + } + } + + } + + if o.Publish != nil { + + // query param publish + var qrPublish bool + if o.Publish != nil { + qrPublish = *o.Publish + } + qPublish := swag.FormatBool(qrPublish) + if qPublish != "" { + if err := r.SetQueryParam("publish", qPublish); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/product/get_products_observable_responses.go b/api/ops/ops_client/product/get_products_observable_responses.go new file mode 100644 index 0000000..fb7061b --- /dev/null +++ b/api/ops/ops_client/product/get_products_observable_responses.go @@ -0,0 +1,301 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetProductsObservableReader is a Reader for the GetProductsObservable structure. +type GetProductsObservableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProductsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProductsObservableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetProductsObservableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetProductsObservableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetProductsObservableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetProductsObservableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetProductsObservableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetProductsObservableOK creates a GetProductsObservableOK with default headers values +func NewGetProductsObservableOK() *GetProductsObservableOK { + return &GetProductsObservableOK{} +} + +/*GetProductsObservableOK handles this case with default header values. + +Simple array of products +*/ +type GetProductsObservableOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload []*ops_models.Product +} + +func (o *GetProductsObservableOK) Error() string { + return fmt.Sprintf("[GET /products/observable][%d] getProductsObservableOK %+v", 200, o.Payload) +} + +func (o *GetProductsObservableOK) GetPayload() []*ops_models.Product { + return o.Payload +} + +func (o *GetProductsObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsObservableUnauthorized creates a GetProductsObservableUnauthorized with default headers values +func NewGetProductsObservableUnauthorized() *GetProductsObservableUnauthorized { + return &GetProductsObservableUnauthorized{} +} + +/*GetProductsObservableUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetProductsObservableUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsObservableUnauthorized) Error() string { + return fmt.Sprintf("[GET /products/observable][%d] getProductsObservableUnauthorized %+v", 401, o.Payload) +} + +func (o *GetProductsObservableUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsObservableForbidden creates a GetProductsObservableForbidden with default headers values +func NewGetProductsObservableForbidden() *GetProductsObservableForbidden { + return &GetProductsObservableForbidden{} +} + +/*GetProductsObservableForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetProductsObservableForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsObservableForbidden) Error() string { + return fmt.Sprintf("[GET /products/observable][%d] getProductsObservableForbidden %+v", 403, o.Payload) +} + +func (o *GetProductsObservableForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsObservableNotFound creates a GetProductsObservableNotFound with default headers values +func NewGetProductsObservableNotFound() *GetProductsObservableNotFound { + return &GetProductsObservableNotFound{} +} + +/*GetProductsObservableNotFound handles this case with default header values. + +Resource was not found +*/ +type GetProductsObservableNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsObservableNotFound) Error() string { + return fmt.Sprintf("[GET /products/observable][%d] getProductsObservableNotFound %+v", 404, o.Payload) +} + +func (o *GetProductsObservableNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsObservableUnprocessableEntity creates a GetProductsObservableUnprocessableEntity with default headers values +func NewGetProductsObservableUnprocessableEntity() *GetProductsObservableUnprocessableEntity { + return &GetProductsObservableUnprocessableEntity{} +} + +/*GetProductsObservableUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetProductsObservableUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsObservableUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /products/observable][%d] getProductsObservableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetProductsObservableUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsObservableInternalServerError creates a GetProductsObservableInternalServerError with default headers values +func NewGetProductsObservableInternalServerError() *GetProductsObservableInternalServerError { + return &GetProductsObservableInternalServerError{} +} + +/*GetProductsObservableInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetProductsObservableInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsObservableInternalServerError) Error() string { + return fmt.Sprintf("[GET /products/observable][%d] getProductsObservableInternalServerError %+v", 500, o.Payload) +} + +func (o *GetProductsObservableInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/product/get_products_parameters.go b/api/ops/ops_client/product/get_products_parameters.go new file mode 100644 index 0000000..0015db0 --- /dev/null +++ b/api/ops/ops_client/product/get_products_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" +) + +// NewGetProductsParams creates a new GetProductsParams object +// with the default values initialized. +func NewGetProductsParams() *GetProductsParams { + var () + return &GetProductsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProductsParamsWithTimeout creates a new GetProductsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProductsParamsWithTimeout(timeout time.Duration) *GetProductsParams { + var () + return &GetProductsParams{ + + timeout: timeout, + } +} + +// NewGetProductsParamsWithContext creates a new GetProductsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProductsParamsWithContext(ctx context.Context) *GetProductsParams { + var () + return &GetProductsParams{ + + Context: ctx, + } +} + +// NewGetProductsParamsWithHTTPClient creates a new GetProductsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProductsParamsWithHTTPClient(client *http.Client) *GetProductsParams { + var () + return &GetProductsParams{ + HTTPClient: client, + } +} + +/*GetProductsParams contains all the parameters to send to the API endpoint +for the get products operation typically these are written to a http.Request +*/ +type GetProductsParams struct { + + /*Active + Retrieve active records? + + */ + Active *bool + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*ProductCode + Product Code of a Product + + */ + ProductCode *string + /*ProductID + Taxnexus Record Id of a Product + + */ + ProductID *string + /*Publish + Is this product published? + + */ + Publish *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get products params +func (o *GetProductsParams) WithTimeout(timeout time.Duration) *GetProductsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get products params +func (o *GetProductsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get products params +func (o *GetProductsParams) WithContext(ctx context.Context) *GetProductsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get products params +func (o *GetProductsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get products params +func (o *GetProductsParams) WithHTTPClient(client *http.Client) *GetProductsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get products params +func (o *GetProductsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get products params +func (o *GetProductsParams) WithActive(active *bool) *GetProductsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get products params +func (o *GetProductsParams) SetActive(active *bool) { + o.Active = active +} + +// WithLimit adds the limit to the get products params +func (o *GetProductsParams) WithLimit(limit *int64) *GetProductsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get products params +func (o *GetProductsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get products params +func (o *GetProductsParams) WithOffset(offset *int64) *GetProductsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get products params +func (o *GetProductsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithProductCode adds the productCode to the get products params +func (o *GetProductsParams) WithProductCode(productCode *string) *GetProductsParams { + o.SetProductCode(productCode) + return o +} + +// SetProductCode adds the productCode to the get products params +func (o *GetProductsParams) SetProductCode(productCode *string) { + o.ProductCode = productCode +} + +// WithProductID adds the productID to the get products params +func (o *GetProductsParams) WithProductID(productID *string) *GetProductsParams { + o.SetProductID(productID) + return o +} + +// SetProductID adds the productId to the get products params +func (o *GetProductsParams) SetProductID(productID *string) { + o.ProductID = productID +} + +// WithPublish adds the publish to the get products params +func (o *GetProductsParams) WithPublish(publish *bool) *GetProductsParams { + o.SetPublish(publish) + return o +} + +// SetPublish adds the publish to the get products params +func (o *GetProductsParams) SetPublish(publish *bool) { + o.Publish = publish +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProductsParams) 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.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.ProductCode != nil { + + // query param productCode + var qrProductCode string + if o.ProductCode != nil { + qrProductCode = *o.ProductCode + } + qProductCode := qrProductCode + if qProductCode != "" { + if err := r.SetQueryParam("productCode", qProductCode); err != nil { + return err + } + } + + } + + if o.ProductID != nil { + + // query param productId + var qrProductID string + if o.ProductID != nil { + qrProductID = *o.ProductID + } + qProductID := qrProductID + if qProductID != "" { + if err := r.SetQueryParam("productId", qProductID); err != nil { + return err + } + } + + } + + if o.Publish != nil { + + // query param publish + var qrPublish bool + if o.Publish != nil { + qrPublish = *o.Publish + } + qPublish := swag.FormatBool(qrPublish) + if qPublish != "" { + if err := r.SetQueryParam("publish", qPublish); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/product/get_products_responses.go b/api/ops/ops_client/product/get_products_responses.go new file mode 100644 index 0000000..819d9c5 --- /dev/null +++ b/api/ops/ops_client/product/get_products_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetProductsReader is a Reader for the GetProducts structure. +type GetProductsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProductsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetProductsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetProductsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetProductsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetProductsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetProductsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetProductsOK creates a GetProductsOK with default headers values +func NewGetProductsOK() *GetProductsOK { + return &GetProductsOK{} +} + +/*GetProductsOK handles this case with default header values. + +Taxnexus Response with an array of Product objects +*/ +type GetProductsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.ProductResponse +} + +func (o *GetProductsOK) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsOK %+v", 200, o.Payload) +} + +func (o *GetProductsOK) GetPayload() *ops_models.ProductResponse { + return o.Payload +} + +func (o *GetProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.ProductResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsUnauthorized creates a GetProductsUnauthorized with default headers values +func NewGetProductsUnauthorized() *GetProductsUnauthorized { + return &GetProductsUnauthorized{} +} + +/*GetProductsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetProductsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsUnauthorized) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetProductsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsForbidden creates a GetProductsForbidden with default headers values +func NewGetProductsForbidden() *GetProductsForbidden { + return &GetProductsForbidden{} +} + +/*GetProductsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetProductsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsForbidden) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsForbidden %+v", 403, o.Payload) +} + +func (o *GetProductsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsNotFound creates a GetProductsNotFound with default headers values +func NewGetProductsNotFound() *GetProductsNotFound { + return &GetProductsNotFound{} +} + +/*GetProductsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetProductsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsNotFound) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsNotFound %+v", 404, o.Payload) +} + +func (o *GetProductsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsUnprocessableEntity creates a GetProductsUnprocessableEntity with default headers values +func NewGetProductsUnprocessableEntity() *GetProductsUnprocessableEntity { + return &GetProductsUnprocessableEntity{} +} + +/*GetProductsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetProductsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetProductsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsInternalServerError creates a GetProductsInternalServerError with default headers values +func NewGetProductsInternalServerError() *GetProductsInternalServerError { + return &GetProductsInternalServerError{} +} + +/*GetProductsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetProductsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetProductsInternalServerError) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetProductsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetProductsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/product/post_products_parameters.go b/api/ops/ops_client/product/post_products_parameters.go new file mode 100644 index 0000000..3371ba8 --- /dev/null +++ b/api/ops/ops_client/product/post_products_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostProductsParams creates a new PostProductsParams object +// with the default values initialized. +func NewPostProductsParams() *PostProductsParams { + var () + return &PostProductsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostProductsParamsWithTimeout creates a new PostProductsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostProductsParamsWithTimeout(timeout time.Duration) *PostProductsParams { + var () + return &PostProductsParams{ + + timeout: timeout, + } +} + +// NewPostProductsParamsWithContext creates a new PostProductsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostProductsParamsWithContext(ctx context.Context) *PostProductsParams { + var () + return &PostProductsParams{ + + Context: ctx, + } +} + +// NewPostProductsParamsWithHTTPClient creates a new PostProductsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostProductsParamsWithHTTPClient(client *http.Client) *PostProductsParams { + var () + return &PostProductsParams{ + HTTPClient: client, + } +} + +/*PostProductsParams contains all the parameters to send to the API endpoint +for the post products operation typically these are written to a http.Request +*/ +type PostProductsParams struct { + + /*ProductRequest + A request with an array of Product Objects + + */ + ProductRequest *ops_models.ProductRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post products params +func (o *PostProductsParams) WithTimeout(timeout time.Duration) *PostProductsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post products params +func (o *PostProductsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post products params +func (o *PostProductsParams) WithContext(ctx context.Context) *PostProductsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post products params +func (o *PostProductsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post products params +func (o *PostProductsParams) WithHTTPClient(client *http.Client) *PostProductsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post products params +func (o *PostProductsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProductRequest adds the productRequest to the post products params +func (o *PostProductsParams) WithProductRequest(productRequest *ops_models.ProductRequest) *PostProductsParams { + o.SetProductRequest(productRequest) + return o +} + +// SetProductRequest adds the productRequest to the post products params +func (o *PostProductsParams) SetProductRequest(productRequest *ops_models.ProductRequest) { + o.ProductRequest = productRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostProductsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ProductRequest != nil { + if err := r.SetBodyParam(o.ProductRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/product/post_products_responses.go b/api/ops/ops_client/product/post_products_responses.go new file mode 100644 index 0000000..96bd6a1 --- /dev/null +++ b/api/ops/ops_client/product/post_products_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostProductsReader is a Reader for the PostProducts structure. +type PostProductsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostProductsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostProductsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostProductsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostProductsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostProductsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostProductsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostProductsOK creates a PostProductsOK with default headers values +func NewPostProductsOK() *PostProductsOK { + return &PostProductsOK{} +} + +/*PostProductsOK handles this case with default header values. + +Taxnexus Response with an array of Product objects +*/ +type PostProductsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.ProductResponse +} + +func (o *PostProductsOK) Error() string { + return fmt.Sprintf("[POST /products][%d] postProductsOK %+v", 200, o.Payload) +} + +func (o *PostProductsOK) GetPayload() *ops_models.ProductResponse { + return o.Payload +} + +func (o *PostProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.ProductResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostProductsUnauthorized creates a PostProductsUnauthorized with default headers values +func NewPostProductsUnauthorized() *PostProductsUnauthorized { + return &PostProductsUnauthorized{} +} + +/*PostProductsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostProductsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostProductsUnauthorized) Error() string { + return fmt.Sprintf("[POST /products][%d] postProductsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostProductsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostProductsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostProductsForbidden creates a PostProductsForbidden with default headers values +func NewPostProductsForbidden() *PostProductsForbidden { + return &PostProductsForbidden{} +} + +/*PostProductsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostProductsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostProductsForbidden) Error() string { + return fmt.Sprintf("[POST /products][%d] postProductsForbidden %+v", 403, o.Payload) +} + +func (o *PostProductsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostProductsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostProductsNotFound creates a PostProductsNotFound with default headers values +func NewPostProductsNotFound() *PostProductsNotFound { + return &PostProductsNotFound{} +} + +/*PostProductsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostProductsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostProductsNotFound) Error() string { + return fmt.Sprintf("[POST /products][%d] postProductsNotFound %+v", 404, o.Payload) +} + +func (o *PostProductsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostProductsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostProductsUnprocessableEntity creates a PostProductsUnprocessableEntity with default headers values +func NewPostProductsUnprocessableEntity() *PostProductsUnprocessableEntity { + return &PostProductsUnprocessableEntity{} +} + +/*PostProductsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostProductsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostProductsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /products][%d] postProductsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostProductsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostProductsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostProductsInternalServerError creates a PostProductsInternalServerError with default headers values +func NewPostProductsInternalServerError() *PostProductsInternalServerError { + return &PostProductsInternalServerError{} +} + +/*PostProductsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostProductsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostProductsInternalServerError) Error() string { + return fmt.Sprintf("[POST /products][%d] postProductsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostProductsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostProductsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/product/product_client.go b/api/ops/ops_client/product/product_client.go new file mode 100644 index 0000000..0ac58f9 --- /dev/null +++ b/api/ops/ops_client/product/product_client.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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 product API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for product API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteProduct(params *DeleteProductParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteProductOK, error) + + GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) + + GetProductsObservable(params *GetProductsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsObservableOK, error) + + PostProducts(params *PostProductsParams, authInfo runtime.ClientAuthInfoWriter) (*PostProductsOK, error) + + PutProducts(params *PutProductsParams, authInfo runtime.ClientAuthInfoWriter) (*PutProductsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteProduct deletes a product + + Delete Taxnexus Product record +*/ +func (a *Client) DeleteProduct(params *DeleteProductParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteProductOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteProductParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteProduct", + Method: "DELETE", + PathPattern: "/products", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteProductReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteProductOK) + 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 deleteProduct: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetProducts gets a list of products + + Return a list of all available Products +*/ +func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProductsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getProducts", + Method: "GET", + PathPattern: "/products", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetProductsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProductsOK) + 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 getProducts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetProductsObservable gets a list of products + + Return a simplified list of all available Products +*/ +func (a *Client) GetProductsObservable(params *GetProductsObservableParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsObservableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProductsObservableParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getProductsObservable", + Method: "GET", + PathPattern: "/products/observable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetProductsObservableReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProductsObservableOK) + 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 getProductsObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostProducts adds new products + + Product records to be added +*/ +func (a *Client) PostProducts(params *PostProductsParams, authInfo runtime.ClientAuthInfoWriter) (*PostProductsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostProductsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postProducts", + Method: "POST", + PathPattern: "/products", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostProductsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostProductsOK) + 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 postProducts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutProducts updates products + + Update Product records +*/ +func (a *Client) PutProducts(params *PutProductsParams, authInfo runtime.ClientAuthInfoWriter) (*PutProductsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutProductsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putProducts", + Method: "PUT", + PathPattern: "/products", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutProductsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutProductsOK) + 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 putProducts: 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/ops/ops_client/product/put_products_parameters.go b/api/ops/ops_client/product/put_products_parameters.go new file mode 100644 index 0000000..f8c6f86 --- /dev/null +++ b/api/ops/ops_client/product/put_products_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutProductsParams creates a new PutProductsParams object +// with the default values initialized. +func NewPutProductsParams() *PutProductsParams { + var () + return &PutProductsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutProductsParamsWithTimeout creates a new PutProductsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutProductsParamsWithTimeout(timeout time.Duration) *PutProductsParams { + var () + return &PutProductsParams{ + + timeout: timeout, + } +} + +// NewPutProductsParamsWithContext creates a new PutProductsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutProductsParamsWithContext(ctx context.Context) *PutProductsParams { + var () + return &PutProductsParams{ + + Context: ctx, + } +} + +// NewPutProductsParamsWithHTTPClient creates a new PutProductsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutProductsParamsWithHTTPClient(client *http.Client) *PutProductsParams { + var () + return &PutProductsParams{ + HTTPClient: client, + } +} + +/*PutProductsParams contains all the parameters to send to the API endpoint +for the put products operation typically these are written to a http.Request +*/ +type PutProductsParams struct { + + /*ProductRequest + A request with an array of Product Objects + + */ + ProductRequest *ops_models.ProductRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put products params +func (o *PutProductsParams) WithTimeout(timeout time.Duration) *PutProductsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put products params +func (o *PutProductsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put products params +func (o *PutProductsParams) WithContext(ctx context.Context) *PutProductsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put products params +func (o *PutProductsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put products params +func (o *PutProductsParams) WithHTTPClient(client *http.Client) *PutProductsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put products params +func (o *PutProductsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProductRequest adds the productRequest to the put products params +func (o *PutProductsParams) WithProductRequest(productRequest *ops_models.ProductRequest) *PutProductsParams { + o.SetProductRequest(productRequest) + return o +} + +// SetProductRequest adds the productRequest to the put products params +func (o *PutProductsParams) SetProductRequest(productRequest *ops_models.ProductRequest) { + o.ProductRequest = productRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutProductsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ProductRequest != nil { + if err := r.SetBodyParam(o.ProductRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/product/put_products_responses.go b/api/ops/ops_client/product/put_products_responses.go new file mode 100644 index 0000000..5279598 --- /dev/null +++ b/api/ops/ops_client/product/put_products_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package product + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutProductsReader is a Reader for the PutProducts structure. +type PutProductsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutProductsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutProductsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutProductsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutProductsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutProductsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutProductsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutProductsOK creates a PutProductsOK with default headers values +func NewPutProductsOK() *PutProductsOK { + return &PutProductsOK{} +} + +/*PutProductsOK handles this case with default header values. + +Taxnexus Response with an array of Message objects in response to a PUT +*/ +type PutProductsOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.PutResponse +} + +func (o *PutProductsOK) Error() string { + return fmt.Sprintf("[PUT /products][%d] putProductsOK %+v", 200, o.Payload) +} + +func (o *PutProductsOK) GetPayload() *ops_models.PutResponse { + return o.Payload +} + +func (o *PutProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.PutResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutProductsUnauthorized creates a PutProductsUnauthorized with default headers values +func NewPutProductsUnauthorized() *PutProductsUnauthorized { + return &PutProductsUnauthorized{} +} + +/*PutProductsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutProductsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutProductsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /products][%d] putProductsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutProductsUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutProductsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutProductsForbidden creates a PutProductsForbidden with default headers values +func NewPutProductsForbidden() *PutProductsForbidden { + return &PutProductsForbidden{} +} + +/*PutProductsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutProductsForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutProductsForbidden) Error() string { + return fmt.Sprintf("[PUT /products][%d] putProductsForbidden %+v", 403, o.Payload) +} + +func (o *PutProductsForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutProductsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutProductsNotFound creates a PutProductsNotFound with default headers values +func NewPutProductsNotFound() *PutProductsNotFound { + return &PutProductsNotFound{} +} + +/*PutProductsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutProductsNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutProductsNotFound) Error() string { + return fmt.Sprintf("[PUT /products][%d] putProductsNotFound %+v", 404, o.Payload) +} + +func (o *PutProductsNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutProductsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutProductsUnprocessableEntity creates a PutProductsUnprocessableEntity with default headers values +func NewPutProductsUnprocessableEntity() *PutProductsUnprocessableEntity { + return &PutProductsUnprocessableEntity{} +} + +/*PutProductsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutProductsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutProductsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /products][%d] putProductsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutProductsUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutProductsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutProductsInternalServerError creates a PutProductsInternalServerError with default headers values +func NewPutProductsInternalServerError() *PutProductsInternalServerError { + return &PutProductsInternalServerError{} +} + +/*PutProductsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutProductsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutProductsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /products][%d] putProductsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutProductsInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutProductsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/purchase_order/delete_purchase_order_parameters.go b/api/ops/ops_client/purchase_order/delete_purchase_order_parameters.go new file mode 100644 index 0000000..6bd32f6 --- /dev/null +++ b/api/ops/ops_client/purchase_order/delete_purchase_order_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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" +) + +// NewDeletePurchaseOrderParams creates a new DeletePurchaseOrderParams object +// with the default values initialized. +func NewDeletePurchaseOrderParams() *DeletePurchaseOrderParams { + var () + return &DeletePurchaseOrderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeletePurchaseOrderParamsWithTimeout creates a new DeletePurchaseOrderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeletePurchaseOrderParamsWithTimeout(timeout time.Duration) *DeletePurchaseOrderParams { + var () + return &DeletePurchaseOrderParams{ + + timeout: timeout, + } +} + +// NewDeletePurchaseOrderParamsWithContext creates a new DeletePurchaseOrderParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeletePurchaseOrderParamsWithContext(ctx context.Context) *DeletePurchaseOrderParams { + var () + return &DeletePurchaseOrderParams{ + + Context: ctx, + } +} + +// NewDeletePurchaseOrderParamsWithHTTPClient creates a new DeletePurchaseOrderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeletePurchaseOrderParamsWithHTTPClient(client *http.Client) *DeletePurchaseOrderParams { + var () + return &DeletePurchaseOrderParams{ + HTTPClient: client, + } +} + +/*DeletePurchaseOrderParams contains all the parameters to send to the API endpoint +for the delete purchase order operation typically these are written to a http.Request +*/ +type DeletePurchaseOrderParams struct { + + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete purchase order params +func (o *DeletePurchaseOrderParams) WithTimeout(timeout time.Duration) *DeletePurchaseOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete purchase order params +func (o *DeletePurchaseOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete purchase order params +func (o *DeletePurchaseOrderParams) WithContext(ctx context.Context) *DeletePurchaseOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete purchase order params +func (o *DeletePurchaseOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete purchase order params +func (o *DeletePurchaseOrderParams) WithHTTPClient(client *http.Client) *DeletePurchaseOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete purchase order params +func (o *DeletePurchaseOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete purchase order params +func (o *DeletePurchaseOrderParams) WithID(id *string) *DeletePurchaseOrderParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete purchase order params +func (o *DeletePurchaseOrderParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeletePurchaseOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/purchase_order/delete_purchase_order_responses.go b/api/ops/ops_client/purchase_order/delete_purchase_order_responses.go new file mode 100644 index 0000000..2fbae1d --- /dev/null +++ b/api/ops/ops_client/purchase_order/delete_purchase_order_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeletePurchaseOrderReader is a Reader for the DeletePurchaseOrder structure. +type DeletePurchaseOrderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeletePurchaseOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeletePurchaseOrderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeletePurchaseOrderUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeletePurchaseOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeletePurchaseOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeletePurchaseOrderUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeletePurchaseOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeletePurchaseOrderOK creates a DeletePurchaseOrderOK with default headers values +func NewDeletePurchaseOrderOK() *DeletePurchaseOrderOK { + return &DeletePurchaseOrderOK{} +} + +/*DeletePurchaseOrderOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeletePurchaseOrderOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.DeleteResponse +} + +func (o *DeletePurchaseOrderOK) Error() string { + return fmt.Sprintf("[DELETE /pos][%d] deletePurchaseOrderOK %+v", 200, o.Payload) +} + +func (o *DeletePurchaseOrderOK) GetPayload() *ops_models.DeleteResponse { + return o.Payload +} + +func (o *DeletePurchaseOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePurchaseOrderUnauthorized creates a DeletePurchaseOrderUnauthorized with default headers values +func NewDeletePurchaseOrderUnauthorized() *DeletePurchaseOrderUnauthorized { + return &DeletePurchaseOrderUnauthorized{} +} + +/*DeletePurchaseOrderUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeletePurchaseOrderUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePurchaseOrderUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /pos][%d] deletePurchaseOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *DeletePurchaseOrderUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePurchaseOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePurchaseOrderForbidden creates a DeletePurchaseOrderForbidden with default headers values +func NewDeletePurchaseOrderForbidden() *DeletePurchaseOrderForbidden { + return &DeletePurchaseOrderForbidden{} +} + +/*DeletePurchaseOrderForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeletePurchaseOrderForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePurchaseOrderForbidden) Error() string { + return fmt.Sprintf("[DELETE /pos][%d] deletePurchaseOrderForbidden %+v", 403, o.Payload) +} + +func (o *DeletePurchaseOrderForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePurchaseOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePurchaseOrderNotFound creates a DeletePurchaseOrderNotFound with default headers values +func NewDeletePurchaseOrderNotFound() *DeletePurchaseOrderNotFound { + return &DeletePurchaseOrderNotFound{} +} + +/*DeletePurchaseOrderNotFound handles this case with default header values. + +Resource was not found +*/ +type DeletePurchaseOrderNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePurchaseOrderNotFound) Error() string { + return fmt.Sprintf("[DELETE /pos][%d] deletePurchaseOrderNotFound %+v", 404, o.Payload) +} + +func (o *DeletePurchaseOrderNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePurchaseOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePurchaseOrderUnprocessableEntity creates a DeletePurchaseOrderUnprocessableEntity with default headers values +func NewDeletePurchaseOrderUnprocessableEntity() *DeletePurchaseOrderUnprocessableEntity { + return &DeletePurchaseOrderUnprocessableEntity{} +} + +/*DeletePurchaseOrderUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeletePurchaseOrderUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePurchaseOrderUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /pos][%d] deletePurchaseOrderUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeletePurchaseOrderUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePurchaseOrderUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeletePurchaseOrderInternalServerError creates a DeletePurchaseOrderInternalServerError with default headers values +func NewDeletePurchaseOrderInternalServerError() *DeletePurchaseOrderInternalServerError { + return &DeletePurchaseOrderInternalServerError{} +} + +/*DeletePurchaseOrderInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeletePurchaseOrderInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeletePurchaseOrderInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /pos][%d] deletePurchaseOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *DeletePurchaseOrderInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeletePurchaseOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/purchase_order/get_purchase_orders_parameters.go b/api/ops/ops_client/purchase_order/get_purchase_orders_parameters.go new file mode 100644 index 0000000..78b7416 --- /dev/null +++ b/api/ops/ops_client/purchase_order/get_purchase_orders_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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" +) + +// NewGetPurchaseOrdersParams creates a new GetPurchaseOrdersParams object +// with the default values initialized. +func NewGetPurchaseOrdersParams() *GetPurchaseOrdersParams { + var () + return &GetPurchaseOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPurchaseOrdersParamsWithTimeout creates a new GetPurchaseOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPurchaseOrdersParamsWithTimeout(timeout time.Duration) *GetPurchaseOrdersParams { + var () + return &GetPurchaseOrdersParams{ + + timeout: timeout, + } +} + +// NewGetPurchaseOrdersParamsWithContext creates a new GetPurchaseOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPurchaseOrdersParamsWithContext(ctx context.Context) *GetPurchaseOrdersParams { + var () + return &GetPurchaseOrdersParams{ + + Context: ctx, + } +} + +// NewGetPurchaseOrdersParamsWithHTTPClient creates a new GetPurchaseOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPurchaseOrdersParamsWithHTTPClient(client *http.Client) *GetPurchaseOrdersParams { + var () + return &GetPurchaseOrdersParams{ + HTTPClient: client, + } +} + +/*GetPurchaseOrdersParams contains all the parameters to send to the API endpoint +for the get purchase orders operation typically these are written to a http.Request +*/ +type GetPurchaseOrdersParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*PurchaseOrderID + Taxnexus Record Id of a Company + + */ + PurchaseOrderID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get purchase orders params +func (o *GetPurchaseOrdersParams) WithTimeout(timeout time.Duration) *GetPurchaseOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get purchase orders params +func (o *GetPurchaseOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get purchase orders params +func (o *GetPurchaseOrdersParams) WithContext(ctx context.Context) *GetPurchaseOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get purchase orders params +func (o *GetPurchaseOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get purchase orders params +func (o *GetPurchaseOrdersParams) WithHTTPClient(client *http.Client) *GetPurchaseOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get purchase orders params +func (o *GetPurchaseOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get purchase orders params +func (o *GetPurchaseOrdersParams) WithLimit(limit *int64) *GetPurchaseOrdersParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get purchase orders params +func (o *GetPurchaseOrdersParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get purchase orders params +func (o *GetPurchaseOrdersParams) WithOffset(offset *int64) *GetPurchaseOrdersParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get purchase orders params +func (o *GetPurchaseOrdersParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPurchaseOrderID adds the purchaseOrderID to the get purchase orders params +func (o *GetPurchaseOrdersParams) WithPurchaseOrderID(purchaseOrderID *string) *GetPurchaseOrdersParams { + o.SetPurchaseOrderID(purchaseOrderID) + return o +} + +// SetPurchaseOrderID adds the purchaseOrderId to the get purchase orders params +func (o *GetPurchaseOrdersParams) SetPurchaseOrderID(purchaseOrderID *string) { + o.PurchaseOrderID = purchaseOrderID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPurchaseOrdersParams) 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.PurchaseOrderID != nil { + + // query param purchaseOrderId + var qrPurchaseOrderID string + if o.PurchaseOrderID != nil { + qrPurchaseOrderID = *o.PurchaseOrderID + } + qPurchaseOrderID := qrPurchaseOrderID + if qPurchaseOrderID != "" { + if err := r.SetQueryParam("purchaseOrderId", qPurchaseOrderID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/purchase_order/get_purchase_orders_responses.go b/api/ops/ops_client/purchase_order/get_purchase_orders_responses.go new file mode 100644 index 0000000..686f6ca --- /dev/null +++ b/api/ops/ops_client/purchase_order/get_purchase_orders_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetPurchaseOrdersReader is a Reader for the GetPurchaseOrders structure. +type GetPurchaseOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPurchaseOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPurchaseOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPurchaseOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPurchaseOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPurchaseOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPurchaseOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPurchaseOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPurchaseOrdersOK creates a GetPurchaseOrdersOK with default headers values +func NewGetPurchaseOrdersOK() *GetPurchaseOrdersOK { + return &GetPurchaseOrdersOK{} +} + +/*GetPurchaseOrdersOK handles this case with default header values. + +Taxnexus Response with an array of Purchase Order objects +*/ +type GetPurchaseOrdersOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.PurchaseOrderResponse +} + +func (o *GetPurchaseOrdersOK) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPurchaseOrdersOK %+v", 200, o.Payload) +} + +func (o *GetPurchaseOrdersOK) GetPayload() *ops_models.PurchaseOrderResponse { + return o.Payload +} + +func (o *GetPurchaseOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.PurchaseOrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrdersUnauthorized creates a GetPurchaseOrdersUnauthorized with default headers values +func NewGetPurchaseOrdersUnauthorized() *GetPurchaseOrdersUnauthorized { + return &GetPurchaseOrdersUnauthorized{} +} + +/*GetPurchaseOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPurchaseOrdersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPurchaseOrdersUnauthorized) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPurchaseOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPurchaseOrdersUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrdersForbidden creates a GetPurchaseOrdersForbidden with default headers values +func NewGetPurchaseOrdersForbidden() *GetPurchaseOrdersForbidden { + return &GetPurchaseOrdersForbidden{} +} + +/*GetPurchaseOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPurchaseOrdersForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPurchaseOrdersForbidden) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPurchaseOrdersForbidden %+v", 403, o.Payload) +} + +func (o *GetPurchaseOrdersForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrdersNotFound creates a GetPurchaseOrdersNotFound with default headers values +func NewGetPurchaseOrdersNotFound() *GetPurchaseOrdersNotFound { + return &GetPurchaseOrdersNotFound{} +} + +/*GetPurchaseOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPurchaseOrdersNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPurchaseOrdersNotFound) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPurchaseOrdersNotFound %+v", 404, o.Payload) +} + +func (o *GetPurchaseOrdersNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrdersUnprocessableEntity creates a GetPurchaseOrdersUnprocessableEntity with default headers values +func NewGetPurchaseOrdersUnprocessableEntity() *GetPurchaseOrdersUnprocessableEntity { + return &GetPurchaseOrdersUnprocessableEntity{} +} + +/*GetPurchaseOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPurchaseOrdersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPurchaseOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPurchaseOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPurchaseOrdersUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPurchaseOrdersInternalServerError creates a GetPurchaseOrdersInternalServerError with default headers values +func NewGetPurchaseOrdersInternalServerError() *GetPurchaseOrdersInternalServerError { + return &GetPurchaseOrdersInternalServerError{} +} + +/*GetPurchaseOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPurchaseOrdersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetPurchaseOrdersInternalServerError) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPurchaseOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPurchaseOrdersInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetPurchaseOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/purchase_order/post_purchase_orders_parameters.go b/api/ops/ops_client/purchase_order/post_purchase_orders_parameters.go new file mode 100644 index 0000000..52bcd31 --- /dev/null +++ b/api/ops/ops_client/purchase_order/post_purchase_orders_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostPurchaseOrdersParams creates a new PostPurchaseOrdersParams object +// with the default values initialized. +func NewPostPurchaseOrdersParams() *PostPurchaseOrdersParams { + var () + return &PostPurchaseOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPurchaseOrdersParamsWithTimeout creates a new PostPurchaseOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPurchaseOrdersParamsWithTimeout(timeout time.Duration) *PostPurchaseOrdersParams { + var () + return &PostPurchaseOrdersParams{ + + timeout: timeout, + } +} + +// NewPostPurchaseOrdersParamsWithContext creates a new PostPurchaseOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPurchaseOrdersParamsWithContext(ctx context.Context) *PostPurchaseOrdersParams { + var () + return &PostPurchaseOrdersParams{ + + Context: ctx, + } +} + +// NewPostPurchaseOrdersParamsWithHTTPClient creates a new PostPurchaseOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPurchaseOrdersParamsWithHTTPClient(client *http.Client) *PostPurchaseOrdersParams { + var () + return &PostPurchaseOrdersParams{ + HTTPClient: client, + } +} + +/*PostPurchaseOrdersParams contains all the parameters to send to the API endpoint +for the post purchase orders operation typically these are written to a http.Request +*/ +type PostPurchaseOrdersParams struct { + + /*PurchaseOrderRequest + A request with an array of Purchase Order Objects + + */ + PurchaseOrderRequest *ops_models.PurchaseOrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post purchase orders params +func (o *PostPurchaseOrdersParams) WithTimeout(timeout time.Duration) *PostPurchaseOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post purchase orders params +func (o *PostPurchaseOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post purchase orders params +func (o *PostPurchaseOrdersParams) WithContext(ctx context.Context) *PostPurchaseOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post purchase orders params +func (o *PostPurchaseOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post purchase orders params +func (o *PostPurchaseOrdersParams) WithHTTPClient(client *http.Client) *PostPurchaseOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post purchase orders params +func (o *PostPurchaseOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPurchaseOrderRequest adds the purchaseOrderRequest to the post purchase orders params +func (o *PostPurchaseOrdersParams) WithPurchaseOrderRequest(purchaseOrderRequest *ops_models.PurchaseOrderRequest) *PostPurchaseOrdersParams { + o.SetPurchaseOrderRequest(purchaseOrderRequest) + return o +} + +// SetPurchaseOrderRequest adds the purchaseOrderRequest to the post purchase orders params +func (o *PostPurchaseOrdersParams) SetPurchaseOrderRequest(purchaseOrderRequest *ops_models.PurchaseOrderRequest) { + o.PurchaseOrderRequest = purchaseOrderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPurchaseOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PurchaseOrderRequest != nil { + if err := r.SetBodyParam(o.PurchaseOrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/purchase_order/post_purchase_orders_responses.go b/api/ops/ops_client/purchase_order/post_purchase_orders_responses.go new file mode 100644 index 0000000..90f0dd6 --- /dev/null +++ b/api/ops/ops_client/purchase_order/post_purchase_orders_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostPurchaseOrdersReader is a Reader for the PostPurchaseOrders structure. +type PostPurchaseOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPurchaseOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPurchaseOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPurchaseOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPurchaseOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPurchaseOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostPurchaseOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPurchaseOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPurchaseOrdersOK creates a PostPurchaseOrdersOK with default headers values +func NewPostPurchaseOrdersOK() *PostPurchaseOrdersOK { + return &PostPurchaseOrdersOK{} +} + +/*PostPurchaseOrdersOK handles this case with default header values. + +Taxnexus Response with an array of Purchase Order objects +*/ +type PostPurchaseOrdersOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.PurchaseOrderResponse +} + +func (o *PostPurchaseOrdersOK) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPurchaseOrdersOK %+v", 200, o.Payload) +} + +func (o *PostPurchaseOrdersOK) GetPayload() *ops_models.PurchaseOrderResponse { + return o.Payload +} + +func (o *PostPurchaseOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.PurchaseOrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPurchaseOrdersUnauthorized creates a PostPurchaseOrdersUnauthorized with default headers values +func NewPostPurchaseOrdersUnauthorized() *PostPurchaseOrdersUnauthorized { + return &PostPurchaseOrdersUnauthorized{} +} + +/*PostPurchaseOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostPurchaseOrdersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPurchaseOrdersUnauthorized) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPurchaseOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPurchaseOrdersUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPurchaseOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPurchaseOrdersForbidden creates a PostPurchaseOrdersForbidden with default headers values +func NewPostPurchaseOrdersForbidden() *PostPurchaseOrdersForbidden { + return &PostPurchaseOrdersForbidden{} +} + +/*PostPurchaseOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPurchaseOrdersForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPurchaseOrdersForbidden) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPurchaseOrdersForbidden %+v", 403, o.Payload) +} + +func (o *PostPurchaseOrdersForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPurchaseOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPurchaseOrdersNotFound creates a PostPurchaseOrdersNotFound with default headers values +func NewPostPurchaseOrdersNotFound() *PostPurchaseOrdersNotFound { + return &PostPurchaseOrdersNotFound{} +} + +/*PostPurchaseOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPurchaseOrdersNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPurchaseOrdersNotFound) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPurchaseOrdersNotFound %+v", 404, o.Payload) +} + +func (o *PostPurchaseOrdersNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPurchaseOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPurchaseOrdersUnprocessableEntity creates a PostPurchaseOrdersUnprocessableEntity with default headers values +func NewPostPurchaseOrdersUnprocessableEntity() *PostPurchaseOrdersUnprocessableEntity { + return &PostPurchaseOrdersUnprocessableEntity{} +} + +/*PostPurchaseOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostPurchaseOrdersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPurchaseOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPurchaseOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostPurchaseOrdersUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPurchaseOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPurchaseOrdersInternalServerError creates a PostPurchaseOrdersInternalServerError with default headers values +func NewPostPurchaseOrdersInternalServerError() *PostPurchaseOrdersInternalServerError { + return &PostPurchaseOrdersInternalServerError{} +} + +/*PostPurchaseOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPurchaseOrdersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostPurchaseOrdersInternalServerError) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPurchaseOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPurchaseOrdersInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostPurchaseOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/purchase_order/purchase_order_client.go b/api/ops/ops_client/purchase_order/purchase_order_client.go new file mode 100644 index 0000000..2825b1d --- /dev/null +++ b/api/ops/ops_client/purchase_order/purchase_order_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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 purchase order API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for purchase order API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeletePurchaseOrder(params *DeletePurchaseOrderParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePurchaseOrderOK, error) + + GetPurchaseOrders(params *GetPurchaseOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrdersOK, error) + + PostPurchaseOrders(params *PostPurchaseOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostPurchaseOrdersOK, error) + + PutPurchaseOrders(params *PutPurchaseOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PutPurchaseOrdersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeletePurchaseOrder deletes a p o + + Delete a PO by ID +*/ +func (a *Client) DeletePurchaseOrder(params *DeletePurchaseOrderParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePurchaseOrderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeletePurchaseOrderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deletePurchaseOrder", + Method: "DELETE", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeletePurchaseOrderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeletePurchaseOrderOK) + 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 deletePurchaseOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetPurchaseOrders gets a list of purchase orders + + Return a list of available Purchase Orders +*/ +func (a *Client) GetPurchaseOrders(params *GetPurchaseOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*GetPurchaseOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPurchaseOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPurchaseOrders", + Method: "GET", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPurchaseOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPurchaseOrdersOK) + 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 getPurchaseOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPurchaseOrders creates a new purchase order + + Create New Purchase Order +*/ +func (a *Client) PostPurchaseOrders(params *PostPurchaseOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostPurchaseOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPurchaseOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPurchaseOrders", + Method: "POST", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPurchaseOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPurchaseOrdersOK) + 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 postPurchaseOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPurchaseOrders upserts a list of purchase order + + Upsert a list of Purchase Order +*/ +func (a *Client) PutPurchaseOrders(params *PutPurchaseOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PutPurchaseOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPurchaseOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putPurchaseOrders", + Method: "PUT", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPurchaseOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutPurchaseOrdersOK) + 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 putPurchaseOrders: 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/ops/ops_client/purchase_order/put_purchase_orders_parameters.go b/api/ops/ops_client/purchase_order/put_purchase_orders_parameters.go new file mode 100644 index 0000000..03232fe --- /dev/null +++ b/api/ops/ops_client/purchase_order/put_purchase_orders_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutPurchaseOrdersParams creates a new PutPurchaseOrdersParams object +// with the default values initialized. +func NewPutPurchaseOrdersParams() *PutPurchaseOrdersParams { + var () + return &PutPurchaseOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutPurchaseOrdersParamsWithTimeout creates a new PutPurchaseOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutPurchaseOrdersParamsWithTimeout(timeout time.Duration) *PutPurchaseOrdersParams { + var () + return &PutPurchaseOrdersParams{ + + timeout: timeout, + } +} + +// NewPutPurchaseOrdersParamsWithContext creates a new PutPurchaseOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutPurchaseOrdersParamsWithContext(ctx context.Context) *PutPurchaseOrdersParams { + var () + return &PutPurchaseOrdersParams{ + + Context: ctx, + } +} + +// NewPutPurchaseOrdersParamsWithHTTPClient creates a new PutPurchaseOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutPurchaseOrdersParamsWithHTTPClient(client *http.Client) *PutPurchaseOrdersParams { + var () + return &PutPurchaseOrdersParams{ + HTTPClient: client, + } +} + +/*PutPurchaseOrdersParams contains all the parameters to send to the API endpoint +for the put purchase orders operation typically these are written to a http.Request +*/ +type PutPurchaseOrdersParams struct { + + /*PurchaseOrderRequest + A request with an array of Purchase Order Objects + + */ + PurchaseOrderRequest *ops_models.PurchaseOrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put purchase orders params +func (o *PutPurchaseOrdersParams) WithTimeout(timeout time.Duration) *PutPurchaseOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put purchase orders params +func (o *PutPurchaseOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put purchase orders params +func (o *PutPurchaseOrdersParams) WithContext(ctx context.Context) *PutPurchaseOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put purchase orders params +func (o *PutPurchaseOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put purchase orders params +func (o *PutPurchaseOrdersParams) WithHTTPClient(client *http.Client) *PutPurchaseOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put purchase orders params +func (o *PutPurchaseOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPurchaseOrderRequest adds the purchaseOrderRequest to the put purchase orders params +func (o *PutPurchaseOrdersParams) WithPurchaseOrderRequest(purchaseOrderRequest *ops_models.PurchaseOrderRequest) *PutPurchaseOrdersParams { + o.SetPurchaseOrderRequest(purchaseOrderRequest) + return o +} + +// SetPurchaseOrderRequest adds the purchaseOrderRequest to the put purchase orders params +func (o *PutPurchaseOrdersParams) SetPurchaseOrderRequest(purchaseOrderRequest *ops_models.PurchaseOrderRequest) { + o.PurchaseOrderRequest = purchaseOrderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPurchaseOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PurchaseOrderRequest != nil { + if err := r.SetBodyParam(o.PurchaseOrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/purchase_order/put_purchase_orders_responses.go b/api/ops/ops_client/purchase_order/put_purchase_orders_responses.go new file mode 100644 index 0000000..da6fa67 --- /dev/null +++ b/api/ops/ops_client/purchase_order/put_purchase_orders_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_order + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutPurchaseOrdersReader is a Reader for the PutPurchaseOrders structure. +type PutPurchaseOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPurchaseOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPurchaseOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPurchaseOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPurchaseOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPurchaseOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutPurchaseOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPurchaseOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutPurchaseOrdersOK creates a PutPurchaseOrdersOK with default headers values +func NewPutPurchaseOrdersOK() *PutPurchaseOrdersOK { + return &PutPurchaseOrdersOK{} +} + +/*PutPurchaseOrdersOK handles this case with default header values. + +Taxnexus Response with an array of Message objects in response to a PUT +*/ +type PutPurchaseOrdersOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.PutResponse +} + +func (o *PutPurchaseOrdersOK) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPurchaseOrdersOK %+v", 200, o.Payload) +} + +func (o *PutPurchaseOrdersOK) GetPayload() *ops_models.PutResponse { + return o.Payload +} + +func (o *PutPurchaseOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.PutResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPurchaseOrdersUnauthorized creates a PutPurchaseOrdersUnauthorized with default headers values +func NewPutPurchaseOrdersUnauthorized() *PutPurchaseOrdersUnauthorized { + return &PutPurchaseOrdersUnauthorized{} +} + +/*PutPurchaseOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutPurchaseOrdersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPurchaseOrdersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPurchaseOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *PutPurchaseOrdersUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPurchaseOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPurchaseOrdersForbidden creates a PutPurchaseOrdersForbidden with default headers values +func NewPutPurchaseOrdersForbidden() *PutPurchaseOrdersForbidden { + return &PutPurchaseOrdersForbidden{} +} + +/*PutPurchaseOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutPurchaseOrdersForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPurchaseOrdersForbidden) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPurchaseOrdersForbidden %+v", 403, o.Payload) +} + +func (o *PutPurchaseOrdersForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPurchaseOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPurchaseOrdersNotFound creates a PutPurchaseOrdersNotFound with default headers values +func NewPutPurchaseOrdersNotFound() *PutPurchaseOrdersNotFound { + return &PutPurchaseOrdersNotFound{} +} + +/*PutPurchaseOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type PutPurchaseOrdersNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPurchaseOrdersNotFound) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPurchaseOrdersNotFound %+v", 404, o.Payload) +} + +func (o *PutPurchaseOrdersNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPurchaseOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPurchaseOrdersUnprocessableEntity creates a PutPurchaseOrdersUnprocessableEntity with default headers values +func NewPutPurchaseOrdersUnprocessableEntity() *PutPurchaseOrdersUnprocessableEntity { + return &PutPurchaseOrdersUnprocessableEntity{} +} + +/*PutPurchaseOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutPurchaseOrdersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPurchaseOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPurchaseOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutPurchaseOrdersUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPurchaseOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPurchaseOrdersInternalServerError creates a PutPurchaseOrdersInternalServerError with default headers values +func NewPutPurchaseOrdersInternalServerError() *PutPurchaseOrdersInternalServerError { + return &PutPurchaseOrdersInternalServerError{} +} + +/*PutPurchaseOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutPurchaseOrdersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutPurchaseOrdersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPurchaseOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *PutPurchaseOrdersInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutPurchaseOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/quote/delete_quote_parameters.go b/api/ops/ops_client/quote/delete_quote_parameters.go new file mode 100644 index 0000000..d8a5f25 --- /dev/null +++ b/api/ops/ops_client/quote/delete_quote_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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" +) + +// NewDeleteQuoteParams creates a new DeleteQuoteParams object +// with the default values initialized. +func NewDeleteQuoteParams() *DeleteQuoteParams { + var () + return &DeleteQuoteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteQuoteParamsWithTimeout creates a new DeleteQuoteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteQuoteParamsWithTimeout(timeout time.Duration) *DeleteQuoteParams { + var () + return &DeleteQuoteParams{ + + timeout: timeout, + } +} + +// NewDeleteQuoteParamsWithContext creates a new DeleteQuoteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteQuoteParamsWithContext(ctx context.Context) *DeleteQuoteParams { + var () + return &DeleteQuoteParams{ + + Context: ctx, + } +} + +// NewDeleteQuoteParamsWithHTTPClient creates a new DeleteQuoteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteQuoteParamsWithHTTPClient(client *http.Client) *DeleteQuoteParams { + var () + return &DeleteQuoteParams{ + HTTPClient: client, + } +} + +/*DeleteQuoteParams contains all the parameters to send to the API endpoint +for the delete quote operation typically these are written to a http.Request +*/ +type DeleteQuoteParams struct { + + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete quote params +func (o *DeleteQuoteParams) WithTimeout(timeout time.Duration) *DeleteQuoteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete quote params +func (o *DeleteQuoteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete quote params +func (o *DeleteQuoteParams) WithContext(ctx context.Context) *DeleteQuoteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete quote params +func (o *DeleteQuoteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete quote params +func (o *DeleteQuoteParams) WithHTTPClient(client *http.Client) *DeleteQuoteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete quote params +func (o *DeleteQuoteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete quote params +func (o *DeleteQuoteParams) WithID(id *string) *DeleteQuoteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete quote params +func (o *DeleteQuoteParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteQuoteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/quote/delete_quote_responses.go b/api/ops/ops_client/quote/delete_quote_responses.go new file mode 100644 index 0000000..83d8024 --- /dev/null +++ b/api/ops/ops_client/quote/delete_quote_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// DeleteQuoteReader is a Reader for the DeleteQuote structure. +type DeleteQuoteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteQuoteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteQuoteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteQuoteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteQuoteForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteQuoteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteQuoteUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteQuoteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteQuoteOK creates a DeleteQuoteOK with default headers values +func NewDeleteQuoteOK() *DeleteQuoteOK { + return &DeleteQuoteOK{} +} + +/*DeleteQuoteOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteQuoteOK struct { + AccessControlAllowOrigin string + + Payload *ops_models.DeleteResponse +} + +func (o *DeleteQuoteOK) Error() string { + return fmt.Sprintf("[DELETE /quotes][%d] deleteQuoteOK %+v", 200, o.Payload) +} + +func (o *DeleteQuoteOK) GetPayload() *ops_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteQuoteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteQuoteUnauthorized creates a DeleteQuoteUnauthorized with default headers values +func NewDeleteQuoteUnauthorized() *DeleteQuoteUnauthorized { + return &DeleteQuoteUnauthorized{} +} + +/*DeleteQuoteUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteQuoteUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteQuoteUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /quotes][%d] deleteQuoteUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteQuoteUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteQuoteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteQuoteForbidden creates a DeleteQuoteForbidden with default headers values +func NewDeleteQuoteForbidden() *DeleteQuoteForbidden { + return &DeleteQuoteForbidden{} +} + +/*DeleteQuoteForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteQuoteForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteQuoteForbidden) Error() string { + return fmt.Sprintf("[DELETE /quotes][%d] deleteQuoteForbidden %+v", 403, o.Payload) +} + +func (o *DeleteQuoteForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteQuoteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteQuoteNotFound creates a DeleteQuoteNotFound with default headers values +func NewDeleteQuoteNotFound() *DeleteQuoteNotFound { + return &DeleteQuoteNotFound{} +} + +/*DeleteQuoteNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteQuoteNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteQuoteNotFound) Error() string { + return fmt.Sprintf("[DELETE /quotes][%d] deleteQuoteNotFound %+v", 404, o.Payload) +} + +func (o *DeleteQuoteNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteQuoteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteQuoteUnprocessableEntity creates a DeleteQuoteUnprocessableEntity with default headers values +func NewDeleteQuoteUnprocessableEntity() *DeleteQuoteUnprocessableEntity { + return &DeleteQuoteUnprocessableEntity{} +} + +/*DeleteQuoteUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteQuoteUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteQuoteUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /quotes][%d] deleteQuoteUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteQuoteUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteQuoteUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteQuoteInternalServerError creates a DeleteQuoteInternalServerError with default headers values +func NewDeleteQuoteInternalServerError() *DeleteQuoteInternalServerError { + return &DeleteQuoteInternalServerError{} +} + +/*DeleteQuoteInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteQuoteInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *DeleteQuoteInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /quotes][%d] deleteQuoteInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteQuoteInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *DeleteQuoteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/quote/get_quotes_parameters.go b/api/ops/ops_client/quote/get_quotes_parameters.go new file mode 100644 index 0000000..50dc362 --- /dev/null +++ b/api/ops/ops_client/quote/get_quotes_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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" +) + +// NewGetQuotesParams creates a new GetQuotesParams object +// with the default values initialized. +func NewGetQuotesParams() *GetQuotesParams { + var () + return &GetQuotesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetQuotesParamsWithTimeout creates a new GetQuotesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetQuotesParamsWithTimeout(timeout time.Duration) *GetQuotesParams { + var () + return &GetQuotesParams{ + + timeout: timeout, + } +} + +// NewGetQuotesParamsWithContext creates a new GetQuotesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetQuotesParamsWithContext(ctx context.Context) *GetQuotesParams { + var () + return &GetQuotesParams{ + + Context: ctx, + } +} + +// NewGetQuotesParamsWithHTTPClient creates a new GetQuotesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetQuotesParamsWithHTTPClient(client *http.Client) *GetQuotesParams { + var () + return &GetQuotesParams{ + HTTPClient: client, + } +} + +/*GetQuotesParams contains all the parameters to send to the API endpoint +for the get quotes operation typically these are written to a http.Request +*/ +type GetQuotesParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*QuoteID + Taxnexus Record Id of a Quote + + */ + QuoteID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get quotes params +func (o *GetQuotesParams) WithTimeout(timeout time.Duration) *GetQuotesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get quotes params +func (o *GetQuotesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get quotes params +func (o *GetQuotesParams) WithContext(ctx context.Context) *GetQuotesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get quotes params +func (o *GetQuotesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get quotes params +func (o *GetQuotesParams) WithHTTPClient(client *http.Client) *GetQuotesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get quotes params +func (o *GetQuotesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get quotes params +func (o *GetQuotesParams) WithLimit(limit *int64) *GetQuotesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get quotes params +func (o *GetQuotesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get quotes params +func (o *GetQuotesParams) WithOffset(offset *int64) *GetQuotesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get quotes params +func (o *GetQuotesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQuoteID adds the quoteID to the get quotes params +func (o *GetQuotesParams) WithQuoteID(quoteID *string) *GetQuotesParams { + o.SetQuoteID(quoteID) + return o +} + +// SetQuoteID adds the quoteId to the get quotes params +func (o *GetQuotesParams) SetQuoteID(quoteID *string) { + o.QuoteID = quoteID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetQuotesParams) 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.QuoteID != nil { + + // query param quoteId + var qrQuoteID string + if o.QuoteID != nil { + qrQuoteID = *o.QuoteID + } + qQuoteID := qrQuoteID + if qQuoteID != "" { + if err := r.SetQueryParam("quoteId", qQuoteID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/quote/get_quotes_responses.go b/api/ops/ops_client/quote/get_quotes_responses.go new file mode 100644 index 0000000..d4cc169 --- /dev/null +++ b/api/ops/ops_client/quote/get_quotes_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// GetQuotesReader is a Reader for the GetQuotes structure. +type GetQuotesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetQuotesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetQuotesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetQuotesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetQuotesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetQuotesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetQuotesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetQuotesOK creates a GetQuotesOK with default headers values +func NewGetQuotesOK() *GetQuotesOK { + return &GetQuotesOK{} +} + +/*GetQuotesOK handles this case with default header values. + +Taxnexus Response with an array of Quote objects +*/ +type GetQuotesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.QuoteResponse +} + +func (o *GetQuotesOK) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesOK %+v", 200, o.Payload) +} + +func (o *GetQuotesOK) GetPayload() *ops_models.QuoteResponse { + return o.Payload +} + +func (o *GetQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.QuoteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesUnauthorized creates a GetQuotesUnauthorized with default headers values +func NewGetQuotesUnauthorized() *GetQuotesUnauthorized { + return &GetQuotesUnauthorized{} +} + +/*GetQuotesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetQuotesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetQuotesUnauthorized) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetQuotesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesForbidden creates a GetQuotesForbidden with default headers values +func NewGetQuotesForbidden() *GetQuotesForbidden { + return &GetQuotesForbidden{} +} + +/*GetQuotesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetQuotesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetQuotesForbidden) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesForbidden %+v", 403, o.Payload) +} + +func (o *GetQuotesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesNotFound creates a GetQuotesNotFound with default headers values +func NewGetQuotesNotFound() *GetQuotesNotFound { + return &GetQuotesNotFound{} +} + +/*GetQuotesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetQuotesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetQuotesNotFound) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesNotFound %+v", 404, o.Payload) +} + +func (o *GetQuotesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesUnprocessableEntity creates a GetQuotesUnprocessableEntity with default headers values +func NewGetQuotesUnprocessableEntity() *GetQuotesUnprocessableEntity { + return &GetQuotesUnprocessableEntity{} +} + +/*GetQuotesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetQuotesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetQuotesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetQuotesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetQuotesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesInternalServerError creates a GetQuotesInternalServerError with default headers values +func NewGetQuotesInternalServerError() *GetQuotesInternalServerError { + return &GetQuotesInternalServerError{} +} + +/*GetQuotesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetQuotesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *GetQuotesInternalServerError) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetQuotesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *GetQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/quote/post_quotes_parameters.go b/api/ops/ops_client/quote/post_quotes_parameters.go new file mode 100644 index 0000000..f09f956 --- /dev/null +++ b/api/ops/ops_client/quote/post_quotes_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostQuotesParams creates a new PostQuotesParams object +// with the default values initialized. +func NewPostQuotesParams() *PostQuotesParams { + var () + return &PostQuotesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostQuotesParamsWithTimeout creates a new PostQuotesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostQuotesParamsWithTimeout(timeout time.Duration) *PostQuotesParams { + var () + return &PostQuotesParams{ + + timeout: timeout, + } +} + +// NewPostQuotesParamsWithContext creates a new PostQuotesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostQuotesParamsWithContext(ctx context.Context) *PostQuotesParams { + var () + return &PostQuotesParams{ + + Context: ctx, + } +} + +// NewPostQuotesParamsWithHTTPClient creates a new PostQuotesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostQuotesParamsWithHTTPClient(client *http.Client) *PostQuotesParams { + var () + return &PostQuotesParams{ + HTTPClient: client, + } +} + +/*PostQuotesParams contains all the parameters to send to the API endpoint +for the post quotes operation typically these are written to a http.Request +*/ +type PostQuotesParams struct { + + /*QuoteRequest + A request with an array of Quote Objects + + */ + QuoteRequest *ops_models.QuoteRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post quotes params +func (o *PostQuotesParams) WithTimeout(timeout time.Duration) *PostQuotesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post quotes params +func (o *PostQuotesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post quotes params +func (o *PostQuotesParams) WithContext(ctx context.Context) *PostQuotesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post quotes params +func (o *PostQuotesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post quotes params +func (o *PostQuotesParams) WithHTTPClient(client *http.Client) *PostQuotesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post quotes params +func (o *PostQuotesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQuoteRequest adds the quoteRequest to the post quotes params +func (o *PostQuotesParams) WithQuoteRequest(quoteRequest *ops_models.QuoteRequest) *PostQuotesParams { + o.SetQuoteRequest(quoteRequest) + return o +} + +// SetQuoteRequest adds the quoteRequest to the post quotes params +func (o *PostQuotesParams) SetQuoteRequest(quoteRequest *ops_models.QuoteRequest) { + o.QuoteRequest = quoteRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostQuotesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.QuoteRequest != nil { + if err := r.SetBodyParam(o.QuoteRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/quote/post_quotes_responses.go b/api/ops/ops_client/quote/post_quotes_responses.go new file mode 100644 index 0000000..d1d5e13 --- /dev/null +++ b/api/ops/ops_client/quote/post_quotes_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostQuotesReader is a Reader for the PostQuotes structure. +type PostQuotesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostQuotesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostQuotesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostQuotesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostQuotesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostQuotesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostQuotesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostQuotesOK creates a PostQuotesOK with default headers values +func NewPostQuotesOK() *PostQuotesOK { + return &PostQuotesOK{} +} + +/*PostQuotesOK handles this case with default header values. + +Taxnexus Response with an array of Quote objects +*/ +type PostQuotesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.QuoteResponse +} + +func (o *PostQuotesOK) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesOK %+v", 200, o.Payload) +} + +func (o *PostQuotesOK) GetPayload() *ops_models.QuoteResponse { + return o.Payload +} + +func (o *PostQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.QuoteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesUnauthorized creates a PostQuotesUnauthorized with default headers values +func NewPostQuotesUnauthorized() *PostQuotesUnauthorized { + return &PostQuotesUnauthorized{} +} + +/*PostQuotesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostQuotesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostQuotesUnauthorized) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostQuotesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesForbidden creates a PostQuotesForbidden with default headers values +func NewPostQuotesForbidden() *PostQuotesForbidden { + return &PostQuotesForbidden{} +} + +/*PostQuotesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostQuotesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostQuotesForbidden) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesForbidden %+v", 403, o.Payload) +} + +func (o *PostQuotesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesNotFound creates a PostQuotesNotFound with default headers values +func NewPostQuotesNotFound() *PostQuotesNotFound { + return &PostQuotesNotFound{} +} + +/*PostQuotesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostQuotesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostQuotesNotFound) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesNotFound %+v", 404, o.Payload) +} + +func (o *PostQuotesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesUnprocessableEntity creates a PostQuotesUnprocessableEntity with default headers values +func NewPostQuotesUnprocessableEntity() *PostQuotesUnprocessableEntity { + return &PostQuotesUnprocessableEntity{} +} + +/*PostQuotesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostQuotesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostQuotesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostQuotesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostQuotesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesInternalServerError creates a PostQuotesInternalServerError with default headers values +func NewPostQuotesInternalServerError() *PostQuotesInternalServerError { + return &PostQuotesInternalServerError{} +} + +/*PostQuotesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostQuotesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostQuotesInternalServerError) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostQuotesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/quote/put_quotes_parameters.go b/api/ops/ops_client/quote/put_quotes_parameters.go new file mode 100644 index 0000000..8ca3111 --- /dev/null +++ b/api/ops/ops_client/quote/put_quotes_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPutQuotesParams creates a new PutQuotesParams object +// with the default values initialized. +func NewPutQuotesParams() *PutQuotesParams { + var () + return &PutQuotesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutQuotesParamsWithTimeout creates a new PutQuotesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutQuotesParamsWithTimeout(timeout time.Duration) *PutQuotesParams { + var () + return &PutQuotesParams{ + + timeout: timeout, + } +} + +// NewPutQuotesParamsWithContext creates a new PutQuotesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutQuotesParamsWithContext(ctx context.Context) *PutQuotesParams { + var () + return &PutQuotesParams{ + + Context: ctx, + } +} + +// NewPutQuotesParamsWithHTTPClient creates a new PutQuotesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutQuotesParamsWithHTTPClient(client *http.Client) *PutQuotesParams { + var () + return &PutQuotesParams{ + HTTPClient: client, + } +} + +/*PutQuotesParams contains all the parameters to send to the API endpoint +for the put quotes operation typically these are written to a http.Request +*/ +type PutQuotesParams struct { + + /*QuoteRequest + A request with an array of Quote Objects + + */ + QuoteRequest *ops_models.QuoteRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put quotes params +func (o *PutQuotesParams) WithTimeout(timeout time.Duration) *PutQuotesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put quotes params +func (o *PutQuotesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put quotes params +func (o *PutQuotesParams) WithContext(ctx context.Context) *PutQuotesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put quotes params +func (o *PutQuotesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put quotes params +func (o *PutQuotesParams) WithHTTPClient(client *http.Client) *PutQuotesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put quotes params +func (o *PutQuotesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQuoteRequest adds the quoteRequest to the put quotes params +func (o *PutQuotesParams) WithQuoteRequest(quoteRequest *ops_models.QuoteRequest) *PutQuotesParams { + o.SetQuoteRequest(quoteRequest) + return o +} + +// SetQuoteRequest adds the quoteRequest to the put quotes params +func (o *PutQuotesParams) SetQuoteRequest(quoteRequest *ops_models.QuoteRequest) { + o.QuoteRequest = quoteRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutQuotesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.QuoteRequest != nil { + if err := r.SetBodyParam(o.QuoteRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/quote/put_quotes_responses.go b/api/ops/ops_client/quote/put_quotes_responses.go new file mode 100644 index 0000000..20996aa --- /dev/null +++ b/api/ops/ops_client/quote/put_quotes_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PutQuotesReader is a Reader for the PutQuotes structure. +type PutQuotesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutQuotesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutQuotesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutQuotesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutQuotesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutQuotesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutQuotesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutQuotesOK creates a PutQuotesOK with default headers values +func NewPutQuotesOK() *PutQuotesOK { + return &PutQuotesOK{} +} + +/*PutQuotesOK handles this case with default header values. + +Taxnexus Response with an array of Quote objects +*/ +type PutQuotesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.QuoteResponse +} + +func (o *PutQuotesOK) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesOK %+v", 200, o.Payload) +} + +func (o *PutQuotesOK) GetPayload() *ops_models.QuoteResponse { + return o.Payload +} + +func (o *PutQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.QuoteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesUnauthorized creates a PutQuotesUnauthorized with default headers values +func NewPutQuotesUnauthorized() *PutQuotesUnauthorized { + return &PutQuotesUnauthorized{} +} + +/*PutQuotesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutQuotesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutQuotesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutQuotesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesForbidden creates a PutQuotesForbidden with default headers values +func NewPutQuotesForbidden() *PutQuotesForbidden { + return &PutQuotesForbidden{} +} + +/*PutQuotesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutQuotesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutQuotesForbidden) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesForbidden %+v", 403, o.Payload) +} + +func (o *PutQuotesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesNotFound creates a PutQuotesNotFound with default headers values +func NewPutQuotesNotFound() *PutQuotesNotFound { + return &PutQuotesNotFound{} +} + +/*PutQuotesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutQuotesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutQuotesNotFound) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesNotFound %+v", 404, o.Payload) +} + +func (o *PutQuotesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesUnprocessableEntity creates a PutQuotesUnprocessableEntity with default headers values +func NewPutQuotesUnprocessableEntity() *PutQuotesUnprocessableEntity { + return &PutQuotesUnprocessableEntity{} +} + +/*PutQuotesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutQuotesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutQuotesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutQuotesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutQuotesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesInternalServerError creates a PutQuotesInternalServerError with default headers values +func NewPutQuotesInternalServerError() *PutQuotesInternalServerError { + return &PutQuotesInternalServerError{} +} + +/*PutQuotesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutQuotesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PutQuotesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutQuotesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PutQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/quote/quote_client.go b/api/ops/ops_client/quote/quote_client.go new file mode 100644 index 0000000..6da6e36 --- /dev/null +++ b/api/ops/ops_client/quote/quote_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quote + +// 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 quote API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for quote API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteQuote(params *DeleteQuoteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteQuoteOK, error) + + GetQuotes(params *GetQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*GetQuotesOK, error) + + PostQuotes(params *PostQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PostQuotesOK, error) + + PutQuotes(params *PutQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PutQuotesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteQuote deletes a quote + + Delete quote by ID +*/ +func (a *Client) DeleteQuote(params *DeleteQuoteParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteQuoteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteQuoteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteQuote", + Method: "DELETE", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteQuoteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteQuoteOK) + 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 deleteQuote: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetQuotes gets a list of invoices + + Return a list of available quotes +*/ +func (a *Client) GetQuotes(params *GetQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*GetQuotesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetQuotesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getQuotes", + Method: "GET", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetQuotesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetQuotesOK) + 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 getQuotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostQuotes creates a new quotes + + Create New Quotes +*/ +func (a *Client) PostQuotes(params *PostQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PostQuotesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostQuotesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postQuotes", + Method: "POST", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostQuotesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostQuotesOK) + 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 postQuotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutQuotes puts a list of quotes + + Put a list of Quotes +*/ +func (a *Client) PutQuotes(params *PutQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PutQuotesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutQuotesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putQuotes", + Method: "PUT", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutQuotesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutQuotesOK) + 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 putQuotes: 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/ops/ops_client/tax/post_taxes_invoices_parameters.go b/api/ops/ops_client/tax/post_taxes_invoices_parameters.go new file mode 100644 index 0000000..935a421 --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_invoices_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostTaxesInvoicesParams creates a new PostTaxesInvoicesParams object +// with the default values initialized. +func NewPostTaxesInvoicesParams() *PostTaxesInvoicesParams { + var () + return &PostTaxesInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxesInvoicesParamsWithTimeout creates a new PostTaxesInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxesInvoicesParamsWithTimeout(timeout time.Duration) *PostTaxesInvoicesParams { + var () + return &PostTaxesInvoicesParams{ + + timeout: timeout, + } +} + +// NewPostTaxesInvoicesParamsWithContext creates a new PostTaxesInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxesInvoicesParamsWithContext(ctx context.Context) *PostTaxesInvoicesParams { + var () + return &PostTaxesInvoicesParams{ + + Context: ctx, + } +} + +// NewPostTaxesInvoicesParamsWithHTTPClient creates a new PostTaxesInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxesInvoicesParamsWithHTTPClient(client *http.Client) *PostTaxesInvoicesParams { + var () + return &PostTaxesInvoicesParams{ + HTTPClient: client, + } +} + +/*PostTaxesInvoicesParams contains all the parameters to send to the API endpoint +for the post taxes invoices operation typically these are written to a http.Request +*/ +type PostTaxesInvoicesParams struct { + + /*InvoiceRequest + A request with an array of Invoice Objects + + */ + InvoiceRequest *ops_models.InvoiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post taxes invoices params +func (o *PostTaxesInvoicesParams) WithTimeout(timeout time.Duration) *PostTaxesInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post taxes invoices params +func (o *PostTaxesInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post taxes invoices params +func (o *PostTaxesInvoicesParams) WithContext(ctx context.Context) *PostTaxesInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post taxes invoices params +func (o *PostTaxesInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post taxes invoices params +func (o *PostTaxesInvoicesParams) WithHTTPClient(client *http.Client) *PostTaxesInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post taxes invoices params +func (o *PostTaxesInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceRequest adds the invoiceRequest to the post taxes invoices params +func (o *PostTaxesInvoicesParams) WithInvoiceRequest(invoiceRequest *ops_models.InvoiceRequest) *PostTaxesInvoicesParams { + o.SetInvoiceRequest(invoiceRequest) + return o +} + +// SetInvoiceRequest adds the invoiceRequest to the post taxes invoices params +func (o *PostTaxesInvoicesParams) SetInvoiceRequest(invoiceRequest *ops_models.InvoiceRequest) { + o.InvoiceRequest = invoiceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxesInvoicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.InvoiceRequest != nil { + if err := r.SetBodyParam(o.InvoiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/tax/post_taxes_invoices_responses.go b/api/ops/ops_client/tax/post_taxes_invoices_responses.go new file mode 100644 index 0000000..530cfb5 --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_invoices_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostTaxesInvoicesReader is a Reader for the PostTaxesInvoices structure. +type PostTaxesInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxesInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxesInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxesInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxesInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxesInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTaxesInvoicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxesInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxesInvoicesOK creates a PostTaxesInvoicesOK with default headers values +func NewPostTaxesInvoicesOK() *PostTaxesInvoicesOK { + return &PostTaxesInvoicesOK{} +} + +/*PostTaxesInvoicesOK handles this case with default header values. + +Taxnexus Response with Tax Transaction Objects +*/ +type PostTaxesInvoicesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.TaxTransactionResponse +} + +func (o *PostTaxesInvoicesOK) Error() string { + return fmt.Sprintf("[POST /taxes/invoices][%d] postTaxesInvoicesOK %+v", 200, o.Payload) +} + +func (o *PostTaxesInvoicesOK) GetPayload() *ops_models.TaxTransactionResponse { + return o.Payload +} + +func (o *PostTaxesInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.TaxTransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesInvoicesUnauthorized creates a PostTaxesInvoicesUnauthorized with default headers values +func NewPostTaxesInvoicesUnauthorized() *PostTaxesInvoicesUnauthorized { + return &PostTaxesInvoicesUnauthorized{} +} + +/*PostTaxesInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostTaxesInvoicesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxes/invoices][%d] postTaxesInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxesInvoicesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesInvoicesForbidden creates a PostTaxesInvoicesForbidden with default headers values +func NewPostTaxesInvoicesForbidden() *PostTaxesInvoicesForbidden { + return &PostTaxesInvoicesForbidden{} +} + +/*PostTaxesInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxesInvoicesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesInvoicesForbidden) Error() string { + return fmt.Sprintf("[POST /taxes/invoices][%d] postTaxesInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxesInvoicesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesInvoicesNotFound creates a PostTaxesInvoicesNotFound with default headers values +func NewPostTaxesInvoicesNotFound() *PostTaxesInvoicesNotFound { + return &PostTaxesInvoicesNotFound{} +} + +/*PostTaxesInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxesInvoicesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesInvoicesNotFound) Error() string { + return fmt.Sprintf("[POST /taxes/invoices][%d] postTaxesInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxesInvoicesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesInvoicesUnprocessableEntity creates a PostTaxesInvoicesUnprocessableEntity with default headers values +func NewPostTaxesInvoicesUnprocessableEntity() *PostTaxesInvoicesUnprocessableEntity { + return &PostTaxesInvoicesUnprocessableEntity{} +} + +/*PostTaxesInvoicesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTaxesInvoicesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesInvoicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /taxes/invoices][%d] postTaxesInvoicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTaxesInvoicesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesInvoicesInternalServerError creates a PostTaxesInvoicesInternalServerError with default headers values +func NewPostTaxesInvoicesInternalServerError() *PostTaxesInvoicesInternalServerError { + return &PostTaxesInvoicesInternalServerError{} +} + +/*PostTaxesInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxesInvoicesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxes/invoices][%d] postTaxesInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxesInvoicesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/tax/post_taxes_orders_parameters.go b/api/ops/ops_client/tax/post_taxes_orders_parameters.go new file mode 100644 index 0000000..187052d --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_orders_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostTaxesOrdersParams creates a new PostTaxesOrdersParams object +// with the default values initialized. +func NewPostTaxesOrdersParams() *PostTaxesOrdersParams { + var () + return &PostTaxesOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxesOrdersParamsWithTimeout creates a new PostTaxesOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxesOrdersParamsWithTimeout(timeout time.Duration) *PostTaxesOrdersParams { + var () + return &PostTaxesOrdersParams{ + + timeout: timeout, + } +} + +// NewPostTaxesOrdersParamsWithContext creates a new PostTaxesOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxesOrdersParamsWithContext(ctx context.Context) *PostTaxesOrdersParams { + var () + return &PostTaxesOrdersParams{ + + Context: ctx, + } +} + +// NewPostTaxesOrdersParamsWithHTTPClient creates a new PostTaxesOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxesOrdersParamsWithHTTPClient(client *http.Client) *PostTaxesOrdersParams { + var () + return &PostTaxesOrdersParams{ + HTTPClient: client, + } +} + +/*PostTaxesOrdersParams contains all the parameters to send to the API endpoint +for the post taxes orders operation typically these are written to a http.Request +*/ +type PostTaxesOrdersParams struct { + + /*OrderRequest + A request with an array of Order Objects + + */ + OrderRequest *ops_models.OrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post taxes orders params +func (o *PostTaxesOrdersParams) WithTimeout(timeout time.Duration) *PostTaxesOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post taxes orders params +func (o *PostTaxesOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post taxes orders params +func (o *PostTaxesOrdersParams) WithContext(ctx context.Context) *PostTaxesOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post taxes orders params +func (o *PostTaxesOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post taxes orders params +func (o *PostTaxesOrdersParams) WithHTTPClient(client *http.Client) *PostTaxesOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post taxes orders params +func (o *PostTaxesOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrderRequest adds the orderRequest to the post taxes orders params +func (o *PostTaxesOrdersParams) WithOrderRequest(orderRequest *ops_models.OrderRequest) *PostTaxesOrdersParams { + o.SetOrderRequest(orderRequest) + return o +} + +// SetOrderRequest adds the orderRequest to the post taxes orders params +func (o *PostTaxesOrdersParams) SetOrderRequest(orderRequest *ops_models.OrderRequest) { + o.OrderRequest = orderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxesOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.OrderRequest != nil { + if err := r.SetBodyParam(o.OrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/tax/post_taxes_orders_responses.go b/api/ops/ops_client/tax/post_taxes_orders_responses.go new file mode 100644 index 0000000..2865ab6 --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_orders_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostTaxesOrdersReader is a Reader for the PostTaxesOrders structure. +type PostTaxesOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxesOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxesOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxesOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxesOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxesOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTaxesOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxesOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxesOrdersOK creates a PostTaxesOrdersOK with default headers values +func NewPostTaxesOrdersOK() *PostTaxesOrdersOK { + return &PostTaxesOrdersOK{} +} + +/*PostTaxesOrdersOK handles this case with default header values. + +Taxnexus Response with Tax Transaction Objects +*/ +type PostTaxesOrdersOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.TaxTransactionResponse +} + +func (o *PostTaxesOrdersOK) Error() string { + return fmt.Sprintf("[POST /taxes/orders][%d] postTaxesOrdersOK %+v", 200, o.Payload) +} + +func (o *PostTaxesOrdersOK) GetPayload() *ops_models.TaxTransactionResponse { + return o.Payload +} + +func (o *PostTaxesOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.TaxTransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesOrdersUnauthorized creates a PostTaxesOrdersUnauthorized with default headers values +func NewPostTaxesOrdersUnauthorized() *PostTaxesOrdersUnauthorized { + return &PostTaxesOrdersUnauthorized{} +} + +/*PostTaxesOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostTaxesOrdersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesOrdersUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxes/orders][%d] postTaxesOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxesOrdersUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesOrdersForbidden creates a PostTaxesOrdersForbidden with default headers values +func NewPostTaxesOrdersForbidden() *PostTaxesOrdersForbidden { + return &PostTaxesOrdersForbidden{} +} + +/*PostTaxesOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxesOrdersForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesOrdersForbidden) Error() string { + return fmt.Sprintf("[POST /taxes/orders][%d] postTaxesOrdersForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxesOrdersForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesOrdersNotFound creates a PostTaxesOrdersNotFound with default headers values +func NewPostTaxesOrdersNotFound() *PostTaxesOrdersNotFound { + return &PostTaxesOrdersNotFound{} +} + +/*PostTaxesOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxesOrdersNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesOrdersNotFound) Error() string { + return fmt.Sprintf("[POST /taxes/orders][%d] postTaxesOrdersNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxesOrdersNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesOrdersUnprocessableEntity creates a PostTaxesOrdersUnprocessableEntity with default headers values +func NewPostTaxesOrdersUnprocessableEntity() *PostTaxesOrdersUnprocessableEntity { + return &PostTaxesOrdersUnprocessableEntity{} +} + +/*PostTaxesOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTaxesOrdersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /taxes/orders][%d] postTaxesOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTaxesOrdersUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesOrdersInternalServerError creates a PostTaxesOrdersInternalServerError with default headers values +func NewPostTaxesOrdersInternalServerError() *PostTaxesOrdersInternalServerError { + return &PostTaxesOrdersInternalServerError{} +} + +/*PostTaxesOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxesOrdersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesOrdersInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxes/orders][%d] postTaxesOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxesOrdersInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/tax/post_taxes_pos_parameters.go b/api/ops/ops_client/tax/post_taxes_pos_parameters.go new file mode 100644 index 0000000..3e12fab --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_pos_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostTaxesPosParams creates a new PostTaxesPosParams object +// with the default values initialized. +func NewPostTaxesPosParams() *PostTaxesPosParams { + var () + return &PostTaxesPosParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxesPosParamsWithTimeout creates a new PostTaxesPosParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxesPosParamsWithTimeout(timeout time.Duration) *PostTaxesPosParams { + var () + return &PostTaxesPosParams{ + + timeout: timeout, + } +} + +// NewPostTaxesPosParamsWithContext creates a new PostTaxesPosParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxesPosParamsWithContext(ctx context.Context) *PostTaxesPosParams { + var () + return &PostTaxesPosParams{ + + Context: ctx, + } +} + +// NewPostTaxesPosParamsWithHTTPClient creates a new PostTaxesPosParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxesPosParamsWithHTTPClient(client *http.Client) *PostTaxesPosParams { + var () + return &PostTaxesPosParams{ + HTTPClient: client, + } +} + +/*PostTaxesPosParams contains all the parameters to send to the API endpoint +for the post taxes pos operation typically these are written to a http.Request +*/ +type PostTaxesPosParams struct { + + /*PurchaseOrderRequest + A request with an array of Purchase Order Objects + + */ + PurchaseOrderRequest *ops_models.PurchaseOrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post taxes pos params +func (o *PostTaxesPosParams) WithTimeout(timeout time.Duration) *PostTaxesPosParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post taxes pos params +func (o *PostTaxesPosParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post taxes pos params +func (o *PostTaxesPosParams) WithContext(ctx context.Context) *PostTaxesPosParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post taxes pos params +func (o *PostTaxesPosParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post taxes pos params +func (o *PostTaxesPosParams) WithHTTPClient(client *http.Client) *PostTaxesPosParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post taxes pos params +func (o *PostTaxesPosParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPurchaseOrderRequest adds the purchaseOrderRequest to the post taxes pos params +func (o *PostTaxesPosParams) WithPurchaseOrderRequest(purchaseOrderRequest *ops_models.PurchaseOrderRequest) *PostTaxesPosParams { + o.SetPurchaseOrderRequest(purchaseOrderRequest) + return o +} + +// SetPurchaseOrderRequest adds the purchaseOrderRequest to the post taxes pos params +func (o *PostTaxesPosParams) SetPurchaseOrderRequest(purchaseOrderRequest *ops_models.PurchaseOrderRequest) { + o.PurchaseOrderRequest = purchaseOrderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxesPosParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PurchaseOrderRequest != nil { + if err := r.SetBodyParam(o.PurchaseOrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/tax/post_taxes_pos_responses.go b/api/ops/ops_client/tax/post_taxes_pos_responses.go new file mode 100644 index 0000000..9d335f4 --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_pos_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostTaxesPosReader is a Reader for the PostTaxesPos structure. +type PostTaxesPosReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxesPosReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxesPosOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxesPosUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxesPosForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxesPosNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTaxesPosUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxesPosInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxesPosOK creates a PostTaxesPosOK with default headers values +func NewPostTaxesPosOK() *PostTaxesPosOK { + return &PostTaxesPosOK{} +} + +/*PostTaxesPosOK handles this case with default header values. + +Taxnexus Response with Tax Transaction Objects +*/ +type PostTaxesPosOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.TaxTransactionResponse +} + +func (o *PostTaxesPosOK) Error() string { + return fmt.Sprintf("[POST /taxes/pos][%d] postTaxesPosOK %+v", 200, o.Payload) +} + +func (o *PostTaxesPosOK) GetPayload() *ops_models.TaxTransactionResponse { + return o.Payload +} + +func (o *PostTaxesPosOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.TaxTransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesPosUnauthorized creates a PostTaxesPosUnauthorized with default headers values +func NewPostTaxesPosUnauthorized() *PostTaxesPosUnauthorized { + return &PostTaxesPosUnauthorized{} +} + +/*PostTaxesPosUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostTaxesPosUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesPosUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxes/pos][%d] postTaxesPosUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxesPosUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesPosUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesPosForbidden creates a PostTaxesPosForbidden with default headers values +func NewPostTaxesPosForbidden() *PostTaxesPosForbidden { + return &PostTaxesPosForbidden{} +} + +/*PostTaxesPosForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxesPosForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesPosForbidden) Error() string { + return fmt.Sprintf("[POST /taxes/pos][%d] postTaxesPosForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxesPosForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesPosForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesPosNotFound creates a PostTaxesPosNotFound with default headers values +func NewPostTaxesPosNotFound() *PostTaxesPosNotFound { + return &PostTaxesPosNotFound{} +} + +/*PostTaxesPosNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxesPosNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesPosNotFound) Error() string { + return fmt.Sprintf("[POST /taxes/pos][%d] postTaxesPosNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxesPosNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesPosNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesPosUnprocessableEntity creates a PostTaxesPosUnprocessableEntity with default headers values +func NewPostTaxesPosUnprocessableEntity() *PostTaxesPosUnprocessableEntity { + return &PostTaxesPosUnprocessableEntity{} +} + +/*PostTaxesPosUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTaxesPosUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesPosUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /taxes/pos][%d] postTaxesPosUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTaxesPosUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesPosUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesPosInternalServerError creates a PostTaxesPosInternalServerError with default headers values +func NewPostTaxesPosInternalServerError() *PostTaxesPosInternalServerError { + return &PostTaxesPosInternalServerError{} +} + +/*PostTaxesPosInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxesPosInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesPosInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxes/pos][%d] postTaxesPosInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxesPosInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesPosInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/tax/post_taxes_quotes_parameters.go b/api/ops/ops_client/tax/post_taxes_quotes_parameters.go new file mode 100644 index 0000000..20e01a0 --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_quotes_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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/taxnexus/go/lib/api/ops/ops_models" +) + +// NewPostTaxesQuotesParams creates a new PostTaxesQuotesParams object +// with the default values initialized. +func NewPostTaxesQuotesParams() *PostTaxesQuotesParams { + var () + return &PostTaxesQuotesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxesQuotesParamsWithTimeout creates a new PostTaxesQuotesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxesQuotesParamsWithTimeout(timeout time.Duration) *PostTaxesQuotesParams { + var () + return &PostTaxesQuotesParams{ + + timeout: timeout, + } +} + +// NewPostTaxesQuotesParamsWithContext creates a new PostTaxesQuotesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxesQuotesParamsWithContext(ctx context.Context) *PostTaxesQuotesParams { + var () + return &PostTaxesQuotesParams{ + + Context: ctx, + } +} + +// NewPostTaxesQuotesParamsWithHTTPClient creates a new PostTaxesQuotesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxesQuotesParamsWithHTTPClient(client *http.Client) *PostTaxesQuotesParams { + var () + return &PostTaxesQuotesParams{ + HTTPClient: client, + } +} + +/*PostTaxesQuotesParams contains all the parameters to send to the API endpoint +for the post taxes quotes operation typically these are written to a http.Request +*/ +type PostTaxesQuotesParams struct { + + /*QuoteRequest + A request with an array of Quote Objects + + */ + QuoteRequest *ops_models.QuoteRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post taxes quotes params +func (o *PostTaxesQuotesParams) WithTimeout(timeout time.Duration) *PostTaxesQuotesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post taxes quotes params +func (o *PostTaxesQuotesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post taxes quotes params +func (o *PostTaxesQuotesParams) WithContext(ctx context.Context) *PostTaxesQuotesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post taxes quotes params +func (o *PostTaxesQuotesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post taxes quotes params +func (o *PostTaxesQuotesParams) WithHTTPClient(client *http.Client) *PostTaxesQuotesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post taxes quotes params +func (o *PostTaxesQuotesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQuoteRequest adds the quoteRequest to the post taxes quotes params +func (o *PostTaxesQuotesParams) WithQuoteRequest(quoteRequest *ops_models.QuoteRequest) *PostTaxesQuotesParams { + o.SetQuoteRequest(quoteRequest) + return o +} + +// SetQuoteRequest adds the quoteRequest to the post taxes quotes params +func (o *PostTaxesQuotesParams) SetQuoteRequest(quoteRequest *ops_models.QuoteRequest) { + o.QuoteRequest = quoteRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxesQuotesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.QuoteRequest != nil { + if err := r.SetBodyParam(o.QuoteRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/ops/ops_client/tax/post_taxes_quotes_responses.go b/api/ops/ops_client/tax/post_taxes_quotes_responses.go new file mode 100644 index 0000000..6e0efbc --- /dev/null +++ b/api/ops/ops_client/tax/post_taxes_quotes_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/ops/ops_models" +) + +// PostTaxesQuotesReader is a Reader for the PostTaxesQuotes structure. +type PostTaxesQuotesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxesQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxesQuotesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxesQuotesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxesQuotesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxesQuotesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTaxesQuotesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxesQuotesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxesQuotesOK creates a PostTaxesQuotesOK with default headers values +func NewPostTaxesQuotesOK() *PostTaxesQuotesOK { + return &PostTaxesQuotesOK{} +} + +/*PostTaxesQuotesOK handles this case with default header values. + +Taxnexus Response with Tax Transaction Objects +*/ +type PostTaxesQuotesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *ops_models.TaxTransactionResponse +} + +func (o *PostTaxesQuotesOK) Error() string { + return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesOK %+v", 200, o.Payload) +} + +func (o *PostTaxesQuotesOK) GetPayload() *ops_models.TaxTransactionResponse { + return o.Payload +} + +func (o *PostTaxesQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(ops_models.TaxTransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesQuotesUnauthorized creates a PostTaxesQuotesUnauthorized with default headers values +func NewPostTaxesQuotesUnauthorized() *PostTaxesQuotesUnauthorized { + return &PostTaxesQuotesUnauthorized{} +} + +/*PostTaxesQuotesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostTaxesQuotesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesQuotesUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxesQuotesUnauthorized) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesQuotesForbidden creates a PostTaxesQuotesForbidden with default headers values +func NewPostTaxesQuotesForbidden() *PostTaxesQuotesForbidden { + return &PostTaxesQuotesForbidden{} +} + +/*PostTaxesQuotesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxesQuotesForbidden struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesQuotesForbidden) Error() string { + return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxesQuotesForbidden) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesQuotesNotFound creates a PostTaxesQuotesNotFound with default headers values +func NewPostTaxesQuotesNotFound() *PostTaxesQuotesNotFound { + return &PostTaxesQuotesNotFound{} +} + +/*PostTaxesQuotesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxesQuotesNotFound struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesQuotesNotFound) Error() string { + return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxesQuotesNotFound) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesQuotesUnprocessableEntity creates a PostTaxesQuotesUnprocessableEntity with default headers values +func NewPostTaxesQuotesUnprocessableEntity() *PostTaxesQuotesUnprocessableEntity { + return &PostTaxesQuotesUnprocessableEntity{} +} + +/*PostTaxesQuotesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTaxesQuotesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesQuotesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTaxesQuotesUnprocessableEntity) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesQuotesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxesQuotesInternalServerError creates a PostTaxesQuotesInternalServerError with default headers values +func NewPostTaxesQuotesInternalServerError() *PostTaxesQuotesInternalServerError { + return &PostTaxesQuotesInternalServerError{} +} + +/*PostTaxesQuotesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxesQuotesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *ops_models.Error +} + +func (o *PostTaxesQuotesInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxes/quotes][%d] postTaxesQuotesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxesQuotesInternalServerError) GetPayload() *ops_models.Error { + return o.Payload +} + +func (o *PostTaxesQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(ops_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/ops/ops_client/tax/tax_client.go b/api/ops/ops_client/tax/tax_client.go new file mode 100644 index 0000000..df5726f --- /dev/null +++ b/api/ops/ops_client/tax/tax_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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 tax API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + PostTaxesInvoices(params *PostTaxesInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesInvoicesOK, error) + + PostTaxesOrders(params *PostTaxesOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesOrdersOK, error) + + PostTaxesPos(params *PostTaxesPosParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesPosOK, error) + + PostTaxesQuotes(params *PostTaxesQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesQuotesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PostTaxesInvoices rates a list of invoices + + Rate a list of invoices +*/ +func (a *Client) PostTaxesInvoices(params *PostTaxesInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxesInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxesInvoices", + Method: "POST", + PathPattern: "/taxes/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxesInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxesInvoicesOK) + 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 postTaxesInvoices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTaxesOrders rates a list of orders + + Rate a list of invoices +*/ +func (a *Client) PostTaxesOrders(params *PostTaxesOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxesOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxesOrders", + Method: "POST", + PathPattern: "/taxes/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxesOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxesOrdersOK) + 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 postTaxesOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTaxesPos rates a list of purchase orders + + Rate a list of purchase orders +*/ +func (a *Client) PostTaxesPos(params *PostTaxesPosParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesPosOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxesPosParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxesPos", + Method: "POST", + PathPattern: "/taxes/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxesPosReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxesPosOK) + 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 postTaxesPos: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTaxesQuotes rates a list of quotes + + Rate a list of quotes +*/ +func (a *Client) PostTaxesQuotes(params *PostTaxesQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxesQuotesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxesQuotesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxesQuotes", + Method: "POST", + PathPattern: "/taxes/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxesQuotesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxesQuotesOK) + 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 postTaxesQuotes: 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/ops/ops_models/address.go b/api/ops/ops_models/address.go new file mode 100644 index 0000000..79f5113 --- /dev/null +++ b/api/ops/ops_models/address.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/ops/ops_models/cash_receipt.go b/api/ops/ops_models/cash_receipt.go new file mode 100644 index 0000000..8c561d6 --- /dev/null +++ b/api/ops/ops_models/cash_receipt.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CashReceipt cash receipt +// +// swagger:model CashReceipt +type CashReceipt struct { + + // Account Name + AccountID string `json:"AccountID,omitempty"` + + // Amount + Amount float64 `json:"Amount,omitempty"` + + // Applied Amount + AppliedAmount float64 `json:"AppliedAmount,omitempty"` + + // Attempt Number + AttemptNumber float64 `json:"AttemptNumber,omitempty"` + + // Audit Trail Message + AuditMessage string `json:"AuditMessage,omitempty"` + + // Autopay? + AutoPay bool `json:"AutoPay,omitempty"` + + // Billing Contact + BillingContactID string `json:"BillingContactID,omitempty"` + + // Journal Date + CashReceiptDate string `json:"CashReceiptDate,omitempty"` + + // Journal Date + CashReceiptNumber string `json:"CashReceiptNumber,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Memo + Description string `json:"Description,omitempty"` + + // Gateway + Gateway string `json:"Gateway,omitempty"` + + // Gateway Key + GatewayKey string `json:"GatewayKey,omitempty"` + + // Gateway Message + GatewayMessage string `json:"GatewayMessage,omitempty"` + + // GatewayTxn? + GatewayTransaction bool `json:"GatewayTransaction,omitempty"` + + // Salesforce Record Id + ID string `json:"ID,omitempty"` + + // Is Valid? + IsValid bool `json:"IsValid,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Partner Account + PartnerAccountID string `json:"PartnerAccountID,omitempty"` + + // Payment Method + PaymentMethodID string `json:"PaymentMethodID,omitempty"` + + // Payment Number + PaymentNumber string `json:"PaymentNumber,omitempty"` + + // Pending? + Pending bool `json:"Pending,omitempty"` + + // Period + PeriodID string `json:"PeriodID,omitempty"` + + // Posted to external system? + Posted bool `json:"Posted,omitempty"` + + // Processed + Processed bool `json:"Processed,omitempty"` + + // Processing + Processing bool `json:"Processing,omitempty"` + + // Record Type + RecordTypeID string `json:"RecordTypeID,omitempty"` + + // Reference + Ref string `json:"Ref,omitempty"` + + // Reference Number + ReferenceNumber string `json:"ReferenceNumber,omitempty"` + + // Rejected? + Rejected bool `json:"Rejected,omitempty"` + + // Source Payment Method + Source string `json:"Source,omitempty"` + + // Payment Status + Status string `json:"Status,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // Unapplied Amount + UnappliedAmount float64 `json:"UnappliedAmount,omitempty"` + + // Valid Payment? + ValidPayment bool `json:"ValidPayment,omitempty"` + + // Xero Credit Note Id + XeroID string `json:"XeroID,omitempty"` +} + +// Validate validates this cash receipt +func (m *CashReceipt) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CashReceipt) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CashReceipt) UnmarshalBinary(b []byte) error { + var res CashReceipt + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/cash_receipt_request.go b/api/ops/ops_models/cash_receipt_request.go new file mode 100644 index 0000000..51aa858 --- /dev/null +++ b/api/ops/ops_models/cash_receipt_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CashReceiptRequest cash receipt request +// +// swagger:model CashReceiptRequest +type CashReceiptRequest struct { + + // data + Data []*CashReceipt `json:"Data"` +} + +// Validate validates this cash receipt request +func (m *CashReceiptRequest) 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 *CashReceiptRequest) 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 +} + +// MarshalBinary interface implementation +func (m *CashReceiptRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CashReceiptRequest) UnmarshalBinary(b []byte) error { + var res CashReceiptRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/cash_receipt_response.go b/api/ops/ops_models/cash_receipt_response.go new file mode 100644 index 0000000..37baef8 --- /dev/null +++ b/api/ops/ops_models/cash_receipt_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CashReceiptResponse An array of Account objects with Contacts +// +// swagger:model CashReceiptResponse +type CashReceiptResponse struct { + + // data + Data []*CashReceipt `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this cash receipt response +func (m *CashReceiptResponse) 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 *CashReceiptResponse) 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 *CashReceiptResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CashReceiptResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CashReceiptResponse) UnmarshalBinary(b []byte) error { + var res CashReceiptResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/charge.go b/api/ops/ops_models/charge.go new file mode 100644 index 0000000..eb6a46f --- /dev/null +++ b/api/ops/ops_models/charge.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Charge charge +// +// swagger:model Charge +type Charge struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Amount + Amount float64 `json:"Amount,omitempty"` + + // Billing Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // Contract + ContractID string `json:"ContractID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Email Message + EmailMessage string `json:"EmailMessage,omitempty"` + + // External Message + ExternalMessage string `json:"ExternalMessage,omitempty"` + + // Salesforce Record Id + ID string `json:"ID,omitempty"` + + // Journal Date + JournalDate string `json:"JournalDate,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Partner Account + PartnerAccountID string `json:"PartnerAccountID,omitempty"` + + // Payment Terms + PaymentTerms string `json:"PaymentTerms,omitempty"` + + // Period + PeriodID string `json:"PeriodID,omitempty"` + + // Posted to external system? + Posted bool `json:"Posted,omitempty"` + + // Product + ProductID string `json:"ProductID,omitempty"` + + // Quantity + Quantity float64 `json:"Quantity,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Unit Price + UnitPrice float64 `json:"UnitPrice,omitempty"` +} + +// Validate validates this charge +func (m *Charge) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Charge) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Charge) UnmarshalBinary(b []byte) error { + var res Charge + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/charge_request.go b/api/ops/ops_models/charge_request.go new file mode 100644 index 0000000..df1c8a8 --- /dev/null +++ b/api/ops/ops_models/charge_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ChargeRequest charge request +// +// swagger:model ChargeRequest +type ChargeRequest struct { + + // data + Data []*Charge `json:"Data"` +} + +// Validate validates this charge request +func (m *ChargeRequest) 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 *ChargeRequest) 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 +} + +// MarshalBinary interface implementation +func (m *ChargeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ChargeRequest) UnmarshalBinary(b []byte) error { + var res ChargeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/charge_response.go b/api/ops/ops_models/charge_response.go new file mode 100644 index 0000000..760e69e --- /dev/null +++ b/api/ops/ops_models/charge_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ChargeResponse An array of ChargeObject objects +// +// swagger:model ChargeResponse +type ChargeResponse struct { + + // data + Data []*Charge `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this charge response +func (m *ChargeResponse) 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 *ChargeResponse) 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 *ChargeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *ChargeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ChargeResponse) UnmarshalBinary(b []byte) error { + var res ChargeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/contract.go b/api/ops/ops_models/contract.go new file mode 100644 index 0000000..12f3cd4 --- /dev/null +++ b/api/ops/ops_models/contract.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Contract contract +// +// swagger:model Contract +type Contract struct { + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Contract End Date + EndDate string `json:"EndDate,omitempty"` + + // Hourly Rate + HourlyRate float64 `json:"HourlyRate,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Is Active? + IsActive bool `json:"IsActive,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Contract Name + Name string `json:"Name,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Payment Terms + PaymentTerms string `json:"PaymentTerms,omitempty"` + + // Price Book + PriceBookID string `json:"PriceBookID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Contract Start Date + StartDate string `json:"StartDate,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Contract Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this contract +func (m *Contract) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Contract) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Contract) UnmarshalBinary(b []byte) error { + var res Contract + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/credit_card.go b/api/ops/ops_models/credit_card.go new file mode 100644 index 0000000..7403b95 --- /dev/null +++ b/api/ops/ops_models/credit_card.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreditCard credit card +// +// swagger:model CreditCard +type CreditCard struct { + + // Active + Active bool `json:"Active,omitempty"` + + // Billing City + BillingCity string `json:"BillingCity,omitempty"` + + // Billing Postal Code + BillingPostalcode string `json:"BillingPostalcode,omitempty"` + + // Billing State + BillingState string `json:"BillingState,omitempty"` + + // Billing Street + BillingStreet string `json:"BillingStreet,omitempty"` + + // CC Type + CCType string `json:"CCType,omitempty"` + + // CC Number + CcNumber string `json:"CcNumber,omitempty"` + + // Company + CompanyID string `json:"CompanyID,omitempty"` + + // Exp Month + ExpMonth string `json:"ExpMonth,omitempty"` + + // Exp Year + ExpYear string `json:"ExpYear,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // CC Name + Name string `json:"Name,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this credit card +func (m *CreditCard) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreditCard) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreditCard) UnmarshalBinary(b []byte) error { + var res CreditCard + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/delete_response.go b/api/ops/ops_models/delete_response.go new file mode 100644 index 0000000..dc356b3 --- /dev/null +++ b/api/ops/ops_models/delete_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/ops/ops_models/eft.go b/api/ops/ops_models/eft.go new file mode 100644 index 0000000..554ed55 --- /dev/null +++ b/api/ops/ops_models/eft.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Eft A group of Electronic Fund Transfer Items posted to a payment gateway +// +// swagger:model Eft +type Eft struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Amount + Amount float64 `json:"Amount,omitempty"` + + // Attempt Number + AttemptNumber float64 `json:"AttemptNumber,omitempty"` + + // Backend + BackendID string `json:"BackendID,omitempty"` + + // Billing Run + BillingRunID string `json:"BillingRunID,omitempty"` + + // Cash Receipt + CashReceiptID string `json:"CashReceiptID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Executed At + Executed string `json:"Executed,omitempty"` + + // Fee + Fee float64 `json:"Fee,omitempty"` + + // Gateway + Gateway string `json:"Gateway,omitempty"` + + // Gateway Key + GatewayKey string `json:"GatewayKey,omitempty"` + + // Gateway Message + GatewayMessage string `json:"GatewayMessage,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // The items associated with this EFT + Items []*EftItem `json:"Items"` + + // Journal Date + JournalDate string `json:"JournalDate,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Parent Foreign Key + ParentFK string `json:"ParentFK,omitempty"` + + // Payment Method + PaymentMethodID string `json:"PaymentMethodID,omitempty"` + + // External Reference + Ref string `json:"Ref,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Transaction ID + TransactionID string `json:"TransactionID,omitempty"` + + // UUID + UUID string `json:"UUID,omitempty"` +} + +// Validate validates this eft +func (m *Eft) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Eft) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Eft) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Eft) UnmarshalBinary(b []byte) error { + var res Eft + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/eft_item.go b/api/ops/ops_models/eft_item.go new file mode 100644 index 0000000..db2b4ad --- /dev/null +++ b/api/ops/ops_models/eft_item.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EftItem An invoice reference that is batched in a single Eft +// +// swagger:model EftItem +type EftItem struct { + + // Amount + Amount float64 `json:"Amount,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // EFT + EftID string `json:"EftID,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Invoice + InvoiceID string `json:"InvoiceID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this eft item +func (m *EftItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EftItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EftItem) UnmarshalBinary(b []byte) error { + var res EftItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/eft_request.go b/api/ops/ops_models/eft_request.go new file mode 100644 index 0000000..4cd5445 --- /dev/null +++ b/api/ops/ops_models/eft_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EftRequest eft request +// +// swagger:model EftRequest +type EftRequest struct { + + // data + Data []*Eft `json:"Data"` +} + +// Validate validates this eft request +func (m *EftRequest) 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 *EftRequest) 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 +} + +// MarshalBinary interface implementation +func (m *EftRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EftRequest) UnmarshalBinary(b []byte) error { + var res EftRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/eft_response.go b/api/ops/ops_models/eft_response.go new file mode 100644 index 0000000..be69d93 --- /dev/null +++ b/api/ops/ops_models/eft_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EftResponse eft response +// +// swagger:model EftResponse +type EftResponse struct { + + // data + Data []*Eft `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this eft response +func (m *EftResponse) 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 *EftResponse) 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 *EftResponse) 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 +} + +// MarshalBinary interface implementation +func (m *EftResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EftResponse) UnmarshalBinary(b []byte) error { + var res EftResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/error.go b/api/ops/ops_models/error.go new file mode 100644 index 0000000..108c7cb --- /dev/null +++ b/api/ops/ops_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/ops/ops_models/invalid_error.go b/api/ops/ops_models/invalid_error.go new file mode 100644 index 0000000..0a01f18 --- /dev/null +++ b/api/ops/ops_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/ops/ops_models/invoice.go b/api/ops/ops_models/invoice.go new file mode 100644 index 0000000..0a94dd3 --- /dev/null +++ b/api/ops/ops_models/invoice.go @@ -0,0 +1,474 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Invoice invoice +// +// swagger:model Invoice +type Invoice struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Advance? + Advance bool `json:"Advance,omitempty"` + + // Invoice Amount + Amount float64 `json:"Amount,omitempty"` + + // Amount Adjustment + AmountAdjustment float64 `json:"AmountAdjustment,omitempty"` + + // Amount Due + AmountDue float64 `json:"AmountDue,omitempty"` + + // Amount Paid + AmountPaid float64 `json:"AmountPaid,omitempty"` + + // Audit Trail Message + AuditMessage string `json:"AuditMessage,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // Billing Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // Billing Run + BillingRunID string `json:"BillingRunID,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // The amount of Deferred Tax incurred with this invoice + BusinessTax float64 `json:"BusinessTax,omitempty"` + + // Cannabis Tax + CannabisTax float64 `json:"CannabisTax,omitempty"` + + // Contract + ContractID string `json:"ContractID,omitempty"` + + // The ID of the Coordinate used to rate this item + CoordinateID string `json:"CoordinateID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Customer ID + CustomerID string `json:"CustomerID,omitempty"` + + // Date Issued + DateIssued string `json:"DateIssued,omitempty"` + + // Days Due + DaysDue int64 `json:"DaysDue,omitempty"` + + // Deposit Amount + DepositAmount float64 `json:"DepositAmount,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Discount + Discount float64 `json:"Discount,omitempty"` + + // Invoice Total from source system + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // Invoice Total from source system + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // Invoice Total from source system + EstimatedCOGS float64 `json:"EstimatedCOGS,omitempty"` + + // Cannabis Tax from source system + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // Cannabis Tax from source system + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // Sales Tax from source system + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // Invoice Subtotal from source system + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // ID of the Ingest which created this Invoice + IngestID string `json:"IngestID,omitempty"` + + // Invoice Date + InvoiceDate string `json:"InvoiceDate,omitempty"` + + // Invoice Number + InvoiceNumber string `json:"InvoiceNumber,omitempty"` + + // Is International? + IsInternational bool `json:"IsInternational,omitempty"` + + // Is Valid? + IsValid bool `json:"IsValid,omitempty"` + + // Issued Account Balance + IssuedAccountBalance float64 `json:"IssuedAccountBalance,omitempty"` + + // Issued Amount Due + IssuedAmountDue float64 `json:"IssuedAmountDue,omitempty"` + + // Issued By + IssuedByID string `json:"IssuedByID,omitempty"` + + // The items associated with this Invoice + Items []*InvoiceItem `json:"Items"` + + // ID of the Job which created this Invoice + JobID string `json:"JobID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Minimum Payment Due + MinimumPaymentDue float64 `json:"MinimumPaymentDue,omitempty"` + + // Monthly Amount + MonthlyAmount float64 `json:"MonthlyAmount,omitempty"` + + // Opportunity + OpportunityID string `json:"OpportunityID,omitempty"` + + // Order + OrderID string `json:"OrderID,omitempty"` + + // Overdue0 + OverDue0 float64 `json:"OverDue0,omitempty"` + + // Overdue 120 Days Amount + OverDue120 float64 `json:"OverDue120,omitempty"` + + // Overdue 30 Days Amount + OverDue30 float64 `json:"OverDue30,omitempty"` + + // Overdue 45 Days Amount + OverDue45 float64 `json:"OverDue45,omitempty"` + + // Overdue 60 Days Amount + OverDue60 float64 `json:"OverDue60,omitempty"` + + // Overdue 90 Days Amount + OverDue90 float64 `json:"OverDue90,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Partner Account + PartnerAccountID string `json:"PartnerAccountID,omitempty"` + + // Payment Due + PaymentDue string `json:"PaymentDue,omitempty"` + + // Payment Method + PaymentMethod string `json:"PaymentMethod,omitempty"` + + // Payment Method + PaymentMethodID string `json:"PaymentMethodID,omitempty"` + + // Payment Terms + PaymentTerms string `json:"PaymentTerms,omitempty"` + + // Period + PeriodID string `json:"PeriodID,omitempty"` + + // The Taxnexus Geocode of the Place used for Situs + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // Posted to external system? + Posted bool `json:"Posted,omitempty"` + + // Prior Account Balance + PriorAccountBalance float64 `json:"PriorAccountBalance,omitempty"` + + // Prior Adjustments + PriorAdjustments float64 `json:"PriorAdjustments,omitempty"` + + // Prior Invoice Amount + PriorInvoiceAmount float64 `json:"PriorInvoiceAmount,omitempty"` + + // Prior Invoice Date + PriorInvoiceDate string `json:"PriorInvoiceDate,omitempty"` + + // Prior Invoice + PriorInvoiceID string `json:"PriorInvoiceID,omitempty"` + + // Prior Payment Amount + PriorPaymentAmount float64 `json:"PriorPaymentAmount,omitempty"` + + // Prior Payment Date + PriorPaymentDate string `json:"PriorPaymentDate,omitempty"` + + // Prior Payment + PriorPaymentID string `json:"PriorPaymentID,omitempty"` + + // Prior Payment Memo + PriorPaymentMemo string `json:"PriorPaymentMemo,omitempty"` + + // Prorated? + Prorated bool `json:"Prorated,omitempty"` + + // Prorated Days + ProtratedDays float64 `json:"ProtratedDays,omitempty"` + + // Purchase Amount + PurchaseAmount float64 `json:"PurchaseAmount,omitempty"` + + // Quote + QuoteID string `json:"QuoteID,omitempty"` + + // The ID of the Rating Engine that rated this invoice + RatingEngineID string `json:"RatingEngineID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Reference + Reference string `json:"Reference,omitempty"` + + // Sales Regulation Type (Medicinal or Recreational) + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Sales Tax + SalesTax float64 `json:"SalesTax,omitempty"` + + // Scheduled Payment Date + ScheduledPaymentDate string `json:"ScheduledPaymentDate,omitempty"` + + // Service Term + ServiceTerm string `json:"ServiceTerm,omitempty"` + + // shipping address + ShippingAddress *Address `json:"ShippingAddress,omitempty"` + + // Shipping & Handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // The taxes associated with this Invoice + TaxTransactions []*TaxTransaction `json:"TaxTransactions"` + + // Telecom Tax + TelecomTax float64 `json:"TelecomTax,omitempty"` + + // Template + TemplateID string `json:"TemplateID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // total + Total *Total `json:"Total,omitempty"` + + // Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this invoice +func (m *Invoice) 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.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTransactions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Invoice) 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 *Invoice) 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 *Invoice) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Invoice) 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 +} + +func (m *Invoice) validateTaxTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTransactions) { // not required + return nil + } + + for i := 0; i < len(m.TaxTransactions); i++ { + if swag.IsZero(m.TaxTransactions[i]) { // not required + continue + } + + if m.TaxTransactions[i] != nil { + if err := m.TaxTransactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTransactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Invoice) validateTotal(formats strfmt.Registry) error { + + if swag.IsZero(m.Total) { // not required + return nil + } + + if m.Total != nil { + if err := m.Total.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Total") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Invoice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Invoice) UnmarshalBinary(b []byte) error { + var res Invoice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/invoice_basic.go b/api/ops/ops_models/invoice_basic.go new file mode 100644 index 0000000..d99ab78 --- /dev/null +++ b/api/ops/ops_models/invoice_basic.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceBasic invoice basic +// +// swagger:model InvoiceBasic +type InvoiceBasic struct { + + // Account Identifier from Source System + AccountID string `json:"AccountID,omitempty"` + + // Invoice Amount + Amount float64 `json:"Amount,omitempty"` + + // Amount Due + AmountDue float64 `json:"AmountDue,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // OEM Customer Identifier + CustomerID string `json:"CustomerID,omitempty"` + + // Invoice Total from source system + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // Business tax from source system + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // Cost of Goods Sold from source system + EstimatedCOGS float64 `json:"EstimatedCOGS,omitempty"` + + // Cannabis Tax from source system + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // Cannabis Tax from source system + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // Sales Tax from source system + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // Invoice Subtotal from source system + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // Taxnexus ID + ID string `json:"ID,omitempty"` + + // ID of the Ingest which created this Invoice + IngestID string `json:"IngestID,omitempty"` + + // Invoice Date; should be date only or correct time zone if in time notation + InvoiceDate string `json:"InvoiceDate,omitempty"` + + // Source System Customer-Facing Invoice Number; ignored in tax calculation + InvoiceNumber string `json:"InvoiceNumber,omitempty"` + + // The items associated with this Invoice + Items []*ItemBasic `json:"Items"` + + // ID of the Job which created this Invoice + JobID string `json:"JobID,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Taxnexus Period ID + PeriodID string `json:"PeriodID,omitempty"` + + // The Taxnexus Geocode of the Place used for Situs + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Shipping and Handling fees for this document + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Status used by for Billing Balances; ignored in tax calculation + Status string `json:"Status,omitempty"` + + // Subtotal of items + Subtotal float64 `json:"Subtotal,omitempty"` + + // The Tax Transactions "Source System identifier for this record, if any; copied to invoiceitemid in Tax Transaction result records" + TaxTransactions []*TaxTransaction `json:"TaxTransactions"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // total + Total *Total `json:"Total,omitempty"` + + // Invoice Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this invoice basic +func (m *InvoiceBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBusinessAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTransactions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InvoiceBasic) 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 *InvoiceBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InvoiceBasic) validateTaxTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTransactions) { // not required + return nil + } + + for i := 0; i < len(m.TaxTransactions); i++ { + if swag.IsZero(m.TaxTransactions[i]) { // not required + continue + } + + if m.TaxTransactions[i] != nil { + if err := m.TaxTransactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTransactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InvoiceBasic) validateTotal(formats strfmt.Registry) error { + + if swag.IsZero(m.Total) { // not required + return nil + } + + if m.Total != nil { + if err := m.Total.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Total") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InvoiceBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceBasic) UnmarshalBinary(b []byte) error { + var res InvoiceBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/invoice_item.go b/api/ops/ops_models/invoice_item.go new file mode 100644 index 0000000..175d499 --- /dev/null +++ b/api/ops/ops_models/invoice_item.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceItem invoice item +// +// swagger:model InvoiceItem +type InvoiceItem struct { + + // Cost of Goods Sold + COGS float64 `json:"COGS,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Line Item Description + Description string `json:"Description,omitempty"` + + // Family + Family string `json:"Family,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Invoice + InvoiceID string `json:"InvoiceID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // List Price + ListPrice float64 `json:"ListPrice,omitempty"` + + // Quantity + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // Order Item + OrderItemID string `json:"OrderItemID,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Product + ProductID string `json:"ProductID,omitempty"` + + // Quantity + Quantity float64 `json:"Quantity,omitempty"` + + // Quote Line Item + QuoteItemID string `json:"QuoteItemID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Rejected Quantity + RejectedQuantity float64 `json:"RejectedQuantity,omitempty"` + + // SKU + SKU string `json:"SKU,omitempty"` + + // Shipped Quantity + ShippedQuantity float64 `json:"ShippedQuantity,omitempty"` + + // Shipping & Handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Subscription + SubscriptionID string `json:"SubscriptionID,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // Taxnexus Code + TaxnexusCode string `json:"TaxnexusCode,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Total Price + TotalPrice float64 `json:"TotalPrice,omitempty"` + + // Unit Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // The Unit of Measure for this item + Units string `json:"Units,omitempty"` +} + +// Validate validates this invoice item +func (m *InvoiceItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InvoiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceItem) UnmarshalBinary(b []byte) error { + var res InvoiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/invoice_request.go b/api/ops/ops_models/invoice_request.go new file mode 100644 index 0000000..3009214 --- /dev/null +++ b/api/ops/ops_models/invoice_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceRequest invoice request +// +// swagger:model InvoiceRequest +type InvoiceRequest struct { + + // data + Data []*InvoiceBasic `json:"Data"` +} + +// Validate validates this invoice request +func (m *InvoiceRequest) 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 *InvoiceRequest) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceRequest) UnmarshalBinary(b []byte) error { + var res InvoiceRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/invoice_response.go b/api/ops/ops_models/invoice_response.go new file mode 100644 index 0000000..53bd3dc --- /dev/null +++ b/api/ops/ops_models/invoice_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceResponse invoice response +// +// swagger:model InvoiceResponse +type InvoiceResponse struct { + + // data + Data []*Invoice `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this invoice response +func (m *InvoiceResponse) 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 *InvoiceResponse) 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 *InvoiceResponse) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceResponse) UnmarshalBinary(b []byte) error { + var res InvoiceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/item_basic.go b/api/ops/ops_models/item_basic.go new file mode 100644 index 0000000..c280393 --- /dev/null +++ b/api/ops/ops_models/item_basic.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ItemBasic item basic +// +// swagger:model ItemBasic +type ItemBasic struct { + + // Cost of Goods Sold + COGS float64 `json:"COGS,omitempty"` + + // Line Item Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Monthly Recurring Charge Indicator + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Quantity + Quantity float64 `json:"Quantity,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Shipping & Handling and Delivery Fees for this Item + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // Taxnexus Code + TaxnexusCode string `json:"TaxnexusCode,omitempty"` + + // Unit Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // The Unit of Measure for this item + Units string `json:"Units,omitempty"` +} + +// Validate validates this item basic +func (m *ItemBasic) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ItemBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ItemBasic) UnmarshalBinary(b []byte) error { + var res ItemBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/message.go b/api/ops/ops_models/message.go new file mode 100644 index 0000000..063dac5 --- /dev/null +++ b/api/ops/ops_models/message.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/ops/ops_models/order.go b/api/ops/ops_models/order.go new file mode 100644 index 0000000..12818ad --- /dev/null +++ b/api/ops/ops_models/order.go @@ -0,0 +1,432 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Order order +// +// swagger:model Order +type Order struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Activated By ID + ActivatedByID string `json:"ActivatedByID,omitempty"` + + // Activated Date + ActivatedDate string `json:"ActivatedDate,omitempty"` + + // Order Amount + Amount float64 `json:"Amount,omitempty"` + + // Order Amount Due + AmountDue float64 `json:"AmountDue,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // Billing Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // The amount of Deferred Tax incurred with this invoice + BusinessTax float64 `json:"BusinessTax,omitempty"` + + // Cannabis Tax + CannabisTax float64 `json:"CannabisTax,omitempty"` + + // Company Authorized By + CompanyAuthorizedByID string `json:"CompanyAuthorizedByID,omitempty"` + + // Company Authorized Date + CompanyAuthorizedDate string `json:"CompanyAuthorizedDate,omitempty"` + + // Completion Status + Completion string `json:"Completion,omitempty"` + + // Contract End Date + ContractEndDate string `json:"ContractEndDate,omitempty"` + + // Contract Number + ContractID string `json:"ContractID,omitempty"` + + // The ID of the Tax Nexus Coordinate record + CoordinateID string `json:"CoordinateID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Customer Authorized By + CustomerAuthorizedBy string `json:"CustomerAuthorizedBy,omitempty"` + + // Customer Authorized Date + CustomerAuthorizedDate string `json:"CustomerAuthorizedDate,omitempty"` + + // Partner customer ID, if any + CustomerID string `json:"CustomerID,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Discount Percentage + Discount float64 `json:"Discount,omitempty"` + + // Discount Amount + DiscountAmount float64 `json:"DiscountAmount,omitempty"` + + // Order Start Date + EffectiveDate string `json:"EffectiveDate,omitempty"` + + // Order End Date + EndDate string `json:"EndDate,omitempty"` + + // End User Contact ID + EndUserID string `json:"EndUserID,omitempty"` + + // Invoice Total from source system + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // Invoice Total from source system + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // Invoice Total from source system + EstimatedCOGS float64 `json:"EstimatedCOGS,omitempty"` + + // Cannabis Tax from source system + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // Cannabis Tax from source system + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // Sales Tax from source system + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // Invoice Subtotal from source system + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // The ID of the Ingest generated by this order + IngestID string `json:"IngestID,omitempty"` + + // Installation Date + InstallationDate string `json:"InstallationDate,omitempty"` + + // Invoice ID + InvoiceID string `json:"InvoiceID,omitempty"` + + // Reduction Order + IsReductionOrder bool `json:"IsReductionOrder,omitempty"` + + // The Order Items + Items []*OrderItem `json:"Items"` + + // The ID of the Job that generated this order, if any + JobID string `json:"JobID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Monthly Amount + MonthlyAmount float64 `json:"MonthlyAmount,omitempty"` + + // Open Order? + Open bool `json:"Open,omitempty"` + + // Opportunity + OpportunityID string `json:"OpportunityID,omitempty"` + + // Order Number + OrderNumber string `json:"OrderNumber,omitempty"` + + // Order Reference Number + OrderReferenceNumber string `json:"OrderReferenceNumber,omitempty"` + + // Original Order + OriginalOrderID string `json:"OriginalOrderID,omitempty"` + + // Order Owner + OwnerID string `json:"OwnerID,omitempty"` + + // PO Date + PODate string `json:"PODate,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Payment Method ID + PaymentMethodID string `json:"PaymentMethodID,omitempty"` + + // Payment Terms + PaymentTerms string `json:"PaymentTerms,omitempty"` + + // The ID of the Period in which this Order was made + PeriodID string `json:"PeriodID,omitempty"` + + // Place GeoCode + PlaceGeoCode string `json:"PlaceGeoCode,omitempty"` + + // Posted to external system? + Posted bool `json:"Posted,omitempty"` + + // Provisioning Status + ProvisioningStatus string `json:"ProvisioningStatus,omitempty"` + + // Purchase Amount + PurchaseAmount float64 `json:"PurchaseAmount,omitempty"` + + // PO ID + PurchaseOrderID string `json:"PurchaseOrderID,omitempty"` + + // Quote + QuoteID string `json:"QuoteID,omitempty"` + + // The ID of the Rating Engine that rated this invoice + RatingEngineID string `json:"RatingEngineID,omitempty"` + + // Order Record Type + RecordTypeID string `json:"RecordTypeID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Sales Tax + SalesTax float64 `json:"SalesTax,omitempty"` + + // Service Term + ServiceTerm string `json:"ServiceTerm,omitempty"` + + // shipping address + ShippingAddress *Address `json:"ShippingAddress,omitempty"` + + // Shipping Contact ID + ShippingContactID string `json:"ShippingContactID,omitempty"` + + // Shipping & Handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // The taxes associated with this Order + TaxTransactions []*TaxTransaction `json:"TaxTransactions"` + + // Telecom Tax + TelecomTax float64 `json:"TelecomTax,omitempty"` + + // Template + TemplateID string `json:"TemplateID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // total + Total *Total `json:"Total,omitempty"` + + // Order Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this order +func (m *Order) 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.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTransactions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) 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 *Order) 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 *Order) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Order) 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 +} + +func (m *Order) validateTaxTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTransactions) { // not required + return nil + } + + for i := 0; i < len(m.TaxTransactions); i++ { + if swag.IsZero(m.TaxTransactions[i]) { // not required + continue + } + + if m.TaxTransactions[i] != nil { + if err := m.TaxTransactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTransactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Order) validateTotal(formats strfmt.Registry) error { + + if swag.IsZero(m.Total) { // not required + return nil + } + + if m.Total != nil { + if err := m.Total.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Total") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Order) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Order) UnmarshalBinary(b []byte) error { + var res Order + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/order_item.go b/api/ops/ops_models/order_item.go new file mode 100644 index 0000000..6a9b2f0 --- /dev/null +++ b/api/ops/ops_models/order_item.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OrderItem order item +// +// swagger:model OrderItem +type OrderItem struct { + + // Activated? + Activated bool `json:"Activated,omitempty"` + + // Activated By + ActiveatedByID string `json:"ActiveatedByID,omitempty"` + + // Available Quantity + AvailableQuantity float64 `json:"AvailableQuantity,omitempty"` + + // Cost of Goods Sold + COGS float64 `json:"COGS,omitempty"` + + // Create Reservation? + CreateReservation bool `json:"CreateReservation,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Date Delivered + DateDelivered string `json:"DateDelivered,omitempty"` + + // Date Ordered + DateOrdered string `json:"DateOrdered,omitempty"` + + // Date Promised + DatePromised string `json:"DatePromised,omitempty"` + + // Line Description + Description string `json:"Description,omitempty"` + + // Discount + Discount float64 `json:"Discount,omitempty"` + + // Family + Family string `json:"Family,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Invoice Item + InvoiceItemID string `json:"InvoiceItemID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // List Price + ListPrice float64 `json:"ListPrice,omitempty"` + + // Location + LocationID string `json:"LocationID,omitempty"` + + // Monthly Recurring Charge Indicator + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // Order + OrderID string `json:"OrderID,omitempty"` + + // Original Order Product + OriginalOrderItemID string `json:"OriginalOrderItemID,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Posted to external system? + Posted bool `json:"Posted,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Product + ProductID string `json:"ProductID,omitempty"` + + // Product Name + ProductName string `json:"ProductName,omitempty"` + + // Quantity + Quantity float64 `json:"Quantity,omitempty"` + + // Quantity On Hand + QuantityOnHand float64 `json:"QuantityOnHand,omitempty"` + + // Quote Line Item + QuoteItemID string `json:"QuoteItemID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Start Date + ServiceDate string `json:"ServiceDate,omitempty"` + + // Shipping & Handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Subscription + SubscriptionID string `json:"SubscriptionID,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // Taxnexus Code Display + TaxnexusCodeDisplay string `json:"TaxnexusCodeDisplay,omitempty"` + + // Taxnexus Code + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Total Price + TotalPrice float64 `json:"TotalPrice,omitempty"` + + // Unit Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // Units + Units string `json:"Units,omitempty"` +} + +// Validate validates this order item +func (m *OrderItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OrderItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderItem) UnmarshalBinary(b []byte) error { + var res OrderItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/order_request.go b/api/ops/ops_models/order_request.go new file mode 100644 index 0000000..dabf782 --- /dev/null +++ b/api/ops/ops_models/order_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OrderRequest An array of Order objects +// +// swagger:model OrderRequest +type OrderRequest struct { + + // data + Data []*Order `json:"Data"` +} + +// Validate validates this order request +func (m *OrderRequest) 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 *OrderRequest) 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 +} + +// MarshalBinary interface implementation +func (m *OrderRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderRequest) UnmarshalBinary(b []byte) error { + var res OrderRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/order_response.go b/api/ops/ops_models/order_response.go new file mode 100644 index 0000000..27d26eb --- /dev/null +++ b/api/ops/ops_models/order_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OrderResponse An array of Order objects +// +// swagger:model OrderResponse +type OrderResponse struct { + + // data + Data []*Order `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this order response +func (m *OrderResponse) 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 *OrderResponse) 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 *OrderResponse) 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 +} + +// MarshalBinary interface implementation +func (m *OrderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderResponse) UnmarshalBinary(b []byte) error { + var res OrderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/pagination.go b/api/ops/ops_models/pagination.go new file mode 100644 index 0000000..37f75f8 --- /dev/null +++ b/api/ops/ops_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // limit + Limit int64 `json:"Limit,omitempty"` + + // offset + Offset int64 `json:"Offset,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 +} + +// 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/ops/ops_models/payment_method.go b/api/ops/ops_models/payment_method.go new file mode 100644 index 0000000..7f4e7b9 --- /dev/null +++ b/api/ops/ops_models/payment_method.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentMethod Describes the EFT or other payment information for an account and billing contact +// +// swagger:model PaymentMethod +type PaymentMethod struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // ACH Account Type + AchAccountType string `json:"AchAccountType,omitempty"` + + // ACH Bank Account + AchBankAccount string `json:"AchBankAccount,omitempty"` + + // ACH Routing + AchRouting string `json:"AchRouting,omitempty"` + + // Active? + Active bool `json:"Active,omitempty"` + + // Autopay? + Autopay bool `json:"Autopay,omitempty"` + + // Bank Name + BankName string `json:"BankName,omitempty"` + + // Billing Contact + BillingContactID string `json:"BillingContactID,omitempty"` + + // Credit Card Number + CCnumber string `json:"CCnumber,omitempty"` + + // CC Type + CCtype string `json:"CCtype,omitempty"` + + // Company + CompanyID string `json:"CompanyID,omitempty"` + + // Contract + ContractID string `json:"ContractID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Default Payment Method? + Default bool `json:"Default,omitempty"` + + // Expiration Date + ExpirationDate string `json:"ExpirationDate,omitempty"` + + // Expiration Month + ExpirationMonth string `json:"ExpirationMonth,omitempty"` + + // Expiration Year + ExpirationYear string `json:"ExpirationYear,omitempty"` + + // Gateway + Gateway string `json:"Gateway,omitempty"` + + // Gateway Key + GatewayKey string `json:"GatewayKey,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"` + + // Nickname + Nickname string `json:"Nickname,omitempty"` + + // Record Type + RecordType string `json:"RecordType,omitempty"` + + // External Reference + Ref string `json:"Ref,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this payment method +func (m *PaymentMethod) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentMethod) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentMethod) UnmarshalBinary(b []byte) error { + var res PaymentMethod + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/payment_method_request.go b/api/ops/ops_models/payment_method_request.go new file mode 100644 index 0000000..8cab01a --- /dev/null +++ b/api/ops/ops_models/payment_method_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentMethodRequest payment method request +// +// swagger:model PaymentMethodRequest +type PaymentMethodRequest struct { + + // data + Data []*PaymentMethod `json:"Data"` +} + +// Validate validates this payment method request +func (m *PaymentMethodRequest) 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 *PaymentMethodRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PaymentMethodRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentMethodRequest) UnmarshalBinary(b []byte) error { + var res PaymentMethodRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/payment_method_response.go b/api/ops/ops_models/payment_method_response.go new file mode 100644 index 0000000..5e5290c --- /dev/null +++ b/api/ops/ops_models/payment_method_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentMethodResponse An array of Payment Method objects +// +// swagger:model PaymentMethodResponse +type PaymentMethodResponse struct { + + // data + Data []*PaymentMethod `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this payment method response +func (m *PaymentMethodResponse) 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 *PaymentMethodResponse) 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 *PaymentMethodResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PaymentMethodResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentMethodResponse) UnmarshalBinary(b []byte) error { + var res PaymentMethodResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/pricebook.go b/api/ops/ops_models/pricebook.go new file mode 100644 index 0000000..72763f4 --- /dev/null +++ b/api/ops/ops_models/pricebook.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pricebook pricebook +// +// swagger:model Pricebook +type Pricebook struct { + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Active + IsActive bool `json:"IsActive,omitempty"` + + // Is Standard Price Book + IsStandard bool `json:"IsStandard,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Price Book Name + Name string `json:"Name,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this pricebook +func (m *Pricebook) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Pricebook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Pricebook) UnmarshalBinary(b []byte) error { + var res Pricebook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/pricebook_entry.go b/api/ops/ops_models/pricebook_entry.go new file mode 100644 index 0000000..06d604f --- /dev/null +++ b/api/ops/ops_models/pricebook_entry.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PricebookEntry pricebook entry +// +// swagger:model PricebookEntry +type PricebookEntry struct { + + // Active + AccountID string `json:"AccountID,omitempty"` + + // Created By + AgentID string `json:"AgentID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // 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"` + + // pricebook ID + PricebookID string `json:"PricebookID,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // List Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // Use Standard Price + UseStandardPrice bool `json:"UseStandardPrice,omitempty"` + + // procuct ID + ProcuctID string `json:"procuctID,omitempty"` +} + +// Validate validates this pricebook entry +func (m *PricebookEntry) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PricebookEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PricebookEntry) UnmarshalBinary(b []byte) error { + var res PricebookEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/product.go b/api/ops/ops_models/product.go new file mode 100644 index 0000000..b530afe --- /dev/null +++ b/api/ops/ops_models/product.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Product product +// +// swagger:model Product +type Product struct { + + // The ID of the Account that owns this product + AccountID string `json:"AccountID,omitempty"` + + // Agency Type + AgencyType string `json:"AgencyType,omitempty"` + + // Asset Tracking? + AssetTracking bool `json:"AssetTracking,omitempty"` + + // ID of who created this record instance + CreatedByID string `json:"CreatedByID,omitempty"` + + // Date of record creation + CreatedDate string `json:"CreatedDate,omitempty"` + + // Product Description + Description string `json:"Description,omitempty"` + + // DescriptionSKU + DescriptionSKU string `json:"DescriptionSKU,omitempty"` + + // Display URL + DisplayURL string `json:"DisplayURL,omitempty"` + + // Product Family + Family string `json:"Family,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Image (500) + Image500 string `json:"Image500,omitempty"` + + // Image (Full) + ImageFull string `json:"ImageFull,omitempty"` + + // Inventory Tracking? + InventoryTracking bool `json:"InventoryTracking,omitempty"` + + // Active + IsActive bool `json:"IsActive,omitempty"` + + // isGeneric + IsGeneric bool `json:"IsGeneric,omitempty"` + + // Last Modified Date + LastModifiedByDate string `json:"LastModifiedByDate,omitempty"` + + // Last modified by ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // MRC Interval + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // MSRP + MSRP float64 `json:"MSRP,omitempty"` + + // Manufacturer + Manufacturer string `json:"Manufacturer,omitempty"` + + // Manufacturer Product Code + ManufacturerProductCode string `json:"ManufacturerProductCode,omitempty"` + + // Product Name + Name string `json:"Name,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Prorateable? + Prorateable bool `json:"Prorateable,omitempty"` + + // Publish? + Publish bool `json:"Publish,omitempty"` + + // Publish UPC + PublishUPC string `json:"PublishUPC,omitempty"` + + // Quantity Unit Of Measure + QuantityUnitOfMeasure string `json:"QuantityUnitOfMeasure,omitempty"` + + // Refundable? + Refundable bool `json:"Refundable,omitempty"` + + // SKU + SKU string `json:"SKU,omitempty"` + + // Shipping Weight + ShippingWeight float64 `json:"ShippingWeight,omitempty"` + + // Specifications + Specifications string `json:"Specifications,omitempty"` + + // Taxnexus Code Name + TaxnexusCode string `json:"TaxnexusCode,omitempty"` + + // Taxnexus Code + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` + + // tenant identifier + TenantID string `json:"TenantID,omitempty"` + + // Units + Units string `json:"Units,omitempty"` + + // Vendor + VendorID string `json:"VendorID,omitempty"` + + // Vendor Name + VendorName string `json:"VendorName,omitempty"` + + // Vendor Part Number + VendorPartNumber string `json:"VendorPartNumber,omitempty"` + + // Vendor Price + VendorPrice float64 `json:"VendorPrice,omitempty"` +} + +// Validate validates this product +func (m *Product) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Product) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Product) UnmarshalBinary(b []byte) error { + var res Product + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/product_request.go b/api/ops/ops_models/product_request.go new file mode 100644 index 0000000..e56b69c --- /dev/null +++ b/api/ops/ops_models/product_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductRequest product request +// +// swagger:model ProductRequest +type ProductRequest struct { + + // data + Data []*Product `json:"Data"` +} + +// Validate validates this product request +func (m *ProductRequest) 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 *ProductRequest) 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 +} + +// MarshalBinary interface implementation +func (m *ProductRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductRequest) UnmarshalBinary(b []byte) error { + var res ProductRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/product_response.go b/api/ops/ops_models/product_response.go new file mode 100644 index 0000000..710ef10 --- /dev/null +++ b/api/ops/ops_models/product_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductResponse An array of Product objects +// +// swagger:model ProductResponse +type ProductResponse struct { + + // data + Data []*Product `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this product response +func (m *ProductResponse) 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 *ProductResponse) 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 *ProductResponse) 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 +} + +// MarshalBinary interface implementation +func (m *ProductResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponse) UnmarshalBinary(b []byte) error { + var res ProductResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/purchase_order.go b/api/ops/ops_models/purchase_order.go new file mode 100644 index 0000000..e2361ff --- /dev/null +++ b/api/ops/ops_models/purchase_order.go @@ -0,0 +1,390 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrder purchase order +// +// swagger:model PurchaseOrder +type PurchaseOrder struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // PO Amount + Amount float64 `json:"Amount,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // Billing Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // The amount of Deferred Tax incurred with this invoice + BusinessTax float64 `json:"BusinessTax,omitempty"` + + // Cannabis Tax + CannabisTax float64 `json:"CannabisTax,omitempty"` + + // Contract + ContractID string `json:"ContractID,omitempty"` + + // The ID of the Coordinate used to rate this item + CoordinateID string `json:"CoordinateID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // CC used for payment to vendor + CreditCardID string `json:"CreditCardID,omitempty"` + + // Customer ID + CustomerID string `json:"CustomerID,omitempty"` + + // Date Expires + DateExpires string `json:"DateExpires,omitempty"` + + // Date Promised + DatePromised string `json:"DatePromised,omitempty"` + + // Date Requested + DateRequested string `json:"DateRequested,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Discount Percentage + Discount float64 `json:"Discount,omitempty"` + + // Discount Amount + DiscountAmount float64 `json:"DiscountAmount,omitempty"` + + // Due Date + DueDate string `json:"DueDate,omitempty"` + + // End User Contact ID + EndUserID string `json:"EndUserID,omitempty"` + + // Invoice Total from source system + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // Business tax from source system + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // Cannabis Tax from source system + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // Discount from source system + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // Sales Tax from source system + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // Invoice Subtotal from source system + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // Expiration Date + ExpirationDate string `json:"ExpirationDate,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // The ID of the Ingest generated by this PO + IngestID string `json:"IngestID,omitempty"` + + // items + Items []*PurchaseOrderItem `json:"Items"` + + // ID of the Job which created this PO + JobID string `json:"JobID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Opportunity Name + OpportunityID string `json:"OpportunityID,omitempty"` + + // Order Number + OrderID string `json:"OrderID,omitempty"` + + // Date + PODate string `json:"PODate,omitempty"` + + // Number + PONumber string `json:"PONumber,omitempty"` + + // The record identifier from the source system + ParentFK string `json:"ParentFK,omitempty"` + + // Payment Terms + PaymentTerms string `json:"PaymentTerms,omitempty"` + + // Taxnexus Period ID + PeriodID string `json:"PeriodID,omitempty"` + + // Place GeoCode + PlaceGeoCode string `json:"PlaceGeoCode,omitempty"` + + // Posted to external system? + Posted bool `json:"Posted,omitempty"` + + // Quote Name + QuoteID string `json:"QuoteID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type (Medicinal or Recreational) + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Sales Tax + SalesTax float64 `json:"SalesTax,omitempty"` + + // Service Term + ServiceTerm string `json:"ServiceTerm,omitempty"` + + // Ship Date + ShipDate string `json:"ShipDate,omitempty"` + + // shipping address + ShippingAddress *Address `json:"ShippingAddress,omitempty"` + + // Shipping Contact ID + ShippingContactID string `json:"ShippingContactID,omitempty"` + + // Shipping & Handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Shipping Special Instructions + ShippingSpecialInstructions string `json:"ShippingSpecialInstructions,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // The taxes associated with this Purchase Order + TaxTransactions []*TaxTransaction `json:"TaxTransactions"` + + // Telecom Tax + TelecomTax float64 `json:"TelecomTax,omitempty"` + + // ID of the Template used to render this object + TemplateID string `json:"TemplateID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // total + Total *Total `json:"Total,omitempty"` + + // The ID of the totaling struct for this object + TotalID string `json:"TotalID,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // Vendor Account ID + VendorID string `json:"VendorID,omitempty"` + + // Vendor Quote Number + VendorQuoteNumber string `json:"VendorQuoteNumber,omitempty"` +} + +// Validate validates this purchase order +func (m *PurchaseOrder) 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.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTransactions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrder) 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 *PurchaseOrder) 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 *PurchaseOrder) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PurchaseOrder) 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 +} + +func (m *PurchaseOrder) validateTaxTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTransactions) { // not required + return nil + } + + for i := 0; i < len(m.TaxTransactions); i++ { + if swag.IsZero(m.TaxTransactions[i]) { // not required + continue + } + + if m.TaxTransactions[i] != nil { + if err := m.TaxTransactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTransactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PurchaseOrder) validateTotal(formats strfmt.Registry) error { + + if swag.IsZero(m.Total) { // not required + return nil + } + + if m.Total != nil { + if err := m.Total.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Total") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrder) UnmarshalBinary(b []byte) error { + var res PurchaseOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/purchase_order_item.go b/api/ops/ops_models/purchase_order_item.go new file mode 100644 index 0000000..122e462 --- /dev/null +++ b/api/ops/ops_models/purchase_order_item.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderItem purchase order item +// +// swagger:model PurchaseOrderItem +type PurchaseOrderItem struct { + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Line Item Description + Description string `json:"Description,omitempty"` + + // Due Date + DueDate string `json:"DueDate,omitempty"` + + // Product Family + Family string `json:"Family,omitempty"` + + // 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"` + + // Location + LocationID string `json:"LocationID,omitempty"` + + // Monthly Recurring Cost Interval + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // Order Item + OrderItemID string `json:"OrderItemID,omitempty"` + + // The record identifier of the parent record from the source system + ParentFK string `json:"ParentFK,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Product ID + ProductID string `json:"ProductID,omitempty"` + + // Purchase Order + PurchaseOrderID string `json:"PurchaseOrderID,omitempty"` + + // Quantity + Quantity float64 `json:"Quantity,omitempty"` + + // Quote Item + QuoteItemID string `json:"QuoteItemID,omitempty"` + + // Received Quantity + ReceivedQuantity float64 `json:"ReceivedQuantity,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Rejected Quantity + RejectedQuantity float64 `json:"RejectedQuantity,omitempty"` + + // Shipping costs for this item + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Shipment Item ID + ShippmentItemID string `json:"ShippmentItemID,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Stocked Quantity + StockedQuantity float64 `json:"StockedQuantity,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // Taxnexus Code + TaxnexusCodeDisplay string `json:"TaxnexusCodeDisplay,omitempty"` + + // Taxnexus Code + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Unit Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // Units + Units string `json:"Units,omitempty"` +} + +// Validate validates this purchase order item +func (m *PurchaseOrderItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderItem) UnmarshalBinary(b []byte) error { + var res PurchaseOrderItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/purchase_order_request.go b/api/ops/ops_models/purchase_order_request.go new file mode 100644 index 0000000..9c02e37 --- /dev/null +++ b/api/ops/ops_models/purchase_order_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderRequest purchase order request +// +// swagger:model PurchaseOrderRequest +type PurchaseOrderRequest struct { + + // data + Data []*PurchaseOrder `json:"Data"` +} + +// Validate validates this purchase order request +func (m *PurchaseOrderRequest) 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 *PurchaseOrderRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderRequest) UnmarshalBinary(b []byte) error { + var res PurchaseOrderRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/purchase_order_response.go b/api/ops/ops_models/purchase_order_response.go new file mode 100644 index 0000000..2c5006b --- /dev/null +++ b/api/ops/ops_models/purchase_order_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderResponse An array of Purchase Order objects +// +// swagger:model PurchaseOrderResponse +type PurchaseOrderResponse struct { + + // data + Data []*PurchaseOrder `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this purchase order response +func (m *PurchaseOrderResponse) 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 *PurchaseOrderResponse) 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 *PurchaseOrderResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderResponse) UnmarshalBinary(b []byte) error { + var res PurchaseOrderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/put_response.go b/api/ops/ops_models/put_response.go new file mode 100644 index 0000000..cc13232 --- /dev/null +++ b/api/ops/ops_models/put_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PutResponse put response +// +// swagger:model PutResponse +type PutResponse struct { + + // data + Data []*Message `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this put response +func (m *PutResponse) 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 *PutResponse) 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 *PutResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PutResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PutResponse) UnmarshalBinary(b []byte) error { + var res PutResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/quote.go b/api/ops/ops_models/quote.go new file mode 100644 index 0000000..edfa9d8 --- /dev/null +++ b/api/ops/ops_models/quote.go @@ -0,0 +1,458 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Quote quote +// +// swagger:model Quote +type Quote struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // additional address + AdditionalAddress *Address `json:"AdditionalAddress,omitempty"` + + // Additional To Name + AdditionalName string `json:"AdditionalName,omitempty"` + + // The Quote Amount + Amount float64 `json:"Amount,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // Billing Contact ID + BillingContactID string `json:"BillingContactID,omitempty"` + + // Bill To Name + BillingName string `json:"BillingName,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // Business Tax Amount + BusinessTax float64 `json:"BusinessTax,omitempty"` + + // Cannabis Tax + CannabisTax float64 `json:"CannabisTax,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Contract ID + ContractID string `json:"ContractID,omitempty"` + + // Contact ID + CoordinateID string `json:"CoordinateID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Credit Terms + CreditTerms string `json:"CreditTerms,omitempty"` + + // OEM Customer Identifier + CustomerID string `json:"CustomerID,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Discount Percentage + Discount float64 `json:"Discount,omitempty"` + + // Discount Amount + DiscountAmount float64 `json:"DiscountAmount,omitempty"` + + // Email + Email string `json:"Email,omitempty"` + + // End User Contact ID + EndUserID string `json:"EndUserID,omitempty"` + + // Invoice Total from source system + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // Business tax from source system + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // Cost of Goods Sold from source system + EstimatedCOGS float64 `json:"EstimatedCOGS,omitempty"` + + // Cannabis Tax from source system + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // Cannabis Tax from source system + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // Sales Tax from source system + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // Invoice Subtotal from source system + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // Expiration Date + ExpirationDate string `json:"ExpirationDate,omitempty"` + + // Fax + Fax string `json:"Fax,omitempty"` + + // Grand Total + GrandTotal float64 `json:"GrandTotal,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // ID of the Ingest which created this Invoice + IngestID string `json:"IngestID,omitempty"` + + // Installation Date + InstallationDate string `json:"InstallationDate,omitempty"` + + // items + Items []*QuoteItem `json:"Items"` + + // ID of the Job which created this Invoice + JobID string `json:"JobID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Monthly Amount quoted + MonthlyAmount float64 `json:"MonthlyAmount,omitempty"` + + // Quote Name + Name string `json:"Name,omitempty"` + + // Opportunity Name + OpportunityID string `json:"OpportunityID,omitempty"` + + // Owner Name + OwnerID string `json:"OwnerID,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Payment Terms + PaymentTerms string `json:"PaymentTerms,omitempty"` + + // Period ID + PeriodID string `json:"PeriodID,omitempty"` + + // Phone + Phone string `json:"Phone,omitempty"` + + // Place GeoCode + PlaceGeoCode string `json:"PlaceGeoCode,omitempty"` + + // Purchase Amount + PurchaseAmount float64 `json:"PurchaseAmount,omitempty"` + + // Quote Amount + QuoteAmount float64 `json:"QuoteAmount,omitempty"` + + // Quote Date + QuoteDate string `json:"QuoteDate,omitempty"` + + // Quote Number + QuoteNumber string `json:"QuoteNumber,omitempty"` + + // quote to address + QuoteToAddress *Address `json:"QuoteToAddress,omitempty"` + + // Quote To Name + QuoteToName string `json:"QuoteToName,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Sales Tax Amount + SalesTax float64 `json:"SalesTax,omitempty"` + + // Service Term + ServiceTerm string `json:"ServiceTerm,omitempty"` + + // shipping address + ShippingAddress *Address `json:"ShippingAddress,omitempty"` + + // Shipping Contact ID + ShippingContactID string `json:"ShippingContactID,omitempty"` + + // Shipping and Handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Ship To Name + ShippingName string `json:"ShippingName,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // Tax + Tax float64 `json:"Tax,omitempty"` + + // The taxes associated with this Quote + TaxTransactions []*TaxTransaction `json:"TaxTransactions"` + + // Telecom Tax + TelecomTax float64 `json:"TelecomTax,omitempty"` + + // Template + TemplateID string `json:"TemplateID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // total + Total *Total `json:"Total,omitempty"` + + // Total Price + TotalPrice float64 `json:"TotalPrice,omitempty"` + + // Quote Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this quote +func (m *Quote) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdditionalAddress(formats); err != nil { + res = append(res, err) + } + + 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.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQuoteToAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTransactions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Quote) validateAdditionalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.AdditionalAddress) { // not required + return nil + } + + if m.AdditionalAddress != nil { + if err := m.AdditionalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AdditionalAddress") + } + return err + } + } + + return nil +} + +func (m *Quote) 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 *Quote) 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 *Quote) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Quote) validateQuoteToAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.QuoteToAddress) { // not required + return nil + } + + if m.QuoteToAddress != nil { + if err := m.QuoteToAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("QuoteToAddress") + } + return err + } + } + + return nil +} + +func (m *Quote) 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 +} + +func (m *Quote) validateTaxTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTransactions) { // not required + return nil + } + + for i := 0; i < len(m.TaxTransactions); i++ { + if swag.IsZero(m.TaxTransactions[i]) { // not required + continue + } + + if m.TaxTransactions[i] != nil { + if err := m.TaxTransactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTransactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Quote) validateTotal(formats strfmt.Registry) error { + + if swag.IsZero(m.Total) { // not required + return nil + } + + if m.Total != nil { + if err := m.Total.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Total") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Quote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Quote) UnmarshalBinary(b []byte) error { + var res Quote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/quote_basic.go b/api/ops/ops_models/quote_basic.go new file mode 100644 index 0000000..6ce54ac --- /dev/null +++ b/api/ops/ops_models/quote_basic.go @@ -0,0 +1,390 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// QuoteBasic quote basic +// +// swagger:model QuoteBasic +type QuoteBasic struct { + + // Account Identifier from Source System; ignored in tax calculations + AccountID string `json:"AccountID,omitempty"` + + // Invoice Amount + Amount float64 `json:"Amount,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // OEM Customer Identifier + CustomerID string `json:"CustomerID,omitempty"` + + // Invoice Total from source system + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // Business tax from source system + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // Cannabis Tax from source system + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // Cost of Goods Sold from source system + EstimatedCogs float64 `json:"EstimatedCogs,omitempty"` + + // Cannabis Tax from source system + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // Sales Tax from source system + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // Invoice Subtotal from source system + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // Taxnexus ID + ID string `json:"ID,omitempty"` + + // ID of the Ingest which created this Invoice + IngestID string `json:"IngestID,omitempty"` + + // The items associated with this Invoice + Items []*ItemBasic `json:"Items"` + + // ID of the Job which created this Invoice + JobID string `json:"JobID,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Taxnexus Period ID + PeriodID string `json:"PeriodID,omitempty"` + + // Invoice Date; should be date only or correct time zone if in time notation + QuoteDate string `json:"QuoteDate,omitempty"` + + // Source System Customer-Facing Invoice Number; ignored in tax calculation + QuoteNumber string `json:"QuoteNumber,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type + // Enum: [AdultUse Caregiver Consumer Medicinal MedicinalState MedicinalThirdParty Merchandise Patient Telecom] + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Shipping and Handling fees for this document + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // 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] + Status string `json:"Status,omitempty"` + + // Subtotal of items + Subtotal float64 `json:"Subtotal,omitempty"` + + // The Tax Transactions "Source System identifier for this record, if any; copied to quoteitemid in Tax Transaction result records" + TaxTransactions []*TaxTransaction `json:"TaxTransactions"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // total + Total *Total `json:"Total,omitempty"` + + // Invoice Type + Type string `json:"Type,omitempty"` +} + +// Validate validates this quote basic +func (m *QuoteBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBusinessAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSalesRegulation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxTransactions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotal(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QuoteBasic) 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 *QuoteBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var quoteBasicTypeSalesRegulationPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AdultUse","Caregiver","Consumer","Medicinal","MedicinalState","MedicinalThirdParty","Merchandise","Patient","Telecom"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + quoteBasicTypeSalesRegulationPropEnum = append(quoteBasicTypeSalesRegulationPropEnum, v) + } +} + +const ( + + // QuoteBasicSalesRegulationAdultUse captures enum value "AdultUse" + QuoteBasicSalesRegulationAdultUse string = "AdultUse" + + // QuoteBasicSalesRegulationCaregiver captures enum value "Caregiver" + QuoteBasicSalesRegulationCaregiver string = "Caregiver" + + // QuoteBasicSalesRegulationConsumer captures enum value "Consumer" + QuoteBasicSalesRegulationConsumer string = "Consumer" + + // QuoteBasicSalesRegulationMedicinal captures enum value "Medicinal" + QuoteBasicSalesRegulationMedicinal string = "Medicinal" + + // QuoteBasicSalesRegulationMedicinalState captures enum value "MedicinalState" + QuoteBasicSalesRegulationMedicinalState string = "MedicinalState" + + // QuoteBasicSalesRegulationMedicinalThirdParty captures enum value "MedicinalThirdParty" + QuoteBasicSalesRegulationMedicinalThirdParty string = "MedicinalThirdParty" + + // QuoteBasicSalesRegulationMerchandise captures enum value "Merchandise" + QuoteBasicSalesRegulationMerchandise string = "Merchandise" + + // QuoteBasicSalesRegulationPatient captures enum value "Patient" + QuoteBasicSalesRegulationPatient string = "Patient" + + // QuoteBasicSalesRegulationTelecom captures enum value "Telecom" + QuoteBasicSalesRegulationTelecom string = "Telecom" +) + +// prop value enum +func (m *QuoteBasic) validateSalesRegulationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, quoteBasicTypeSalesRegulationPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *QuoteBasic) validateSalesRegulation(formats strfmt.Registry) error { + + if swag.IsZero(m.SalesRegulation) { // not required + return nil + } + + // value enum + if err := m.validateSalesRegulationEnum("SalesRegulation", "body", m.SalesRegulation); err != nil { + return err + } + + return nil +} + +var quoteBasicTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["closed","delivered","hold","issued","new","posted","rated","rating_failed","rating_ready","reissued","rendered","uncollectable","voided"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + quoteBasicTypeStatusPropEnum = append(quoteBasicTypeStatusPropEnum, v) + } +} + +const ( + + // QuoteBasicStatusClosed captures enum value "closed" + QuoteBasicStatusClosed string = "closed" + + // QuoteBasicStatusDelivered captures enum value "delivered" + QuoteBasicStatusDelivered string = "delivered" + + // QuoteBasicStatusHold captures enum value "hold" + QuoteBasicStatusHold string = "hold" + + // QuoteBasicStatusIssued captures enum value "issued" + QuoteBasicStatusIssued string = "issued" + + // QuoteBasicStatusNew captures enum value "new" + QuoteBasicStatusNew string = "new" + + // QuoteBasicStatusPosted captures enum value "posted" + QuoteBasicStatusPosted string = "posted" + + // QuoteBasicStatusRated captures enum value "rated" + QuoteBasicStatusRated string = "rated" + + // QuoteBasicStatusRatingFailed captures enum value "rating_failed" + QuoteBasicStatusRatingFailed string = "rating_failed" + + // QuoteBasicStatusRatingReady captures enum value "rating_ready" + QuoteBasicStatusRatingReady string = "rating_ready" + + // QuoteBasicStatusReissued captures enum value "reissued" + QuoteBasicStatusReissued string = "reissued" + + // QuoteBasicStatusRendered captures enum value "rendered" + QuoteBasicStatusRendered string = "rendered" + + // QuoteBasicStatusUncollectable captures enum value "uncollectable" + QuoteBasicStatusUncollectable string = "uncollectable" + + // QuoteBasicStatusVoided captures enum value "voided" + QuoteBasicStatusVoided string = "voided" +) + +// prop value enum +func (m *QuoteBasic) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, quoteBasicTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *QuoteBasic) 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 +} + +func (m *QuoteBasic) validateTaxTransactions(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxTransactions) { // not required + return nil + } + + for i := 0; i < len(m.TaxTransactions); i++ { + if swag.IsZero(m.TaxTransactions[i]) { // not required + continue + } + + if m.TaxTransactions[i] != nil { + if err := m.TaxTransactions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxTransactions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *QuoteBasic) validateTotal(formats strfmt.Registry) error { + + if swag.IsZero(m.Total) { // not required + return nil + } + + if m.Total != nil { + if err := m.Total.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Total") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QuoteBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteBasic) UnmarshalBinary(b []byte) error { + var res QuoteBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/quote_item.go b/api/ops/ops_models/quote_item.go new file mode 100644 index 0000000..0a6f6cc --- /dev/null +++ b/api/ops/ops_models/quote_item.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QuoteItem quote item +// +// swagger:model QuoteItem +type QuoteItem struct { + + // Cost of Goods Sold + COGS float64 `json:"COGS,omitempty"` + + // County + CountyID string `json:"CountyID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Line Item Description + Description string `json:"Description,omitempty"` + + // Discount Percentage + Discount float64 `json:"Discount,omitempty"` + + // Discount Amount + DiscountAmount float64 `json:"DiscountAmount,omitempty"` + + // Taxnexus 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"` + + // List Price + ListPrice float64 `json:"ListPrice,omitempty"` + + // Quantity + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Product ID + ProductID string `json:"ProductID,omitempty"` + + // Product Name + ProductName string `json:"ProductName,omitempty"` + + // Quantity + Quantity float64 `json:"Quantity,omitempty"` + + // Quote Name + QuoteID string `json:"QuoteID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Date + ServiceDate string `json:"ServiceDate,omitempty"` + + // Shipping & Handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // Taxnexus Code + TaxnexusCode string `json:"TaxnexusCode,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Total Price + TotalPrice float64 `json:"TotalPrice,omitempty"` + + // Sales Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // The Unit of Measure for this item + Units string `json:"Units,omitempty"` +} + +// Validate validates this quote item +func (m *QuoteItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *QuoteItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteItem) UnmarshalBinary(b []byte) error { + var res QuoteItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/quote_request.go b/api/ops/ops_models/quote_request.go new file mode 100644 index 0000000..29bed35 --- /dev/null +++ b/api/ops/ops_models/quote_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QuoteRequest An array of Quote objects +// +// swagger:model QuoteRequest +type QuoteRequest struct { + + // data + Data []*QuoteBasic `json:"Data"` +} + +// Validate validates this quote request +func (m *QuoteRequest) 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 *QuoteRequest) 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 +} + +// MarshalBinary interface implementation +func (m *QuoteRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteRequest) UnmarshalBinary(b []byte) error { + var res QuoteRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/quote_response.go b/api/ops/ops_models/quote_response.go new file mode 100644 index 0000000..ab27a14 --- /dev/null +++ b/api/ops/ops_models/quote_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QuoteResponse An array of Quote objects +// +// swagger:model QuoteResponse +type QuoteResponse struct { + + // data + Data []*Quote `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this quote response +func (m *QuoteResponse) 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 *QuoteResponse) 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 *QuoteResponse) 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 +} + +// MarshalBinary interface implementation +func (m *QuoteResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteResponse) UnmarshalBinary(b []byte) error { + var res QuoteResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/response_meta.go b/api/ops/ops_models/response_meta.go new file mode 100644 index 0000000..fc692bc --- /dev/null +++ b/api/ops/ops_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/ops/ops_models/subscription.go b/api/ops/ops_models/subscription.go new file mode 100644 index 0000000..649b4b7 --- /dev/null +++ b/api/ops/ops_models/subscription.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Subscription subscription +// +// swagger:model Subscription +type Subscription struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Activated Date + ActivatedDate string `json:"ActivatedDate,omitempty"` + + // Activated By + ActivatedUserID string `json:"ActivatedUserID,omitempty"` + + // Amount + Amount float64 `json:"Amount,omitempty"` + + // Asset Name + AssetID string `json:"AssetID,omitempty"` + + // Cancel Date + CancelDate string `json:"CancelDate,omitempty"` + + // contract ID + ContractID string `json:"ContractID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Effective Date + EffectiveDate string `json:"EffectiveDate,omitempty"` + + // Email + Email string `json:"Email,omitempty"` + + // End User Contact ID + EndUserID string `json:"EndUserID,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Active? + IsActive bool `json:"IsActive,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Order Date + OrderDate string `json:"OrderDate,omitempty"` + + // Order Item + OrderItemID string `json:"OrderItemID,omitempty"` + + // Password + Password string `json:"Password,omitempty"` + + // Payment Terms + PaymentTerms string `json:"PaymentTerms,omitempty"` + + // Price Book + PriceBookID string `json:"PriceBookID,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // product ID + ProductID string `json:"ProductID,omitempty"` + + // Product Name + ProductName string `json:"ProductName,omitempty"` + + // Quantity + Quantity string `json:"Quantity,omitempty"` + + // Quote Item + QuoteItemID string `json:"QuoteItemID,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // Unit Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // Units + Units string `json:"Units,omitempty"` + + // Unlimited usage? + Unlimited bool `json:"Unlimited,omitempty"` + + // Username + Username string `json:"Username,omitempty"` +} + +// Validate validates this subscription +func (m *Subscription) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Subscription) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Subscription) UnmarshalBinary(b []byte) error { + var res Subscription + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/subscription_request.go b/api/ops/ops_models/subscription_request.go new file mode 100644 index 0000000..a1728e0 --- /dev/null +++ b/api/ops/ops_models/subscription_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubscriptionRequest subscription request +// +// swagger:model SubscriptionRequest +type SubscriptionRequest struct { + + // data + Data []*Subscription `json:"Data"` +} + +// Validate validates this subscription request +func (m *SubscriptionRequest) 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 *SubscriptionRequest) 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 +} + +// MarshalBinary interface implementation +func (m *SubscriptionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubscriptionRequest) UnmarshalBinary(b []byte) error { + var res SubscriptionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/subscription_response.go b/api/ops/ops_models/subscription_response.go new file mode 100644 index 0000000..8ba12fe --- /dev/null +++ b/api/ops/ops_models/subscription_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubscriptionResponse An array of Subscription Objects +// +// swagger:model SubscriptionResponse +type SubscriptionResponse struct { + + // data + Data []*Subscription `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this subscription response +func (m *SubscriptionResponse) 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 *SubscriptionResponse) 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 *SubscriptionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SubscriptionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubscriptionResponse) UnmarshalBinary(b []byte) error { + var res SubscriptionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/tax_transaction.go b/api/ops/ops_models/tax_transaction.go new file mode 100644 index 0000000..3828e43 --- /dev/null +++ b/api/ops/ops_models/tax_transaction.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTransaction tax transaction +// +// swagger:model TaxTransaction +type TaxTransaction struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Accounting Rule code + AccountingRuleCode string `json:"AccountingRuleCode,omitempty"` + + // Total Amount Due (same as Tax) + Amount float64 `json:"Amount,omitempty"` + + // Coordinate ID + CoordinateID string `json:"CoordinateID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Customer ID + CustomerID string `json:"CustomerID,omitempty"` + + // Tax or Fee Name + DisplayName string `json:"DisplayName,omitempty"` + + // Effective Rate + EffectiveRate float64 `json:"EffectiveRate,omitempty"` + + // Filing ID + FilingID string `json:"FilingID,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Ingest ID + IngestID string `json:"IngestID,omitempty"` + + // Invoice ID + InvoiceID string `json:"InvoiceID,omitempty"` + + // Invoiceitem ID + InvoiceItemID string `json:"InvoiceItemID,omitempty"` + + // Is this a summary record? + IsSummary bool `json:"IsSummary,omitempty"` + + // Job ID + JobID string `json:"JobID,omitempty"` + + // Journal Item ID + JournalItemID string `json:"JournalItemID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Order ID + OrderID string `json:"OrderID,omitempty"` + + // Order Item ID + OrderItemID string `json:"OrderItemID,omitempty"` + + // PO ID + POID string `json:"POID,omitempty"` + + // PO Item ID + POItemID string `json:"POItemID,omitempty"` + + // Parent Ref copied from source + ParentRef string `json:"ParentRef,omitempty"` + + // Percent Taxable + PercentTaxable float64 `json:"PercentTaxable,omitempty"` + + // Period ID + PeriodID string `json:"PeriodID,omitempty"` + + // The Taxnexus Geocode of the Place used for Situs + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // Place ID + PlaceID string `json:"PlaceID,omitempty"` + + // Posted to external system? + Posted bool `json:"Posted,omitempty"` + + // Order ID + QuoteID string `json:"QuoteID,omitempty"` + + // Order Item ID + QuoteItemID string `json:"QuoteItemID,omitempty"` + + // The Type of Object that was rated + RatingType string `json:"RatingType,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // The Revenue Amount that was taxed before any adjustments + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // The Revenue Amount that was taxed after any adjustments + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // The Revenue Amount that was not taxed + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + + // Tax Exempt Revenue + TaxExemptRevenue float64 `json:"TaxExemptRevenue,omitempty"` + + // Additional Tax calculated due to regulatory requirements + TaxOnTax float64 `json:"TaxOnTax,omitempty"` + + // The Tax Rate used for calculation + TaxRate float64 `json:"TaxRate,omitempty"` + + // TaxType Account ID + TaxTypeAccountID string `json:"TaxTypeAccountID,omitempty"` + + // TaxType ID + TaxTypeID string `json:"TaxTypeID,omitempty"` + + // The Taxnexus Code for the Tax Type + TaxnexusCodeDisplay string `json:"TaxnexusCodeDisplay,omitempty"` + + // Taxnexus Code ID + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` + + // Unit Fee Rate + UnitFeeRate float64 `json:"UnitFeeRate,omitempty"` +} + +// Validate validates this tax transaction +func (m *TaxTransaction) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxTransaction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTransaction) UnmarshalBinary(b []byte) error { + var res TaxTransaction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/tax_transaction_response.go b/api/ops/ops_models/tax_transaction_response.go new file mode 100644 index 0000000..5a51902 --- /dev/null +++ b/api/ops/ops_models/tax_transaction_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTransactionResponse An array of Tax Transaction Objects +// +// swagger:model TaxTransactionResponse +type TaxTransactionResponse struct { + + // data + Data []*TaxTransaction `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this tax transaction response +func (m *TaxTransactionResponse) 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 *TaxTransactionResponse) 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 *TaxTransactionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTransactionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTransactionResponse) UnmarshalBinary(b []byte) error { + var res TaxTransactionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/total.go b/api/ops/ops_models/total.go new file mode 100644 index 0000000..3ff624c --- /dev/null +++ b/api/ops/ops_models/total.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Total total +// +// swagger:model Total +type Total struct { + + // The total amount for this object + Amount float64 `json:"Amount,omitempty"` + + // The amount of Deferred Tax incurred with this invoice + BusinessTax float64 `json:"BusinessTax,omitempty"` + + // The Percentage of Deffered Tax from the Total + BusinessTaxRate float64 `json:"BusinessTaxRate,omitempty"` + + // The total amount of Cannabis Tax charged on this object + CannabisTax float64 `json:"CannabisTax,omitempty"` + + // The percentage of Cannabis Tax from the Total + CannabisTaxRate float64 `json:"CannabisTaxRate,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Unique Taxnexus ID + ID string `json:"ID,omitempty"` + + // items + Items []*TotalItem `json:"Items"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The monthly, pre-tax estimate of quoted and ordered periodic services + MonthlyAmount float64 `json:"MonthlyAmount,omitempty"` + + // The type of Object for which this Total has been constructed + ObjectType string `json:"ObjectType,omitempty"` + + // purchase amount + PurchaseAmount float64 `json:"PurchaseAmount,omitempty"` + + // The amount of Sales Tax charged on this object + SalesTax float64 `json:"SalesTax,omitempty"` + + // The percentage of Sales Tax from the Total + SalesTaxRate float64 `json:"SalesTaxRate,omitempty"` + + // The shipping and delivery charges charged on this object + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // The sum of all the items on the object prior to tax rating and shipping & handling + Subtotal float64 `json:"Subtotal,omitempty"` + + // The amount of Telecom Tax charged on this invoice + TelecomTax float64 `json:"TelecomTax,omitempty"` + + // The percentage of Telecom Tax from the Total + TelecomTaxRate float64 `json:"TelecomTaxRate,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this total +func (m *Total) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Total) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Total) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Total) UnmarshalBinary(b []byte) error { + var res Total + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/total_item.go b/api/ops/ops_models/total_item.go new file mode 100644 index 0000000..f520a3b --- /dev/null +++ b/api/ops/ops_models/total_item.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TotalItem Tabulates Tax Transactions on this object +// +// swagger:model TotalItem +type TotalItem struct { + + // The amount of this total item + Amount float64 `json:"Amount,omitempty"` + + // The number of taxtransactions totaled + Count int64 `json:"Count,omitempty"` + + // Total Item description to be used in bill presentment + DisplayName string `json:"DisplayName,omitempty"` + + // Unique Taxnexus ID + ID string `json:"ID,omitempty"` + + // tax items + TaxItems []*TotalTaxItem `json:"TaxItems"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this total item +func (m *TotalItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TotalItem) validateTaxItems(formats strfmt.Registry) error { + + if swag.IsZero(m.TaxItems) { // not required + return nil + } + + for i := 0; i < len(m.TaxItems); i++ { + if swag.IsZero(m.TaxItems[i]) { // not required + continue + } + + if m.TaxItems[i] != nil { + if err := m.TaxItems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TaxItems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TotalItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TotalItem) UnmarshalBinary(b []byte) error { + var res TotalItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/ops/ops_models/total_tax_item.go b/api/ops/ops_models/total_tax_item.go new file mode 100644 index 0000000..b738d11 --- /dev/null +++ b/api/ops/ops_models/total_tax_item.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ops_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TotalTaxItem Links the tax items totals in the TotalItem struct +// +// swagger:model TotalTaxItem +type TotalTaxItem struct { + + // ID + ID string `json:"ID,omitempty"` + + // tax transaction ID + TaxTransactionID string `json:"TaxTransactionID,omitempty"` + + // ID of the Tenant that owns this object + TenantID string `json:"TenantID,omitempty"` + + // total item ID + TotalItemID string `json:"TotalItemID,omitempty"` +} + +// Validate validates this total tax item +func (m *TotalTaxItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TotalTaxItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TotalTaxItem) UnmarshalBinary(b []byte) error { + var res TotalTaxItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/pdf/pdf_client/pdf/get_p_d_f_parameters.go b/api/pdf/pdf_client/pdf/get_p_d_f_parameters.go new file mode 100644 index 0000000..b6a8ea7 --- /dev/null +++ b/api/pdf/pdf_client/pdf/get_p_d_f_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package 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" +) + +// NewGetPDFParams creates a new GetPDFParams object +// with the default values initialized. +func NewGetPDFParams() *GetPDFParams { + var () + return &GetPDFParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPDFParamsWithTimeout creates a new GetPDFParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPDFParamsWithTimeout(timeout time.Duration) *GetPDFParams { + var () + return &GetPDFParams{ + + timeout: timeout, + } +} + +// NewGetPDFParamsWithContext creates a new GetPDFParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPDFParamsWithContext(ctx context.Context) *GetPDFParams { + var () + return &GetPDFParams{ + + Context: ctx, + } +} + +// NewGetPDFParamsWithHTTPClient creates a new GetPDFParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPDFParamsWithHTTPClient(client *http.Client) *GetPDFParams { + var () + return &GetPDFParams{ + HTTPClient: client, + } +} + +/*GetPDFParams contains all the parameters to send to the API endpoint +for the get p d f operation typically these are written to a http.Request +*/ +type GetPDFParams struct { + + /*PdfID + Taxnexus Record ID + + */ + PdfID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get p d f params +func (o *GetPDFParams) WithTimeout(timeout time.Duration) *GetPDFParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get p d f params +func (o *GetPDFParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get p d f params +func (o *GetPDFParams) WithContext(ctx context.Context) *GetPDFParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get p d f params +func (o *GetPDFParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get p d f params +func (o *GetPDFParams) WithHTTPClient(client *http.Client) *GetPDFParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get p d f params +func (o *GetPDFParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPdfID adds the pdfID to the get p d f params +func (o *GetPDFParams) WithPdfID(pdfID string) *GetPDFParams { + o.SetPdfID(pdfID) + return o +} + +// SetPdfID adds the pdfId to the get p d f params +func (o *GetPDFParams) SetPdfID(pdfID string) { + o.PdfID = pdfID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPDFParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param pdfId + if err := r.SetPathParam("pdfId", o.PdfID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/pdf/pdf_client/pdf/get_p_d_f_responses.go b/api/pdf/pdf_client/pdf/get_p_d_f_responses.go new file mode 100644 index 0000000..0ffd586 --- /dev/null +++ b/api/pdf/pdf_client/pdf/get_p_d_f_responses.go @@ -0,0 +1,294 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package 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/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/taxnexus/go/lib/api/pdf/pdf_models" +) + +// GetPDFReader is a Reader for the GetPDF structure. +type GetPDFReader struct { + formats strfmt.Registry + writer io.Writer +} + +// ReadResponse reads a server response into the received o. +func (o *GetPDFReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPDFOK(o.writer) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPDFUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPDFForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPDFNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPDFUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPDFInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPDFOK creates a GetPDFOK with default headers values +func NewGetPDFOK(writer io.Writer) *GetPDFOK { + return &GetPDFOK{ + Payload: writer, + } +} + +/*GetPDFOK handles this case with default header values. + +A PDF file +*/ +type GetPDFOK struct { + /*Specifies download file name + */ + ContentDisposition string + /*The size of the file + */ + ContentLength int32 + /*The URL of the document + */ + ContentLocation string + + Payload io.Writer +} + +func (o *GetPDFOK) Error() string { + return fmt.Sprintf("[GET /pdfs/{pdfId}][%d] getPDFOK %+v", 200, o.Payload) +} + +func (o *GetPDFOK) GetPayload() io.Writer { + return o.Payload +} + +func (o *GetPDFOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Content-Disposition + o.ContentDisposition = response.GetHeader("Content-Disposition") + + // response header Content-Length + contentLength, err := swag.ConvertInt32(response.GetHeader("Content-Length")) + if err != nil { + return errors.InvalidType("Content-Length", "header", "int32", response.GetHeader("Content-Length")) + } + o.ContentLength = contentLength + + // response header Content-Location + o.ContentLocation = response.GetHeader("Content-Location") + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPDFUnauthorized creates a GetPDFUnauthorized with default headers values +func NewGetPDFUnauthorized() *GetPDFUnauthorized { + return &GetPDFUnauthorized{} +} + +/*GetPDFUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetPDFUnauthorized struct { + Payload *pdf_models.Error +} + +func (o *GetPDFUnauthorized) Error() string { + return fmt.Sprintf("[GET /pdfs/{pdfId}][%d] getPDFUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPDFUnauthorized) GetPayload() *pdf_models.Error { + return o.Payload +} + +func (o *GetPDFUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(pdf_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPDFForbidden creates a GetPDFForbidden with default headers values +func NewGetPDFForbidden() *GetPDFForbidden { + return &GetPDFForbidden{} +} + +/*GetPDFForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPDFForbidden struct { + Payload *pdf_models.Error +} + +func (o *GetPDFForbidden) Error() string { + return fmt.Sprintf("[GET /pdfs/{pdfId}][%d] getPDFForbidden %+v", 403, o.Payload) +} + +func (o *GetPDFForbidden) GetPayload() *pdf_models.Error { + return o.Payload +} + +func (o *GetPDFForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(pdf_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPDFNotFound creates a GetPDFNotFound with default headers values +func NewGetPDFNotFound() *GetPDFNotFound { + return &GetPDFNotFound{} +} + +/*GetPDFNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPDFNotFound struct { + Payload *pdf_models.Error +} + +func (o *GetPDFNotFound) Error() string { + return fmt.Sprintf("[GET /pdfs/{pdfId}][%d] getPDFNotFound %+v", 404, o.Payload) +} + +func (o *GetPDFNotFound) GetPayload() *pdf_models.Error { + return o.Payload +} + +func (o *GetPDFNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(pdf_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPDFUnprocessableEntity creates a GetPDFUnprocessableEntity with default headers values +func NewGetPDFUnprocessableEntity() *GetPDFUnprocessableEntity { + return &GetPDFUnprocessableEntity{} +} + +/*GetPDFUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPDFUnprocessableEntity struct { + Payload *pdf_models.Error +} + +func (o *GetPDFUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /pdfs/{pdfId}][%d] getPDFUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPDFUnprocessableEntity) GetPayload() *pdf_models.Error { + return o.Payload +} + +func (o *GetPDFUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(pdf_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPDFInternalServerError creates a GetPDFInternalServerError with default headers values +func NewGetPDFInternalServerError() *GetPDFInternalServerError { + return &GetPDFInternalServerError{} +} + +/*GetPDFInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPDFInternalServerError struct { + Payload *pdf_models.Error +} + +func (o *GetPDFInternalServerError) Error() string { + return fmt.Sprintf("[GET /pdfs/{pdfId}][%d] getPDFInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPDFInternalServerError) GetPayload() *pdf_models.Error { + return o.Payload +} + +func (o *GetPDFInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(pdf_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/pdf/pdf_client/pdf/pdf_client.go b/api/pdf/pdf_client/pdf/pdf_client.go new file mode 100644 index 0000000..0921ae8 --- /dev/null +++ b/api/pdf/pdf_client/pdf/pdf_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package 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" +) + +// New creates a new pdf API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for pdf API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPDF(params *GetPDFParams, writer io.Writer) (*GetPDFOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPDF sends a p d f in response to an identifier + + Return a PDF from the datastore +*/ +func (a *Client) GetPDF(params *GetPDFParams, writer io.Writer) (*GetPDFOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPDFParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPDF", + Method: "GET", + PathPattern: "/pdfs/{pdfId}", + ProducesMediaTypes: []string{"application/pdf"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPDFReader{formats: a.formats, writer: writer}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPDFOK) + 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 getPDF: 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/pdf/pdf_client/pdf_client.go b/api/pdf/pdf_client/pdf_client.go new file mode 100644 index 0000000..f8ae661 --- /dev/null +++ b/api/pdf/pdf_client/pdf_client.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pdf_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" + + "github.com/taxnexus/go/lib/api/pdf/pdf_client/pdf" +) + +// Default pdf HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "pdf.fabric.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 pdf HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Pdf { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new pdf HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Pdf { + // 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 pdf client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Pdf { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Pdf) + cli.Transport = transport + cli.Pdf = 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 +} + +// Pdf is a client for pdf +type Pdf struct { + Pdf pdf.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Pdf) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Pdf.SetTransport(transport) +} diff --git a/api/pdf/pdf_models/error.go b/api/pdf/pdf_models/error.go new file mode 100644 index 0000000..c3f7d4b --- /dev/null +++ b/api/pdf/pdf_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package pdf_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/plex/plex_client/invoice/get_invoices_parameters.go b/api/plex/plex_client/invoice/get_invoices_parameters.go new file mode 100644 index 0000000..5e78040 --- /dev/null +++ b/api/plex/plex_client/invoice/get_invoices_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" +) + +// NewGetInvoicesParams creates a new GetInvoicesParams object +// with the default values initialized. +func NewGetInvoicesParams() *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetInvoicesParamsWithTimeout creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetInvoicesParamsWithTimeout(timeout time.Duration) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: timeout, + } +} + +// NewGetInvoicesParamsWithContext creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetInvoicesParamsWithContext(ctx context.Context) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + Context: ctx, + } +} + +// NewGetInvoicesParamsWithHTTPClient creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetInvoicesParamsWithHTTPClient(client *http.Client) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + HTTPClient: client, + } +} + +/*GetInvoicesParams contains all the parameters to send to the API endpoint +for the get invoices operation typically these are written to a http.Request +*/ +type GetInvoicesParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Semiannual + The Semiannual Number (1,2) of the report + + */ + Semiannual *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) WithTimeout(timeout time.Duration) *GetInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get invoices params +func (o *GetInvoicesParams) WithContext(ctx context.Context) *GetInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get invoices params +func (o *GetInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) WithHTTPClient(client *http.Client) *GetInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get invoices params +func (o *GetInvoicesParams) WithAccountID(accountID *string) *GetInvoicesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get invoices params +func (o *GetInvoicesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get invoices params +func (o *GetInvoicesParams) WithMonth(month *int64) *GetInvoicesParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get invoices params +func (o *GetInvoicesParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get invoices params +func (o *GetInvoicesParams) WithQuarter(quarter *int64) *GetInvoicesParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get invoices params +func (o *GetInvoicesParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithSemiannual adds the semiannual to the get invoices params +func (o *GetInvoicesParams) WithSemiannual(semiannual *int64) *GetInvoicesParams { + o.SetSemiannual(semiannual) + return o +} + +// SetSemiannual adds the semiannual to the get invoices params +func (o *GetInvoicesParams) SetSemiannual(semiannual *int64) { + o.Semiannual = semiannual +} + +// WithYear adds the year to the get invoices params +func (o *GetInvoicesParams) WithYear(year *int64) *GetInvoicesParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get invoices params +func (o *GetInvoicesParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInvoicesParams) 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.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Semiannual != nil { + + // query param semiannual + var qrSemiannual int64 + if o.Semiannual != nil { + qrSemiannual = *o.Semiannual + } + qSemiannual := swag.FormatInt64(qrSemiannual) + if qSemiannual != "" { + if err := r.SetQueryParam("semiannual", qSemiannual); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/plex/plex_client/invoice/get_invoices_responses.go b/api/plex/plex_client/invoice/get_invoices_responses.go new file mode 100644 index 0000000..93b83b3 --- /dev/null +++ b/api/plex/plex_client/invoice/get_invoices_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" + + "github.com/taxnexus/go/lib/api/plex/plex_models" +) + +// GetInvoicesReader is a Reader for the GetInvoices structure. +type GetInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetInvoicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetInvoicesOK creates a GetInvoicesOK with default headers values +func NewGetInvoicesOK() *GetInvoicesOK { + return &GetInvoicesOK{} +} + +/*GetInvoicesOK handles this case with default header values. + +Taxnexus Response with TaxSummaryResponse Objects +*/ +type GetInvoicesOK struct { + Payload *plex_models.InvoiceSummaryResponse +} + +func (o *GetInvoicesOK) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesOK %+v", 200, o.Payload) +} + +func (o *GetInvoicesOK) GetPayload() *plex_models.InvoiceSummaryResponse { + return o.Payload +} + +func (o *GetInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.InvoiceSummaryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnauthorized creates a GetInvoicesUnauthorized with default headers values +func NewGetInvoicesUnauthorized() *GetInvoicesUnauthorized { + return &GetInvoicesUnauthorized{} +} + +/*GetInvoicesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetInvoicesUnauthorized struct { + Payload *plex_models.Error +} + +func (o *GetInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetInvoicesUnauthorized) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesForbidden creates a GetInvoicesForbidden with default headers values +func NewGetInvoicesForbidden() *GetInvoicesForbidden { + return &GetInvoicesForbidden{} +} + +/*GetInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetInvoicesForbidden struct { + Payload *plex_models.Error +} + +func (o *GetInvoicesForbidden) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *GetInvoicesForbidden) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesNotFound creates a GetInvoicesNotFound with default headers values +func NewGetInvoicesNotFound() *GetInvoicesNotFound { + return &GetInvoicesNotFound{} +} + +/*GetInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetInvoicesNotFound struct { + Payload *plex_models.Error +} + +func (o *GetInvoicesNotFound) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *GetInvoicesNotFound) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnprocessableEntity creates a GetInvoicesUnprocessableEntity with default headers values +func NewGetInvoicesUnprocessableEntity() *GetInvoicesUnprocessableEntity { + return &GetInvoicesUnprocessableEntity{} +} + +/*GetInvoicesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetInvoicesUnprocessableEntity struct { + Payload *plex_models.Error +} + +func (o *GetInvoicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetInvoicesUnprocessableEntity) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesInternalServerError creates a GetInvoicesInternalServerError with default headers values +func NewGetInvoicesInternalServerError() *GetInvoicesInternalServerError { + return &GetInvoicesInternalServerError{} +} + +/*GetInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetInvoicesInternalServerError struct { + Payload *plex_models.Error +} + +func (o *GetInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetInvoicesInternalServerError) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_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/plex/plex_client/invoice/get_medicinal_parameters.go b/api/plex/plex_client/invoice/get_medicinal_parameters.go new file mode 100644 index 0000000..2311e3a --- /dev/null +++ b/api/plex/plex_client/invoice/get_medicinal_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" +) + +// NewGetMedicinalParams creates a new GetMedicinalParams object +// with the default values initialized. +func NewGetMedicinalParams() *GetMedicinalParams { + var () + return &GetMedicinalParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetMedicinalParamsWithTimeout creates a new GetMedicinalParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetMedicinalParamsWithTimeout(timeout time.Duration) *GetMedicinalParams { + var () + return &GetMedicinalParams{ + + timeout: timeout, + } +} + +// NewGetMedicinalParamsWithContext creates a new GetMedicinalParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetMedicinalParamsWithContext(ctx context.Context) *GetMedicinalParams { + var () + return &GetMedicinalParams{ + + Context: ctx, + } +} + +// NewGetMedicinalParamsWithHTTPClient creates a new GetMedicinalParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetMedicinalParamsWithHTTPClient(client *http.Client) *GetMedicinalParams { + var () + return &GetMedicinalParams{ + HTTPClient: client, + } +} + +/*GetMedicinalParams contains all the parameters to send to the API endpoint +for the get medicinal operation typically these are written to a http.Request +*/ +type GetMedicinalParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Semiannual + The Semiannual Number (1,2) of the report + + */ + Semiannual *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get medicinal params +func (o *GetMedicinalParams) WithTimeout(timeout time.Duration) *GetMedicinalParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get medicinal params +func (o *GetMedicinalParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get medicinal params +func (o *GetMedicinalParams) WithContext(ctx context.Context) *GetMedicinalParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get medicinal params +func (o *GetMedicinalParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get medicinal params +func (o *GetMedicinalParams) WithHTTPClient(client *http.Client) *GetMedicinalParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get medicinal params +func (o *GetMedicinalParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get medicinal params +func (o *GetMedicinalParams) WithAccountID(accountID *string) *GetMedicinalParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get medicinal params +func (o *GetMedicinalParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get medicinal params +func (o *GetMedicinalParams) WithMonth(month *int64) *GetMedicinalParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get medicinal params +func (o *GetMedicinalParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get medicinal params +func (o *GetMedicinalParams) WithQuarter(quarter *int64) *GetMedicinalParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get medicinal params +func (o *GetMedicinalParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithSemiannual adds the semiannual to the get medicinal params +func (o *GetMedicinalParams) WithSemiannual(semiannual *int64) *GetMedicinalParams { + o.SetSemiannual(semiannual) + return o +} + +// SetSemiannual adds the semiannual to the get medicinal params +func (o *GetMedicinalParams) SetSemiannual(semiannual *int64) { + o.Semiannual = semiannual +} + +// WithYear adds the year to the get medicinal params +func (o *GetMedicinalParams) WithYear(year *int64) *GetMedicinalParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get medicinal params +func (o *GetMedicinalParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMedicinalParams) 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.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Semiannual != nil { + + // query param semiannual + var qrSemiannual int64 + if o.Semiannual != nil { + qrSemiannual = *o.Semiannual + } + qSemiannual := swag.FormatInt64(qrSemiannual) + if qSemiannual != "" { + if err := r.SetQueryParam("semiannual", qSemiannual); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/plex/plex_client/invoice/get_medicinal_responses.go b/api/plex/plex_client/invoice/get_medicinal_responses.go new file mode 100644 index 0000000..2ca7bd9 --- /dev/null +++ b/api/plex/plex_client/invoice/get_medicinal_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" + + "github.com/taxnexus/go/lib/api/plex/plex_models" +) + +// GetMedicinalReader is a Reader for the GetMedicinal structure. +type GetMedicinalReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMedicinalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMedicinalOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetMedicinalUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetMedicinalForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetMedicinalNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetMedicinalUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetMedicinalInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetMedicinalOK creates a GetMedicinalOK with default headers values +func NewGetMedicinalOK() *GetMedicinalOK { + return &GetMedicinalOK{} +} + +/*GetMedicinalOK handles this case with default header values. + +Taxnexus Response with TaxSummaryResponse Objects +*/ +type GetMedicinalOK struct { + Payload *plex_models.InvoiceSummaryResponse +} + +func (o *GetMedicinalOK) Error() string { + return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalOK %+v", 200, o.Payload) +} + +func (o *GetMedicinalOK) GetPayload() *plex_models.InvoiceSummaryResponse { + return o.Payload +} + +func (o *GetMedicinalOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.InvoiceSummaryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMedicinalUnauthorized creates a GetMedicinalUnauthorized with default headers values +func NewGetMedicinalUnauthorized() *GetMedicinalUnauthorized { + return &GetMedicinalUnauthorized{} +} + +/*GetMedicinalUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetMedicinalUnauthorized struct { + Payload *plex_models.Error +} + +func (o *GetMedicinalUnauthorized) Error() string { + return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMedicinalUnauthorized) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetMedicinalUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMedicinalForbidden creates a GetMedicinalForbidden with default headers values +func NewGetMedicinalForbidden() *GetMedicinalForbidden { + return &GetMedicinalForbidden{} +} + +/*GetMedicinalForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetMedicinalForbidden struct { + Payload *plex_models.Error +} + +func (o *GetMedicinalForbidden) Error() string { + return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalForbidden %+v", 403, o.Payload) +} + +func (o *GetMedicinalForbidden) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetMedicinalForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMedicinalNotFound creates a GetMedicinalNotFound with default headers values +func NewGetMedicinalNotFound() *GetMedicinalNotFound { + return &GetMedicinalNotFound{} +} + +/*GetMedicinalNotFound handles this case with default header values. + +Resource was not found +*/ +type GetMedicinalNotFound struct { + Payload *plex_models.Error +} + +func (o *GetMedicinalNotFound) Error() string { + return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalNotFound %+v", 404, o.Payload) +} + +func (o *GetMedicinalNotFound) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetMedicinalNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMedicinalUnprocessableEntity creates a GetMedicinalUnprocessableEntity with default headers values +func NewGetMedicinalUnprocessableEntity() *GetMedicinalUnprocessableEntity { + return &GetMedicinalUnprocessableEntity{} +} + +/*GetMedicinalUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetMedicinalUnprocessableEntity struct { + Payload *plex_models.Error +} + +func (o *GetMedicinalUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetMedicinalUnprocessableEntity) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetMedicinalUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMedicinalInternalServerError creates a GetMedicinalInternalServerError with default headers values +func NewGetMedicinalInternalServerError() *GetMedicinalInternalServerError { + return &GetMedicinalInternalServerError{} +} + +/*GetMedicinalInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetMedicinalInternalServerError struct { + Payload *plex_models.Error +} + +func (o *GetMedicinalInternalServerError) Error() string { + return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMedicinalInternalServerError) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetMedicinalInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_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/plex/plex_client/invoice/invoice_client.go b/api/plex/plex_client/invoice/invoice_client.go new file mode 100644 index 0000000..dabfe71 --- /dev/null +++ b/api/plex/plex_client/invoice/invoice_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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 invoice API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for invoice API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) + + GetMedicinal(params *GetMedicinalParams, authInfo runtime.ClientAuthInfoWriter) (*GetMedicinalOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetInvoices returns invoice summaries by month + + Return invoice summaries by month for an Account +*/ +func (a *Client) GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getInvoices", + Method: "GET", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetInvoicesOK) + 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 getInvoices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetMedicinal returns medicinal revenue summary by period specified + + Return medicinal revenue summary by period specified +*/ +func (a *Client) GetMedicinal(params *GetMedicinalParams, authInfo runtime.ClientAuthInfoWriter) (*GetMedicinalOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMedicinalParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getMedicinal", + Method: "GET", + PathPattern: "/invoices/medicinal", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetMedicinalReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetMedicinalOK) + 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 getMedicinal: 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/plex/plex_client/invoice_item/get_invoiceitems_parameters.go b/api/plex/plex_client/invoice_item/get_invoiceitems_parameters.go new file mode 100644 index 0000000..318ef69 --- /dev/null +++ b/api/plex/plex_client/invoice_item/get_invoiceitems_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice_item + +// 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" +) + +// NewGetInvoiceitemsParams creates a new GetInvoiceitemsParams object +// with the default values initialized. +func NewGetInvoiceitemsParams() *GetInvoiceitemsParams { + var () + return &GetInvoiceitemsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetInvoiceitemsParamsWithTimeout creates a new GetInvoiceitemsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetInvoiceitemsParamsWithTimeout(timeout time.Duration) *GetInvoiceitemsParams { + var () + return &GetInvoiceitemsParams{ + + timeout: timeout, + } +} + +// NewGetInvoiceitemsParamsWithContext creates a new GetInvoiceitemsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetInvoiceitemsParamsWithContext(ctx context.Context) *GetInvoiceitemsParams { + var () + return &GetInvoiceitemsParams{ + + Context: ctx, + } +} + +// NewGetInvoiceitemsParamsWithHTTPClient creates a new GetInvoiceitemsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetInvoiceitemsParamsWithHTTPClient(client *http.Client) *GetInvoiceitemsParams { + var () + return &GetInvoiceitemsParams{ + HTTPClient: client, + } +} + +/*GetInvoiceitemsParams contains all the parameters to send to the API endpoint +for the get invoiceitems operation typically these are written to a http.Request +*/ +type GetInvoiceitemsParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Semiannual + The Semiannual Number (1,2) of the report + + */ + Semiannual *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithTimeout(timeout time.Duration) *GetInvoiceitemsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithContext(ctx context.Context) *GetInvoiceitemsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithHTTPClient(client *http.Client) *GetInvoiceitemsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithAccountID(accountID *string) *GetInvoiceitemsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithMonth(month *int64) *GetInvoiceitemsParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithQuarter(quarter *int64) *GetInvoiceitemsParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithSemiannual adds the semiannual to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithSemiannual(semiannual *int64) *GetInvoiceitemsParams { + o.SetSemiannual(semiannual) + return o +} + +// SetSemiannual adds the semiannual to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetSemiannual(semiannual *int64) { + o.Semiannual = semiannual +} + +// WithYear adds the year to the get invoiceitems params +func (o *GetInvoiceitemsParams) WithYear(year *int64) *GetInvoiceitemsParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get invoiceitems params +func (o *GetInvoiceitemsParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInvoiceitemsParams) 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.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Semiannual != nil { + + // query param semiannual + var qrSemiannual int64 + if o.Semiannual != nil { + qrSemiannual = *o.Semiannual + } + qSemiannual := swag.FormatInt64(qrSemiannual) + if qSemiannual != "" { + if err := r.SetQueryParam("semiannual", qSemiannual); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/plex/plex_client/invoice_item/get_invoiceitems_responses.go b/api/plex/plex_client/invoice_item/get_invoiceitems_responses.go new file mode 100644 index 0000000..c91278d --- /dev/null +++ b/api/plex/plex_client/invoice_item/get_invoiceitems_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice_item + +// 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" + + "github.com/taxnexus/go/lib/api/plex/plex_models" +) + +// GetInvoiceitemsReader is a Reader for the GetInvoiceitems structure. +type GetInvoiceitemsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInvoiceitemsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInvoiceitemsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetInvoiceitemsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetInvoiceitemsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetInvoiceitemsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetInvoiceitemsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetInvoiceitemsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetInvoiceitemsOK creates a GetInvoiceitemsOK with default headers values +func NewGetInvoiceitemsOK() *GetInvoiceitemsOK { + return &GetInvoiceitemsOK{} +} + +/*GetInvoiceitemsOK handles this case with default header values. + +Taxnexus Response with TaxSummaryResponse Objects +*/ +type GetInvoiceitemsOK struct { + Payload *plex_models.InvoiceItemSummaryResponse +} + +func (o *GetInvoiceitemsOK) Error() string { + return fmt.Sprintf("[GET /invoiceitems][%d] getInvoiceitemsOK %+v", 200, o.Payload) +} + +func (o *GetInvoiceitemsOK) GetPayload() *plex_models.InvoiceItemSummaryResponse { + return o.Payload +} + +func (o *GetInvoiceitemsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.InvoiceItemSummaryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoiceitemsUnauthorized creates a GetInvoiceitemsUnauthorized with default headers values +func NewGetInvoiceitemsUnauthorized() *GetInvoiceitemsUnauthorized { + return &GetInvoiceitemsUnauthorized{} +} + +/*GetInvoiceitemsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetInvoiceitemsUnauthorized struct { + Payload *plex_models.Error +} + +func (o *GetInvoiceitemsUnauthorized) Error() string { + return fmt.Sprintf("[GET /invoiceitems][%d] getInvoiceitemsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetInvoiceitemsUnauthorized) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoiceitemsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoiceitemsForbidden creates a GetInvoiceitemsForbidden with default headers values +func NewGetInvoiceitemsForbidden() *GetInvoiceitemsForbidden { + return &GetInvoiceitemsForbidden{} +} + +/*GetInvoiceitemsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetInvoiceitemsForbidden struct { + Payload *plex_models.Error +} + +func (o *GetInvoiceitemsForbidden) Error() string { + return fmt.Sprintf("[GET /invoiceitems][%d] getInvoiceitemsForbidden %+v", 403, o.Payload) +} + +func (o *GetInvoiceitemsForbidden) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoiceitemsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoiceitemsNotFound creates a GetInvoiceitemsNotFound with default headers values +func NewGetInvoiceitemsNotFound() *GetInvoiceitemsNotFound { + return &GetInvoiceitemsNotFound{} +} + +/*GetInvoiceitemsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetInvoiceitemsNotFound struct { + Payload *plex_models.Error +} + +func (o *GetInvoiceitemsNotFound) Error() string { + return fmt.Sprintf("[GET /invoiceitems][%d] getInvoiceitemsNotFound %+v", 404, o.Payload) +} + +func (o *GetInvoiceitemsNotFound) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoiceitemsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoiceitemsUnprocessableEntity creates a GetInvoiceitemsUnprocessableEntity with default headers values +func NewGetInvoiceitemsUnprocessableEntity() *GetInvoiceitemsUnprocessableEntity { + return &GetInvoiceitemsUnprocessableEntity{} +} + +/*GetInvoiceitemsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetInvoiceitemsUnprocessableEntity struct { + Payload *plex_models.Error +} + +func (o *GetInvoiceitemsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /invoiceitems][%d] getInvoiceitemsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetInvoiceitemsUnprocessableEntity) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoiceitemsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoiceitemsInternalServerError creates a GetInvoiceitemsInternalServerError with default headers values +func NewGetInvoiceitemsInternalServerError() *GetInvoiceitemsInternalServerError { + return &GetInvoiceitemsInternalServerError{} +} + +/*GetInvoiceitemsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetInvoiceitemsInternalServerError struct { + Payload *plex_models.Error +} + +func (o *GetInvoiceitemsInternalServerError) Error() string { + return fmt.Sprintf("[GET /invoiceitems][%d] getInvoiceitemsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetInvoiceitemsInternalServerError) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetInvoiceitemsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_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/plex/plex_client/invoice_item/invoice_item_client.go b/api/plex/plex_client/invoice_item/invoice_item_client.go new file mode 100644 index 0000000..f499feb --- /dev/null +++ b/api/plex/plex_client/invoice_item/invoice_item_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice_item + +// 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 invoice item API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for invoice item API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetInvoiceitems(params *GetInvoiceitemsParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoiceitemsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetInvoiceitems returns invoice item summaries by month + + Return invoiceitem summaries by month for an Account +*/ +func (a *Client) GetInvoiceitems(params *GetInvoiceitemsParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoiceitemsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInvoiceitemsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getInvoiceitems", + Method: "GET", + PathPattern: "/invoiceitems", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetInvoiceitemsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetInvoiceitemsOK) + 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 getInvoiceitems: 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/plex/plex_client/plex_client.go b/api/plex/plex_client/plex_client.go new file mode 100644 index 0000000..cc49f87 --- /dev/null +++ b/api/plex/plex_client/plex_client.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_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" + + "github.com/taxnexus/go/lib/api/plex/plex_client/invoice" + "github.com/taxnexus/go/lib/api/plex/plex_client/invoice_item" + "github.com/taxnexus/go/lib/api/plex/plex_client/tax" +) + +// Default plex HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "plex.fabric.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 plex HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Plex { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new plex HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Plex { + // 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 plex client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Plex { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Plex) + cli.Transport = transport + cli.Invoice = invoice.New(transport, formats) + cli.InvoiceItem = invoice_item.New(transport, formats) + cli.Tax = tax.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 +} + +// Plex is a client for plex +type Plex struct { + Invoice invoice.ClientService + + InvoiceItem invoice_item.ClientService + + Tax tax.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Plex) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Invoice.SetTransport(transport) + c.InvoiceItem.SetTransport(transport) + c.Tax.SetTransport(transport) +} diff --git a/api/plex/plex_client/tax/get_district_taxes_parameters.go b/api/plex/plex_client/tax/get_district_taxes_parameters.go new file mode 100644 index 0000000..889d62b --- /dev/null +++ b/api/plex/plex_client/tax/get_district_taxes_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" +) + +// NewGetDistrictTaxesParams creates a new GetDistrictTaxesParams object +// with the default values initialized. +func NewGetDistrictTaxesParams() *GetDistrictTaxesParams { + var () + return &GetDistrictTaxesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDistrictTaxesParamsWithTimeout creates a new GetDistrictTaxesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDistrictTaxesParamsWithTimeout(timeout time.Duration) *GetDistrictTaxesParams { + var () + return &GetDistrictTaxesParams{ + + timeout: timeout, + } +} + +// NewGetDistrictTaxesParamsWithContext creates a new GetDistrictTaxesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDistrictTaxesParamsWithContext(ctx context.Context) *GetDistrictTaxesParams { + var () + return &GetDistrictTaxesParams{ + + Context: ctx, + } +} + +// NewGetDistrictTaxesParamsWithHTTPClient creates a new GetDistrictTaxesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDistrictTaxesParamsWithHTTPClient(client *http.Client) *GetDistrictTaxesParams { + var () + return &GetDistrictTaxesParams{ + HTTPClient: client, + } +} + +/*GetDistrictTaxesParams contains all the parameters to send to the API endpoint +for the get district taxes operation typically these are written to a http.Request +*/ +type GetDistrictTaxesParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Semiannual + The Semiannual Number (1,2) of the report + + */ + Semiannual *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get district taxes params +func (o *GetDistrictTaxesParams) WithTimeout(timeout time.Duration) *GetDistrictTaxesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get district taxes params +func (o *GetDistrictTaxesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get district taxes params +func (o *GetDistrictTaxesParams) WithContext(ctx context.Context) *GetDistrictTaxesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get district taxes params +func (o *GetDistrictTaxesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get district taxes params +func (o *GetDistrictTaxesParams) WithHTTPClient(client *http.Client) *GetDistrictTaxesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get district taxes params +func (o *GetDistrictTaxesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get district taxes params +func (o *GetDistrictTaxesParams) WithAccountID(accountID *string) *GetDistrictTaxesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get district taxes params +func (o *GetDistrictTaxesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get district taxes params +func (o *GetDistrictTaxesParams) WithMonth(month *int64) *GetDistrictTaxesParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get district taxes params +func (o *GetDistrictTaxesParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get district taxes params +func (o *GetDistrictTaxesParams) WithQuarter(quarter *int64) *GetDistrictTaxesParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get district taxes params +func (o *GetDistrictTaxesParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithSemiannual adds the semiannual to the get district taxes params +func (o *GetDistrictTaxesParams) WithSemiannual(semiannual *int64) *GetDistrictTaxesParams { + o.SetSemiannual(semiannual) + return o +} + +// SetSemiannual adds the semiannual to the get district taxes params +func (o *GetDistrictTaxesParams) SetSemiannual(semiannual *int64) { + o.Semiannual = semiannual +} + +// WithYear adds the year to the get district taxes params +func (o *GetDistrictTaxesParams) WithYear(year *int64) *GetDistrictTaxesParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get district taxes params +func (o *GetDistrictTaxesParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDistrictTaxesParams) 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.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Semiannual != nil { + + // query param semiannual + var qrSemiannual int64 + if o.Semiannual != nil { + qrSemiannual = *o.Semiannual + } + qSemiannual := swag.FormatInt64(qrSemiannual) + if qSemiannual != "" { + if err := r.SetQueryParam("semiannual", qSemiannual); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/plex/plex_client/tax/get_district_taxes_responses.go b/api/plex/plex_client/tax/get_district_taxes_responses.go new file mode 100644 index 0000000..0591186 --- /dev/null +++ b/api/plex/plex_client/tax/get_district_taxes_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/plex/plex_models" +) + +// GetDistrictTaxesReader is a Reader for the GetDistrictTaxes structure. +type GetDistrictTaxesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDistrictTaxesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDistrictTaxesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDistrictTaxesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDistrictTaxesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDistrictTaxesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDistrictTaxesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDistrictTaxesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetDistrictTaxesOK creates a GetDistrictTaxesOK with default headers values +func NewGetDistrictTaxesOK() *GetDistrictTaxesOK { + return &GetDistrictTaxesOK{} +} + +/*GetDistrictTaxesOK handles this case with default header values. + +Taxnexus Response with TaxSummaryResponse Objects +*/ +type GetDistrictTaxesOK struct { + Payload *plex_models.TaxSummaryResponse +} + +func (o *GetDistrictTaxesOK) Error() string { + return fmt.Sprintf("[GET /taxes/districts][%d] getDistrictTaxesOK %+v", 200, o.Payload) +} + +func (o *GetDistrictTaxesOK) GetPayload() *plex_models.TaxSummaryResponse { + return o.Payload +} + +func (o *GetDistrictTaxesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.TaxSummaryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDistrictTaxesUnauthorized creates a GetDistrictTaxesUnauthorized with default headers values +func NewGetDistrictTaxesUnauthorized() *GetDistrictTaxesUnauthorized { + return &GetDistrictTaxesUnauthorized{} +} + +/*GetDistrictTaxesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetDistrictTaxesUnauthorized struct { + Payload *plex_models.Error +} + +func (o *GetDistrictTaxesUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxes/districts][%d] getDistrictTaxesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetDistrictTaxesUnauthorized) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetDistrictTaxesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDistrictTaxesForbidden creates a GetDistrictTaxesForbidden with default headers values +func NewGetDistrictTaxesForbidden() *GetDistrictTaxesForbidden { + return &GetDistrictTaxesForbidden{} +} + +/*GetDistrictTaxesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetDistrictTaxesForbidden struct { + Payload *plex_models.Error +} + +func (o *GetDistrictTaxesForbidden) Error() string { + return fmt.Sprintf("[GET /taxes/districts][%d] getDistrictTaxesForbidden %+v", 403, o.Payload) +} + +func (o *GetDistrictTaxesForbidden) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetDistrictTaxesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDistrictTaxesNotFound creates a GetDistrictTaxesNotFound with default headers values +func NewGetDistrictTaxesNotFound() *GetDistrictTaxesNotFound { + return &GetDistrictTaxesNotFound{} +} + +/*GetDistrictTaxesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetDistrictTaxesNotFound struct { + Payload *plex_models.Error +} + +func (o *GetDistrictTaxesNotFound) Error() string { + return fmt.Sprintf("[GET /taxes/districts][%d] getDistrictTaxesNotFound %+v", 404, o.Payload) +} + +func (o *GetDistrictTaxesNotFound) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetDistrictTaxesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDistrictTaxesUnprocessableEntity creates a GetDistrictTaxesUnprocessableEntity with default headers values +func NewGetDistrictTaxesUnprocessableEntity() *GetDistrictTaxesUnprocessableEntity { + return &GetDistrictTaxesUnprocessableEntity{} +} + +/*GetDistrictTaxesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDistrictTaxesUnprocessableEntity struct { + Payload *plex_models.Error +} + +func (o *GetDistrictTaxesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxes/districts][%d] getDistrictTaxesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetDistrictTaxesUnprocessableEntity) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetDistrictTaxesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDistrictTaxesInternalServerError creates a GetDistrictTaxesInternalServerError with default headers values +func NewGetDistrictTaxesInternalServerError() *GetDistrictTaxesInternalServerError { + return &GetDistrictTaxesInternalServerError{} +} + +/*GetDistrictTaxesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetDistrictTaxesInternalServerError struct { + Payload *plex_models.Error +} + +func (o *GetDistrictTaxesInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxes/districts][%d] getDistrictTaxesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDistrictTaxesInternalServerError) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetDistrictTaxesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_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/plex/plex_client/tax/get_sales_and_use_tax_return_parameters.go b/api/plex/plex_client/tax/get_sales_and_use_tax_return_parameters.go new file mode 100644 index 0000000..ad78f18 --- /dev/null +++ b/api/plex/plex_client/tax/get_sales_and_use_tax_return_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" +) + +// NewGetSalesAndUseTaxReturnParams creates a new GetSalesAndUseTaxReturnParams object +// with the default values initialized. +func NewGetSalesAndUseTaxReturnParams() *GetSalesAndUseTaxReturnParams { + var () + return &GetSalesAndUseTaxReturnParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSalesAndUseTaxReturnParamsWithTimeout creates a new GetSalesAndUseTaxReturnParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSalesAndUseTaxReturnParamsWithTimeout(timeout time.Duration) *GetSalesAndUseTaxReturnParams { + var () + return &GetSalesAndUseTaxReturnParams{ + + timeout: timeout, + } +} + +// NewGetSalesAndUseTaxReturnParamsWithContext creates a new GetSalesAndUseTaxReturnParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSalesAndUseTaxReturnParamsWithContext(ctx context.Context) *GetSalesAndUseTaxReturnParams { + var () + return &GetSalesAndUseTaxReturnParams{ + + Context: ctx, + } +} + +// NewGetSalesAndUseTaxReturnParamsWithHTTPClient creates a new GetSalesAndUseTaxReturnParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSalesAndUseTaxReturnParamsWithHTTPClient(client *http.Client) *GetSalesAndUseTaxReturnParams { + var () + return &GetSalesAndUseTaxReturnParams{ + HTTPClient: client, + } +} + +/*GetSalesAndUseTaxReturnParams contains all the parameters to send to the API endpoint +for the get sales and use tax return operation typically these are written to a http.Request +*/ +type GetSalesAndUseTaxReturnParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Semiannual + The Semiannual Number (1,2) of the report + + */ + Semiannual *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithTimeout(timeout time.Duration) *GetSalesAndUseTaxReturnParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithContext(ctx context.Context) *GetSalesAndUseTaxReturnParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithHTTPClient(client *http.Client) *GetSalesAndUseTaxReturnParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithAccountID(accountID *string) *GetSalesAndUseTaxReturnParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithMonth(month *int64) *GetSalesAndUseTaxReturnParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithQuarter(quarter *int64) *GetSalesAndUseTaxReturnParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithSemiannual adds the semiannual to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithSemiannual(semiannual *int64) *GetSalesAndUseTaxReturnParams { + o.SetSemiannual(semiannual) + return o +} + +// SetSemiannual adds the semiannual to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetSemiannual(semiannual *int64) { + o.Semiannual = semiannual +} + +// WithYear adds the year to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) WithYear(year *int64) *GetSalesAndUseTaxReturnParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get sales and use tax return params +func (o *GetSalesAndUseTaxReturnParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSalesAndUseTaxReturnParams) 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.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Semiannual != nil { + + // query param semiannual + var qrSemiannual int64 + if o.Semiannual != nil { + qrSemiannual = *o.Semiannual + } + qSemiannual := swag.FormatInt64(qrSemiannual) + if qSemiannual != "" { + if err := r.SetQueryParam("semiannual", qSemiannual); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/plex/plex_client/tax/get_sales_and_use_tax_return_responses.go b/api/plex/plex_client/tax/get_sales_and_use_tax_return_responses.go new file mode 100644 index 0000000..9f972b0 --- /dev/null +++ b/api/plex/plex_client/tax/get_sales_and_use_tax_return_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/plex/plex_models" +) + +// GetSalesAndUseTaxReturnReader is a Reader for the GetSalesAndUseTaxReturn structure. +type GetSalesAndUseTaxReturnReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSalesAndUseTaxReturnReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSalesAndUseTaxReturnOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSalesAndUseTaxReturnUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSalesAndUseTaxReturnForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSalesAndUseTaxReturnNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetSalesAndUseTaxReturnUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSalesAndUseTaxReturnInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSalesAndUseTaxReturnOK creates a GetSalesAndUseTaxReturnOK with default headers values +func NewGetSalesAndUseTaxReturnOK() *GetSalesAndUseTaxReturnOK { + return &GetSalesAndUseTaxReturnOK{} +} + +/*GetSalesAndUseTaxReturnOK handles this case with default header values. + +The California CDTFA Sales and Use Tax Return +*/ +type GetSalesAndUseTaxReturnOK struct { + Payload *plex_models.TaxReturnResponse +} + +func (o *GetSalesAndUseTaxReturnOK) Error() string { + return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnOK %+v", 200, o.Payload) +} + +func (o *GetSalesAndUseTaxReturnOK) GetPayload() *plex_models.TaxReturnResponse { + return o.Payload +} + +func (o *GetSalesAndUseTaxReturnOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.TaxReturnResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesAndUseTaxReturnUnauthorized creates a GetSalesAndUseTaxReturnUnauthorized with default headers values +func NewGetSalesAndUseTaxReturnUnauthorized() *GetSalesAndUseTaxReturnUnauthorized { + return &GetSalesAndUseTaxReturnUnauthorized{} +} + +/*GetSalesAndUseTaxReturnUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetSalesAndUseTaxReturnUnauthorized struct { + Payload *plex_models.Error +} + +func (o *GetSalesAndUseTaxReturnUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSalesAndUseTaxReturnUnauthorized) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetSalesAndUseTaxReturnUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesAndUseTaxReturnForbidden creates a GetSalesAndUseTaxReturnForbidden with default headers values +func NewGetSalesAndUseTaxReturnForbidden() *GetSalesAndUseTaxReturnForbidden { + return &GetSalesAndUseTaxReturnForbidden{} +} + +/*GetSalesAndUseTaxReturnForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSalesAndUseTaxReturnForbidden struct { + Payload *plex_models.Error +} + +func (o *GetSalesAndUseTaxReturnForbidden) Error() string { + return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnForbidden %+v", 403, o.Payload) +} + +func (o *GetSalesAndUseTaxReturnForbidden) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetSalesAndUseTaxReturnForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesAndUseTaxReturnNotFound creates a GetSalesAndUseTaxReturnNotFound with default headers values +func NewGetSalesAndUseTaxReturnNotFound() *GetSalesAndUseTaxReturnNotFound { + return &GetSalesAndUseTaxReturnNotFound{} +} + +/*GetSalesAndUseTaxReturnNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSalesAndUseTaxReturnNotFound struct { + Payload *plex_models.Error +} + +func (o *GetSalesAndUseTaxReturnNotFound) Error() string { + return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnNotFound %+v", 404, o.Payload) +} + +func (o *GetSalesAndUseTaxReturnNotFound) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetSalesAndUseTaxReturnNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesAndUseTaxReturnUnprocessableEntity creates a GetSalesAndUseTaxReturnUnprocessableEntity with default headers values +func NewGetSalesAndUseTaxReturnUnprocessableEntity() *GetSalesAndUseTaxReturnUnprocessableEntity { + return &GetSalesAndUseTaxReturnUnprocessableEntity{} +} + +/*GetSalesAndUseTaxReturnUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetSalesAndUseTaxReturnUnprocessableEntity struct { + Payload *plex_models.Error +} + +func (o *GetSalesAndUseTaxReturnUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetSalesAndUseTaxReturnUnprocessableEntity) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetSalesAndUseTaxReturnUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSalesAndUseTaxReturnInternalServerError creates a GetSalesAndUseTaxReturnInternalServerError with default headers values +func NewGetSalesAndUseTaxReturnInternalServerError() *GetSalesAndUseTaxReturnInternalServerError { + return &GetSalesAndUseTaxReturnInternalServerError{} +} + +/*GetSalesAndUseTaxReturnInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSalesAndUseTaxReturnInternalServerError struct { + Payload *plex_models.Error +} + +func (o *GetSalesAndUseTaxReturnInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSalesAndUseTaxReturnInternalServerError) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetSalesAndUseTaxReturnInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_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/plex/plex_client/tax/get_use_tax_parameters.go b/api/plex/plex_client/tax/get_use_tax_parameters.go new file mode 100644 index 0000000..f2ccddf --- /dev/null +++ b/api/plex/plex_client/tax/get_use_tax_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" +) + +// NewGetUseTaxParams creates a new GetUseTaxParams object +// with the default values initialized. +func NewGetUseTaxParams() *GetUseTaxParams { + var () + return &GetUseTaxParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUseTaxParamsWithTimeout creates a new GetUseTaxParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUseTaxParamsWithTimeout(timeout time.Duration) *GetUseTaxParams { + var () + return &GetUseTaxParams{ + + timeout: timeout, + } +} + +// NewGetUseTaxParamsWithContext creates a new GetUseTaxParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUseTaxParamsWithContext(ctx context.Context) *GetUseTaxParams { + var () + return &GetUseTaxParams{ + + Context: ctx, + } +} + +// NewGetUseTaxParamsWithHTTPClient creates a new GetUseTaxParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUseTaxParamsWithHTTPClient(client *http.Client) *GetUseTaxParams { + var () + return &GetUseTaxParams{ + HTTPClient: client, + } +} + +/*GetUseTaxParams contains all the parameters to send to the API endpoint +for the get use tax operation typically these are written to a http.Request +*/ +type GetUseTaxParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Semiannual + The Semiannual Number (1,2) of the report + + */ + Semiannual *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get use tax params +func (o *GetUseTaxParams) WithTimeout(timeout time.Duration) *GetUseTaxParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get use tax params +func (o *GetUseTaxParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get use tax params +func (o *GetUseTaxParams) WithContext(ctx context.Context) *GetUseTaxParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get use tax params +func (o *GetUseTaxParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get use tax params +func (o *GetUseTaxParams) WithHTTPClient(client *http.Client) *GetUseTaxParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get use tax params +func (o *GetUseTaxParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get use tax params +func (o *GetUseTaxParams) WithAccountID(accountID *string) *GetUseTaxParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get use tax params +func (o *GetUseTaxParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get use tax params +func (o *GetUseTaxParams) WithMonth(month *int64) *GetUseTaxParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get use tax params +func (o *GetUseTaxParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get use tax params +func (o *GetUseTaxParams) WithQuarter(quarter *int64) *GetUseTaxParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get use tax params +func (o *GetUseTaxParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithSemiannual adds the semiannual to the get use tax params +func (o *GetUseTaxParams) WithSemiannual(semiannual *int64) *GetUseTaxParams { + o.SetSemiannual(semiannual) + return o +} + +// SetSemiannual adds the semiannual to the get use tax params +func (o *GetUseTaxParams) SetSemiannual(semiannual *int64) { + o.Semiannual = semiannual +} + +// WithYear adds the year to the get use tax params +func (o *GetUseTaxParams) WithYear(year *int64) *GetUseTaxParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get use tax params +func (o *GetUseTaxParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUseTaxParams) 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.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Semiannual != nil { + + // query param semiannual + var qrSemiannual int64 + if o.Semiannual != nil { + qrSemiannual = *o.Semiannual + } + qSemiannual := swag.FormatInt64(qrSemiannual) + if qSemiannual != "" { + if err := r.SetQueryParam("semiannual", qSemiannual); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/plex/plex_client/tax/get_use_tax_responses.go b/api/plex/plex_client/tax/get_use_tax_responses.go new file mode 100644 index 0000000..76adebd --- /dev/null +++ b/api/plex/plex_client/tax/get_use_tax_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/plex/plex_models" +) + +// GetUseTaxReader is a Reader for the GetUseTax structure. +type GetUseTaxReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUseTaxReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUseTaxOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetUseTaxUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetUseTaxForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetUseTaxNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetUseTaxUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetUseTaxInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetUseTaxOK creates a GetUseTaxOK with default headers values +func NewGetUseTaxOK() *GetUseTaxOK { + return &GetUseTaxOK{} +} + +/*GetUseTaxOK handles this case with default header values. + +Taxnexus Response with TaxSummaryResponse Objects +*/ +type GetUseTaxOK struct { + Payload *plex_models.UseTaxResponse +} + +func (o *GetUseTaxOK) Error() string { + return fmt.Sprintf("[GET /taxes/usetax][%d] getUseTaxOK %+v", 200, o.Payload) +} + +func (o *GetUseTaxOK) GetPayload() *plex_models.UseTaxResponse { + return o.Payload +} + +func (o *GetUseTaxOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.UseTaxResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUseTaxUnauthorized creates a GetUseTaxUnauthorized with default headers values +func NewGetUseTaxUnauthorized() *GetUseTaxUnauthorized { + return &GetUseTaxUnauthorized{} +} + +/*GetUseTaxUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetUseTaxUnauthorized struct { + Payload *plex_models.Error +} + +func (o *GetUseTaxUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxes/usetax][%d] getUseTaxUnauthorized %+v", 401, o.Payload) +} + +func (o *GetUseTaxUnauthorized) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetUseTaxUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUseTaxForbidden creates a GetUseTaxForbidden with default headers values +func NewGetUseTaxForbidden() *GetUseTaxForbidden { + return &GetUseTaxForbidden{} +} + +/*GetUseTaxForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetUseTaxForbidden struct { + Payload *plex_models.Error +} + +func (o *GetUseTaxForbidden) Error() string { + return fmt.Sprintf("[GET /taxes/usetax][%d] getUseTaxForbidden %+v", 403, o.Payload) +} + +func (o *GetUseTaxForbidden) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetUseTaxForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUseTaxNotFound creates a GetUseTaxNotFound with default headers values +func NewGetUseTaxNotFound() *GetUseTaxNotFound { + return &GetUseTaxNotFound{} +} + +/*GetUseTaxNotFound handles this case with default header values. + +Resource was not found +*/ +type GetUseTaxNotFound struct { + Payload *plex_models.Error +} + +func (o *GetUseTaxNotFound) Error() string { + return fmt.Sprintf("[GET /taxes/usetax][%d] getUseTaxNotFound %+v", 404, o.Payload) +} + +func (o *GetUseTaxNotFound) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetUseTaxNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUseTaxUnprocessableEntity creates a GetUseTaxUnprocessableEntity with default headers values +func NewGetUseTaxUnprocessableEntity() *GetUseTaxUnprocessableEntity { + return &GetUseTaxUnprocessableEntity{} +} + +/*GetUseTaxUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetUseTaxUnprocessableEntity struct { + Payload *plex_models.Error +} + +func (o *GetUseTaxUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxes/usetax][%d] getUseTaxUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetUseTaxUnprocessableEntity) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetUseTaxUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetUseTaxInternalServerError creates a GetUseTaxInternalServerError with default headers values +func NewGetUseTaxInternalServerError() *GetUseTaxInternalServerError { + return &GetUseTaxInternalServerError{} +} + +/*GetUseTaxInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetUseTaxInternalServerError struct { + Payload *plex_models.Error +} + +func (o *GetUseTaxInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxes/usetax][%d] getUseTaxInternalServerError %+v", 500, o.Payload) +} + +func (o *GetUseTaxInternalServerError) GetPayload() *plex_models.Error { + return o.Payload +} + +func (o *GetUseTaxInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(plex_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/plex/plex_client/tax/tax_client.go b/api/plex/plex_client/tax/tax_client.go new file mode 100644 index 0000000..4338ccf --- /dev/null +++ b/api/plex/plex_client/tax/tax_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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 tax API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetDistrictTaxes(params *GetDistrictTaxesParams, authInfo runtime.ClientAuthInfoWriter) (*GetDistrictTaxesOK, error) + + GetSalesAndUseTaxReturn(params *GetSalesAndUseTaxReturnParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesAndUseTaxReturnOK, error) + + GetUseTax(params *GetUseTaxParams, authInfo runtime.ClientAuthInfoWriter) (*GetUseTaxOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetDistrictTaxes returns summary tax reports for an account + + Return district summary tax reports for an Account +*/ +func (a *Client) GetDistrictTaxes(params *GetDistrictTaxesParams, authInfo runtime.ClientAuthInfoWriter) (*GetDistrictTaxesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDistrictTaxesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getDistrictTaxes", + Method: "GET", + PathPattern: "/taxes/districts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDistrictTaxesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetDistrictTaxesOK) + 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 getDistrictTaxes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSalesAndUseTaxReturn taxes return use tax summaries for an account + + Return CDTFA Sales & Use Tax Return +*/ +func (a *Client) GetSalesAndUseTaxReturn(params *GetSalesAndUseTaxReturnParams, authInfo runtime.ClientAuthInfoWriter) (*GetSalesAndUseTaxReturnOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSalesAndUseTaxReturnParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSalesAndUseTaxReturn", + Method: "GET", + PathPattern: "/taxreturns/salesanduse", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSalesAndUseTaxReturnReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSalesAndUseTaxReturnOK) + 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 getSalesAndUseTaxReturn: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetUseTax returns use tax summaries for an account + + Return use tax summaries for an Account +*/ +func (a *Client) GetUseTax(params *GetUseTaxParams, authInfo runtime.ClientAuthInfoWriter) (*GetUseTaxOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUseTaxParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getUseTax", + Method: "GET", + PathPattern: "/taxes/usetax", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetUseTaxReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetUseTaxOK) + 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 getUseTax: 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/plex/plex_models/additional_deductions.go b/api/plex/plex_models/additional_deductions.go new file mode 100644 index 0000000..157010d --- /dev/null +++ b/api/plex/plex_models/additional_deductions.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AdditionalDeductions additional deductions +// +// swagger:model AdditionalDeductions +type AdditionalDeductions struct { + + // amount + Amount float64 `json:"Amount,omitempty"` + + // description + Description string `json:"Description,omitempty"` + + // non taxable amount + NonTaxableAmount float64 `json:"NonTaxableAmount,omitempty"` +} + +// Validate validates this additional deductions +func (m *AdditionalDeductions) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AdditionalDeductions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AdditionalDeductions) UnmarshalBinary(b []byte) error { + var res AdditionalDeductions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/district_taxes.go b/api/plex/plex_models/district_taxes.go new file mode 100644 index 0000000..700f502 --- /dev/null +++ b/api/plex/plex_models/district_taxes.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DistrictTaxes district taxes +// +// swagger:model DistrictTaxes +type DistrictTaxes struct { + + // adjustments + Adjustments float64 `json:"Adjustments,omitempty"` + + // county + County string `json:"County,omitempty"` + + // district + District string `json:"District,omitempty"` + + // district tax due + DistrictTaxDue float64 `json:"DistrictTaxDue,omitempty"` + + // net taxable amount + NetTaxableAmount float64 `json:"NetTaxableAmount,omitempty"` + + // rate + Rate float64 `json:"Rate,omitempty"` + + // taxable amount + TaxableAmount float64 `json:"TaxableAmount,omitempty"` +} + +// Validate validates this district taxes +func (m *DistrictTaxes) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DistrictTaxes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DistrictTaxes) UnmarshalBinary(b []byte) error { + var res DistrictTaxes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/error.go b/api/plex/plex_models/error.go new file mode 100644 index 0000000..3c9fb21 --- /dev/null +++ b/api/plex/plex_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/plex/plex_models/invoice_item_summary.go b/api/plex/plex_models/invoice_item_summary.go new file mode 100644 index 0000000..c828905 --- /dev/null +++ b/api/plex/plex_models/invoice_item_summary.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceItemSummary invoice item summary +// +// swagger:model InvoiceItemSummary +type InvoiceItemSummary struct { + + // c o g s + COGS float64 `json:"COGS,omitempty"` + + // The Period Name of the summary line + PeriodName string `json:"PeriodName,omitempty"` + + // Taxnexus Geocode for this group of item summaries + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // shipping handling + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // taxnexus code + TaxnexusCode string `json:"TaxnexusCode,omitempty"` +} + +// Validate validates this invoice item summary +func (m *InvoiceItemSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InvoiceItemSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceItemSummary) UnmarshalBinary(b []byte) error { + var res InvoiceItemSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/invoice_item_summary_response.go b/api/plex/plex_models/invoice_item_summary_response.go new file mode 100644 index 0000000..3e18b3b --- /dev/null +++ b/api/plex/plex_models/invoice_item_summary_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceItemSummaryResponse An array of Invoice Item Summary Reporting Objects +// +// swagger:model InvoiceItemSummaryResponse +type InvoiceItemSummaryResponse struct { + + // data + Data []*InvoiceItemSummary `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this invoice item summary response +func (m *InvoiceItemSummaryResponse) 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 *InvoiceItemSummaryResponse) 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 *InvoiceItemSummaryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceItemSummaryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceItemSummaryResponse) UnmarshalBinary(b []byte) error { + var res InvoiceItemSummaryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/invoice_summary.go b/api/plex/plex_models/invoice_summary.go new file mode 100644 index 0000000..769d0aa --- /dev/null +++ b/api/plex/plex_models/invoice_summary.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceSummary invoice summary +// +// swagger:model InvoiceSummary +type InvoiceSummary struct { + + // amount + Amount float64 `json:"Amount,omitempty"` + + // business tax + BusinessTax float64 `json:"BusinessTax,omitempty"` + + // cannabis tax + CannabisTax float64 `json:"CannabisTax,omitempty"` + + // estimated amount + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // estimated business tax + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // estimated c o g s + EstimatedCOGS float64 `json:"EstimatedCOGS,omitempty"` + + // estimated cannabis tax + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // estimated discount + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // estimated sales tax + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // estimated subtotal + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // The Period Name of the summary line + PeriodName string `json:"PeriodName,omitempty"` + + // Taxnexus Geocode for this group of item summaries + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // sales regulation + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // sales tax + SalesTax float64 `json:"SalesTax,omitempty"` + + // subtotal + Subtotal float64 `json:"Subtotal,omitempty"` +} + +// Validate validates this invoice summary +func (m *InvoiceSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InvoiceSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceSummary) UnmarshalBinary(b []byte) error { + var res InvoiceSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/invoice_summary_response.go b/api/plex/plex_models/invoice_summary_response.go new file mode 100644 index 0000000..fda331f --- /dev/null +++ b/api/plex/plex_models/invoice_summary_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceSummaryResponse An array of Invoice Summary Reporting Objects +// +// swagger:model InvoiceSummaryResponse +type InvoiceSummaryResponse struct { + + // data + Data []*InvoiceSummary `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this invoice summary response +func (m *InvoiceSummaryResponse) 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 *InvoiceSummaryResponse) 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 *InvoiceSummaryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceSummaryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceSummaryResponse) UnmarshalBinary(b []byte) error { + var res InvoiceSummaryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/pagination.go b/api/plex/plex_models/pagination.go new file mode 100644 index 0000000..2fce4ce --- /dev/null +++ b/api/plex/plex_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // limit + Limit int64 `json:"Limit,omitempty"` + + // offset + Offset int64 `json:"Offset,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 +} + +// 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/plex/plex_models/request_meta.go b/api/plex/plex_models/request_meta.go new file mode 100644 index 0000000..068cfbe --- /dev/null +++ b/api/plex/plex_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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/plex/plex_models/response_meta.go b/api/plex/plex_models/response_meta.go new file mode 100644 index 0000000..246e11a --- /dev/null +++ b/api/plex/plex_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/plex/plex_models/tax_return.go b/api/plex/plex_models/tax_return.go new file mode 100644 index 0000000..0874416 --- /dev/null +++ b/api/plex/plex_models/tax_return.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxReturn tax return +// +// swagger:model TaxReturn +type TaxReturn struct { + + // additional deductions + AdditionalDeductions []*AdditionalDeductions `json:"AdditionalDeductions"` + + // additional deductions amount + AdditionalDeductionsAmount float64 `json:"AdditionalDeductionsAmount,omitempty"` + + // asset sales + AssetSales float64 `json:"AssetSales,omitempty"` + + // code + Code string `json:"Code,omitempty"` + + // county reports + CountyReports []*TaxReturnPanel `json:"CountyReports"` + + // district reports + DistrictReports []*TaxReturnPanel `json:"DistrictReports"` + + // district taxes + DistrictTaxes []*DistrictTaxes `json:"DistrictTaxes"` + + // estimated report + EstimatedReport *TaxReturnPanel `json:"EstimatedReport,omitempty"` + + // excess tax collected + ExcessTaxCollected float64 `json:"ExcessTaxCollected,omitempty"` + + // fixtures and equipment + FixturesAndEquipment float64 `json:"FixturesAndEquipment,omitempty"` + + // food sales + FoodSales float64 `json:"FoodSales,omitempty"` + + // gov sales + GovSales float64 `json:"GovSales,omitempty"` + + // interest + Interest float64 `json:"Interest,omitempty"` + + // interstate sales + InterstateSales float64 `json:"InterstateSales,omitempty"` + + // month + Month int64 `json:"Month,omitempty"` + + // name + Name string `json:"Name,omitempty"` + + // net taxable amount to be reported + NetTaxableAmountToBeReported float64 `json:"NetTaxableAmountToBeReported,omitempty"` + + // non taxable labor + NonTaxableLabor float64 `json:"NonTaxableLabor,omitempty"` + + // penalty + Penalty float64 `json:"Penalty,omitempty"` + + // period headers + PeriodHeaders []string `json:"PeriodHeaders"` + + // quarter + Quarter int64 `json:"Quarter,omitempty"` + + // remaining tax + RemainingTax float64 `json:"RemainingTax,omitempty"` + + // resale sales + ResaleSales float64 `json:"ResaleSales,omitempty"` + + // sales tax included + SalesTaxIncluded float64 `json:"SalesTaxIncluded,omitempty"` + + // summary report + SummaryReport *TaxReturnPanel `json:"SummaryReport,omitempty"` + + // tax due + TaxDue float64 `json:"TaxDue,omitempty"` + + // total sales + TotalSales float64 `json:"TotalSales,omitempty"` + + // total sales and purchases + TotalSalesAndPurchases float64 `json:"TotalSalesAndPurchases,omitempty"` + + // total tax + TotalTax float64 `json:"TotalTax,omitempty"` + + // total tax due before credits + TotalTaxDueBeforeCredits float64 `json:"TotalTaxDueBeforeCredits,omitempty"` + + // total tax prepayments + TotalTaxPrepayments float64 `json:"TotalTaxPrepayments,omitempty"` + + // use tax sales + UseTaxSales float64 `json:"UseTaxSales,omitempty"` + + // year + Year int64 `json:"Year,omitempty"` +} + +// Validate validates this tax return +func (m *TaxReturn) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdditionalDeductions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountyReports(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDistrictReports(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDistrictTaxes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEstimatedReport(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSummaryReport(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaxReturn) validateAdditionalDeductions(formats strfmt.Registry) error { + + if swag.IsZero(m.AdditionalDeductions) { // not required + return nil + } + + for i := 0; i < len(m.AdditionalDeductions); i++ { + if swag.IsZero(m.AdditionalDeductions[i]) { // not required + continue + } + + if m.AdditionalDeductions[i] != nil { + if err := m.AdditionalDeductions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AdditionalDeductions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TaxReturn) validateCountyReports(formats strfmt.Registry) error { + + if swag.IsZero(m.CountyReports) { // not required + return nil + } + + for i := 0; i < len(m.CountyReports); i++ { + if swag.IsZero(m.CountyReports[i]) { // not required + continue + } + + if m.CountyReports[i] != nil { + if err := m.CountyReports[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CountyReports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TaxReturn) validateDistrictReports(formats strfmt.Registry) error { + + if swag.IsZero(m.DistrictReports) { // not required + return nil + } + + for i := 0; i < len(m.DistrictReports); i++ { + if swag.IsZero(m.DistrictReports[i]) { // not required + continue + } + + if m.DistrictReports[i] != nil { + if err := m.DistrictReports[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DistrictReports" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TaxReturn) validateDistrictTaxes(formats strfmt.Registry) error { + + if swag.IsZero(m.DistrictTaxes) { // not required + return nil + } + + for i := 0; i < len(m.DistrictTaxes); i++ { + if swag.IsZero(m.DistrictTaxes[i]) { // not required + continue + } + + if m.DistrictTaxes[i] != nil { + if err := m.DistrictTaxes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DistrictTaxes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TaxReturn) validateEstimatedReport(formats strfmt.Registry) error { + + if swag.IsZero(m.EstimatedReport) { // not required + return nil + } + + if m.EstimatedReport != nil { + if err := m.EstimatedReport.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("EstimatedReport") + } + return err + } + } + + return nil +} + +func (m *TaxReturn) validateSummaryReport(formats strfmt.Registry) error { + + if swag.IsZero(m.SummaryReport) { // not required + return nil + } + + if m.SummaryReport != nil { + if err := m.SummaryReport.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SummaryReport") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaxReturn) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxReturn) UnmarshalBinary(b []byte) error { + var res TaxReturn + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/tax_return_panel.go b/api/plex/plex_models/tax_return_panel.go new file mode 100644 index 0000000..e832b1c --- /dev/null +++ b/api/plex/plex_models/tax_return_panel.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxReturnPanel tax return panel +// +// swagger:model TaxReturnPanel +type TaxReturnPanel struct { + + // business taxes + BusinessTaxes []float64 `json:"BusinessTaxes"` + + // business taxes total + BusinessTaxesTotal float64 `json:"BusinessTaxesTotal,omitempty"` + + // c o g s + COGS []float64 `json:"COGS"` + + // c o g s total + COGSTotal float64 `json:"COGSTotal,omitempty"` + + // cannabis revenue + CannabisRevenue []float64 `json:"CannabisRevenue"` + + // cannabis revenue total + CannabisRevenueTotal float64 `json:"CannabisRevenueTotal,omitempty"` + + // column headers + ColumnHeaders []string `json:"ColumnHeaders"` + + // county name + CountyName string `json:"CountyName,omitempty"` + + // county sales tax rate + CountySalesTaxRate float64 `json:"CountySalesTaxRate,omitempty"` + + // district combined rate + DistrictCombinedRate float64 `json:"DistrictCombinedRate,omitempty"` + + // district sales tax rate + DistrictSalesTaxRate float64 `json:"DistrictSalesTaxRate,omitempty"` + + // district type + DistrictType string `json:"DistrictType,omitempty"` + + // excise taxes + ExciseTaxes []float64 `json:"ExciseTaxes"` + + // excise taxes total + ExciseTaxesTotal float64 `json:"ExciseTaxesTotal,omitempty"` + + // geocode + Geocode string `json:"Geocode,omitempty"` + + // has district taxes + HasDistrictTaxes bool `json:"HasDistrictTaxes,omitempty"` + + // merch revenue + MerchRevenue []float64 `json:"MerchRevenue"` + + // merch revenue total + MerchRevenueTotal float64 `json:"MerchRevenueTotal,omitempty"` + + // pre tax revenue + PreTaxRevenue []float64 `json:"PreTaxRevenue"` + + // pre tax revenue total + PreTaxRevenueTotal float64 `json:"PreTaxRevenueTotal,omitempty"` + + // sales tax basis + SalesTaxBasis []float64 `json:"SalesTaxBasis"` + + // sales tax basis total + SalesTaxBasisTotal float64 `json:"SalesTaxBasisTotal,omitempty"` + + // sales tax total + SalesTaxTotal float64 `json:"SalesTaxTotal,omitempty"` + + // sales taxes + SalesTaxes []float64 `json:"SalesTaxes"` + + // state sales tax rate + StateSalesTaxRate float64 `json:"StateSalesTaxRate,omitempty"` + + // tax exempt revenue + TaxExemptRevenue []float64 `json:"TaxExemptRevenue"` + + // tax exempt revenue total + TaxExemptRevenueTotal float64 `json:"TaxExemptRevenueTotal,omitempty"` + + // title + Title string `json:"Title,omitempty"` +} + +// Validate validates this tax return panel +func (m *TaxReturnPanel) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxReturnPanel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxReturnPanel) UnmarshalBinary(b []byte) error { + var res TaxReturnPanel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/tax_return_response.go b/api/plex/plex_models/tax_return_response.go new file mode 100644 index 0000000..85e44cd --- /dev/null +++ b/api/plex/plex_models/tax_return_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxReturnResponse An array of Tax Return Objects +// +// swagger:model TaxReturnResponse +type TaxReturnResponse struct { + + // data + Data []*TaxReturn `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this tax return response +func (m *TaxReturnResponse) 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 *TaxReturnResponse) 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 *TaxReturnResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxReturnResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxReturnResponse) UnmarshalBinary(b []byte) error { + var res TaxReturnResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/tax_summary.go b/api/plex/plex_models/tax_summary.go new file mode 100644 index 0000000..f0e5aac --- /dev/null +++ b/api/plex/plex_models/tax_summary.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxSummary tax summary +// +// swagger:model TaxSummary +type TaxSummary struct { + + // amount + Amount float64 `json:"Amount,omitempty"` + + // Tax Type Category + Category string `json:"Category,omitempty"` + + // effective rate + EffectiveRate float64 `json:"EffectiveRate,omitempty"` + + // Month Number + Month int64 `json:"Month,omitempty"` + + // The Period Name of the summary line + PeriodName string `json:"PeriodName,omitempty"` + + // The Taxnexus Geocode of the summary line + PlaceGeocode string `json:"PlaceGeocode,omitempty"` + + // Quarter Number + Quarter int64 `json:"Quarter,omitempty"` + + // revenue base + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // revenue net + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // revenue not taxable + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + + // tax exempt revenue + TaxExemptRevenue float64 `json:"TaxExemptRevenue,omitempty"` + + // tax on tax + TaxOnTax float64 `json:"TaxOnTax,omitempty"` + + // tax rate + TaxRate float64 `json:"TaxRate,omitempty"` + + // Taxnexus ID of the TaxType for which this transaction is made + TaxTypeID string `json:"TaxTypeID,omitempty"` + + // Tax or Fee Name + TaxTypeName string `json:"TaxTypeName,omitempty"` + + // Year Number + Year int64 `json:"Year,omitempty"` +} + +// Validate validates this tax summary +func (m *TaxSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxSummary) UnmarshalBinary(b []byte) error { + var res TaxSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/tax_summary_response.go b/api/plex/plex_models/tax_summary_response.go new file mode 100644 index 0000000..697c406 --- /dev/null +++ b/api/plex/plex_models/tax_summary_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxSummaryResponse An array of Tax Summary Reporting Objects +// +// swagger:model TaxSummaryResponse +type TaxSummaryResponse struct { + + // data + Data []*TaxSummary `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this tax summary response +func (m *TaxSummaryResponse) 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 *TaxSummaryResponse) 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 *TaxSummaryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxSummaryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxSummaryResponse) UnmarshalBinary(b []byte) error { + var res TaxSummaryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/use_tax.go b/api/plex/plex_models/use_tax.go new file mode 100644 index 0000000..8685431 --- /dev/null +++ b/api/plex/plex_models/use_tax.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UseTax use tax +// +// swagger:model UseTax +type UseTax struct { + + // amount + Amount float64 `json:"Amount,omitempty"` + + // revenue base + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // revenue net + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // revenue not taxable + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + + // tax exempt revenue + TaxExemptRevenue float64 `json:"TaxExemptRevenue,omitempty"` + + // tax on tax + TaxOnTax float64 `json:"TaxOnTax,omitempty"` + + // tax rate + TaxRate float64 `json:"TaxRate,omitempty"` +} + +// Validate validates this use tax +func (m *UseTax) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UseTax) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UseTax) UnmarshalBinary(b []byte) error { + var res UseTax + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_models/use_tax_response.go b/api/plex/plex_models/use_tax_response.go new file mode 100644 index 0000000..bc49d09 --- /dev/null +++ b/api/plex/plex_models/use_tax_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package plex_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UseTaxResponse An array of Use Tax Reporting Objects +// +// swagger:model UseTaxResponse +type UseTaxResponse struct { + + // data + Data []*UseTax `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this use tax response +func (m *UseTaxResponse) 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 *UseTaxResponse) 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 *UseTaxResponse) 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 +} + +// MarshalBinary interface implementation +func (m *UseTaxResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UseTaxResponse) UnmarshalBinary(b []byte) error { + var res UseTaxResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_client/authority/authority_client.go b/api/regs/regs_client/authority/authority_client.go new file mode 100644 index 0000000..f73fae8 --- /dev/null +++ b/api/regs/regs_client/authority/authority_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAuthorities(params *GetAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuthoritiesOK, error) + + PostAuthorities(params *PostAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*PostAuthoritiesOK, error) + + PutAuthorities(params *PutAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetAuthoritiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAuthoritiesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PostAuthoritiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAuthoritiesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus Id +*/ +func (a *Client) PutAuthorities(params *PutAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*PutAuthoritiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutAuthoritiesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/regs/regs_client/authority/get_authorities_parameters.go b/api/regs/regs_client/authority/get_authorities_parameters.go new file mode 100644 index 0000000..529da56 --- /dev/null +++ b/api/regs/regs_client/authority/get_authorities_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetAuthoritiesParams() *GetAuthoritiesParams { + var () + return &GetAuthoritiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAuthoritiesParamsWithTimeout creates a new GetAuthoritiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAuthoritiesParamsWithTimeout(timeout time.Duration) *GetAuthoritiesParams { + var () + return &GetAuthoritiesParams{ + + timeout: timeout, + } +} + +// NewGetAuthoritiesParamsWithContext creates a new GetAuthoritiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAuthoritiesParamsWithContext(ctx context.Context) *GetAuthoritiesParams { + var () + return &GetAuthoritiesParams{ + + Context: ctx, + } +} + +// NewGetAuthoritiesParamsWithHTTPClient creates a new GetAuthoritiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAuthoritiesParamsWithHTTPClient(client *http.Client) *GetAuthoritiesParams { + var () + 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 + Taxnexus Id of the Authority to be retrieved + + */ + AuthorityID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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/regs/regs_client/authority/get_authorities_responses.go b/api/regs/regs_client/authority/get_authorities_responses.go new file mode 100644 index 0000000..c61356c --- /dev/null +++ b/api/regs/regs_client/authority/get_authorities_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_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("unknown error", response, response.Code()) + } +} + +// NewGetAuthoritiesOK creates a GetAuthoritiesOK with default headers values +func NewGetAuthoritiesOK() *GetAuthoritiesOK { + return &GetAuthoritiesOK{} +} + +/*GetAuthoritiesOK handles this case with default header values. + +Taxnexus Response with an array of Authority objects +*/ +type GetAuthoritiesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.AuthorityResponse +} + +func (o *GetAuthoritiesOK) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesOK %+v", 200, o.Payload) +} + +func (o *GetAuthoritiesOK) GetPayload() *regs_models.AuthorityResponse { + return o.Payload +} + +func (o *GetAuthoritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_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 handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetAuthoritiesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetAuthoritiesUnauthorized) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAuthoritiesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAuthoritiesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetAuthoritiesForbidden) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesForbidden %+v", 403, o.Payload) +} + +func (o *GetAuthoritiesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Resource was not found +*/ +type GetAuthoritiesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetAuthoritiesNotFound) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesNotFound %+v", 404, o.Payload) +} + +func (o *GetAuthoritiesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAuthoritiesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetAuthoritiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAuthoritiesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Server Internal Error +*/ +type GetAuthoritiesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetAuthoritiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAuthoritiesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/authority/post_authorities_parameters.go b/api/regs/regs_client/authority/post_authorities_parameters.go new file mode 100644 index 0000000..8ac91d0 --- /dev/null +++ b/api/regs/regs_client/authority/post_authorities_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostAuthoritiesParams creates a new PostAuthoritiesParams object +// with the default values initialized. +func NewPostAuthoritiesParams() *PostAuthoritiesParams { + var () + return &PostAuthoritiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAuthoritiesParamsWithTimeout creates a new PostAuthoritiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAuthoritiesParamsWithTimeout(timeout time.Duration) *PostAuthoritiesParams { + var () + return &PostAuthoritiesParams{ + + timeout: timeout, + } +} + +// NewPostAuthoritiesParamsWithContext creates a new PostAuthoritiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAuthoritiesParamsWithContext(ctx context.Context) *PostAuthoritiesParams { + var () + return &PostAuthoritiesParams{ + + Context: ctx, + } +} + +// NewPostAuthoritiesParamsWithHTTPClient creates a new PostAuthoritiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAuthoritiesParamsWithHTTPClient(client *http.Client) *PostAuthoritiesParams { + var () + 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 *regs_models.AuthorityRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *regs_models.AuthorityRequest) *PostAuthoritiesParams { + o.SetAuthorityRequest(authorityRequest) + return o +} + +// SetAuthorityRequest adds the authorityRequest to the post authorities params +func (o *PostAuthoritiesParams) SetAuthorityRequest(authorityRequest *regs_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/regs/regs_client/authority/post_authorities_responses.go b/api/regs/regs_client/authority/post_authorities_responses.go new file mode 100644 index 0000000..d841278 --- /dev/null +++ b/api/regs/regs_client/authority/post_authorities_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_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("unknown error", response, response.Code()) + } +} + +// NewPostAuthoritiesOK creates a PostAuthoritiesOK with default headers values +func NewPostAuthoritiesOK() *PostAuthoritiesOK { + return &PostAuthoritiesOK{} +} + +/*PostAuthoritiesOK handles this case with default header values. + +Taxnexus Response with an array of Authority objects +*/ +type PostAuthoritiesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.AuthorityResponse +} + +func (o *PostAuthoritiesOK) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesOK %+v", 200, o.Payload) +} + +func (o *PostAuthoritiesOK) GetPayload() *regs_models.AuthorityResponse { + return o.Payload +} + +func (o *PostAuthoritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_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 handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostAuthoritiesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostAuthoritiesUnauthorized) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostAuthoritiesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostAuthoritiesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostAuthoritiesForbidden) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesForbidden %+v", 403, o.Payload) +} + +func (o *PostAuthoritiesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Resource was not found +*/ +type PostAuthoritiesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostAuthoritiesNotFound) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesNotFound %+v", 404, o.Payload) +} + +func (o *PostAuthoritiesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostAuthoritiesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostAuthoritiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostAuthoritiesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Server Internal Error +*/ +type PostAuthoritiesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostAuthoritiesInternalServerError) Error() string { + return fmt.Sprintf("[POST /authorities][%d] postAuthoritiesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostAuthoritiesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostAuthoritiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/authority/put_authorities_parameters.go b/api/regs/regs_client/authority/put_authorities_parameters.go new file mode 100644 index 0000000..04044fb --- /dev/null +++ b/api/regs/regs_client/authority/put_authorities_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutAuthoritiesParams creates a new PutAuthoritiesParams object +// with the default values initialized. +func NewPutAuthoritiesParams() *PutAuthoritiesParams { + var () + return &PutAuthoritiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutAuthoritiesParamsWithTimeout creates a new PutAuthoritiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutAuthoritiesParamsWithTimeout(timeout time.Duration) *PutAuthoritiesParams { + var () + return &PutAuthoritiesParams{ + + timeout: timeout, + } +} + +// NewPutAuthoritiesParamsWithContext creates a new PutAuthoritiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutAuthoritiesParamsWithContext(ctx context.Context) *PutAuthoritiesParams { + var () + return &PutAuthoritiesParams{ + + Context: ctx, + } +} + +// NewPutAuthoritiesParamsWithHTTPClient creates a new PutAuthoritiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutAuthoritiesParamsWithHTTPClient(client *http.Client) *PutAuthoritiesParams { + var () + 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 *regs_models.AuthorityRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *regs_models.AuthorityRequest) *PutAuthoritiesParams { + o.SetAuthorityRequest(authorityRequest) + return o +} + +// SetAuthorityRequest adds the authorityRequest to the put authorities params +func (o *PutAuthoritiesParams) SetAuthorityRequest(authorityRequest *regs_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/regs/regs_client/authority/put_authorities_responses.go b/api/regs/regs_client/authority/put_authorities_responses.go new file mode 100644 index 0000000..b1ff71e --- /dev/null +++ b/api/regs/regs_client/authority/put_authorities_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_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("unknown error", response, response.Code()) + } +} + +// NewPutAuthoritiesOK creates a PutAuthoritiesOK with default headers values +func NewPutAuthoritiesOK() *PutAuthoritiesOK { + return &PutAuthoritiesOK{} +} + +/*PutAuthoritiesOK handles this case with default header values. + +Taxnexus Response with an array of Authority objects +*/ +type PutAuthoritiesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.AuthorityResponse +} + +func (o *PutAuthoritiesOK) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesOK %+v", 200, o.Payload) +} + +func (o *PutAuthoritiesOK) GetPayload() *regs_models.AuthorityResponse { + return o.Payload +} + +func (o *PutAuthoritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_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 handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutAuthoritiesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutAuthoritiesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutAuthoritiesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutAuthoritiesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutAuthoritiesForbidden) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesForbidden %+v", 403, o.Payload) +} + +func (o *PutAuthoritiesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Resource was not found +*/ +type PutAuthoritiesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutAuthoritiesNotFound) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesNotFound %+v", 404, o.Payload) +} + +func (o *PutAuthoritiesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutAuthoritiesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutAuthoritiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutAuthoritiesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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 handles this case with default header values. + +Server Internal Error +*/ +type PutAuthoritiesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutAuthoritiesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /authorities][%d] putAuthoritiesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutAuthoritiesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutAuthoritiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/backend/backend_client.go b/api/regs/regs_client/backend/backend_client.go new file mode 100644 index 0000000..ac0e37d --- /dev/null +++ b/api/regs/regs_client/backend/backend_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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 backend API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for backend API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteBackend(params *DeleteBackendParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteBackendOK, error) + + GetBackends(params *GetBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*GetBackendsOK, error) + + PostBackends(params *PostBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PostBackendsOK, error) + + PutBackends(params *PutBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PutBackendsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteBackend deletes a backend + + Delete Taxnexus Backend record +*/ +func (a *Client) DeleteBackend(params *DeleteBackendParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteBackendOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteBackendParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteBackend", + Method: "DELETE", + PathPattern: "/backends", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteBackendReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteBackendOK) + 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 deleteBackend: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetBackends gets a list of backends + + Return a list of Backends +*/ +func (a *Client) GetBackends(params *GetBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*GetBackendsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBackendsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getBackends", + Method: "GET", + PathPattern: "/backends", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetBackendsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetBackendsOK) + 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 getBackends: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostBackends adds new backends + + Contact record to be added +*/ +func (a *Client) PostBackends(params *PostBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PostBackendsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostBackendsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postBackends", + Method: "POST", + PathPattern: "/backends", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostBackendsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostBackendsOK) + 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 postBackends: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutBackends updates backends + + Update Backend records +*/ +func (a *Client) PutBackends(params *PutBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*PutBackendsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutBackendsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putBackends", + Method: "PUT", + PathPattern: "/backends", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutBackendsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutBackendsOK) + 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 putBackends: 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/regs/regs_client/backend/delete_backend_parameters.go b/api/regs/regs_client/backend/delete_backend_parameters.go new file mode 100644 index 0000000..e6d6a92 --- /dev/null +++ b/api/regs/regs_client/backend/delete_backend_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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" +) + +// NewDeleteBackendParams creates a new DeleteBackendParams object +// with the default values initialized. +func NewDeleteBackendParams() *DeleteBackendParams { + var () + return &DeleteBackendParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteBackendParamsWithTimeout creates a new DeleteBackendParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteBackendParamsWithTimeout(timeout time.Duration) *DeleteBackendParams { + var () + return &DeleteBackendParams{ + + timeout: timeout, + } +} + +// NewDeleteBackendParamsWithContext creates a new DeleteBackendParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteBackendParamsWithContext(ctx context.Context) *DeleteBackendParams { + var () + return &DeleteBackendParams{ + + Context: ctx, + } +} + +// NewDeleteBackendParamsWithHTTPClient creates a new DeleteBackendParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteBackendParamsWithHTTPClient(client *http.Client) *DeleteBackendParams { + var () + return &DeleteBackendParams{ + HTTPClient: client, + } +} + +/*DeleteBackendParams contains all the parameters to send to the API endpoint +for the delete backend operation typically these are written to a http.Request +*/ +type DeleteBackendParams struct { + + /*BackendID + Taxnexus Id of the Backend to be retrieved + + */ + BackendID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete backend params +func (o *DeleteBackendParams) WithTimeout(timeout time.Duration) *DeleteBackendParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete backend params +func (o *DeleteBackendParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete backend params +func (o *DeleteBackendParams) WithContext(ctx context.Context) *DeleteBackendParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete backend params +func (o *DeleteBackendParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete backend params +func (o *DeleteBackendParams) WithHTTPClient(client *http.Client) *DeleteBackendParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete backend params +func (o *DeleteBackendParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBackendID adds the backendID to the delete backend params +func (o *DeleteBackendParams) WithBackendID(backendID *string) *DeleteBackendParams { + o.SetBackendID(backendID) + return o +} + +// SetBackendID adds the backendId to the delete backend params +func (o *DeleteBackendParams) SetBackendID(backendID *string) { + o.BackendID = backendID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteBackendParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BackendID != nil { + + // query param backendId + var qrBackendID string + if o.BackendID != nil { + qrBackendID = *o.BackendID + } + qBackendID := qrBackendID + if qBackendID != "" { + if err := r.SetQueryParam("backendId", qBackendID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/backend/delete_backend_responses.go b/api/regs/regs_client/backend/delete_backend_responses.go new file mode 100644 index 0000000..b60e1f6 --- /dev/null +++ b/api/regs/regs_client/backend/delete_backend_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// DeleteBackendReader is a Reader for the DeleteBackend structure. +type DeleteBackendReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteBackendReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteBackendOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteBackendUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteBackendForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteBackendNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteBackendUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteBackendInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteBackendOK creates a DeleteBackendOK with default headers values +func NewDeleteBackendOK() *DeleteBackendOK { + return &DeleteBackendOK{} +} + +/*DeleteBackendOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteBackendOK struct { + AccessControlAllowOrigin string + + Payload *regs_models.DeleteResponse +} + +func (o *DeleteBackendOK) Error() string { + return fmt.Sprintf("[DELETE /backends][%d] deleteBackendOK %+v", 200, o.Payload) +} + +func (o *DeleteBackendOK) GetPayload() *regs_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteBackendOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteBackendUnauthorized creates a DeleteBackendUnauthorized with default headers values +func NewDeleteBackendUnauthorized() *DeleteBackendUnauthorized { + return &DeleteBackendUnauthorized{} +} + +/*DeleteBackendUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type DeleteBackendUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteBackendUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /backends][%d] deleteBackendUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteBackendUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteBackendUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteBackendForbidden creates a DeleteBackendForbidden with default headers values +func NewDeleteBackendForbidden() *DeleteBackendForbidden { + return &DeleteBackendForbidden{} +} + +/*DeleteBackendForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteBackendForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteBackendForbidden) Error() string { + return fmt.Sprintf("[DELETE /backends][%d] deleteBackendForbidden %+v", 403, o.Payload) +} + +func (o *DeleteBackendForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteBackendForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteBackendNotFound creates a DeleteBackendNotFound with default headers values +func NewDeleteBackendNotFound() *DeleteBackendNotFound { + return &DeleteBackendNotFound{} +} + +/*DeleteBackendNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteBackendNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteBackendNotFound) Error() string { + return fmt.Sprintf("[DELETE /backends][%d] deleteBackendNotFound %+v", 404, o.Payload) +} + +func (o *DeleteBackendNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteBackendNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteBackendUnprocessableEntity creates a DeleteBackendUnprocessableEntity with default headers values +func NewDeleteBackendUnprocessableEntity() *DeleteBackendUnprocessableEntity { + return &DeleteBackendUnprocessableEntity{} +} + +/*DeleteBackendUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteBackendUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteBackendUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /backends][%d] deleteBackendUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteBackendUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteBackendUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteBackendInternalServerError creates a DeleteBackendInternalServerError with default headers values +func NewDeleteBackendInternalServerError() *DeleteBackendInternalServerError { + return &DeleteBackendInternalServerError{} +} + +/*DeleteBackendInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteBackendInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteBackendInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /backends][%d] deleteBackendInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteBackendInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteBackendInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/backend/get_backends_parameters.go b/api/regs/regs_client/backend/get_backends_parameters.go new file mode 100644 index 0000000..8374280 --- /dev/null +++ b/api/regs/regs_client/backend/get_backends_parameters.go @@ -0,0 +1,343 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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" +) + +// NewGetBackendsParams creates a new GetBackendsParams object +// with the default values initialized. +func NewGetBackendsParams() *GetBackendsParams { + var () + return &GetBackendsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetBackendsParamsWithTimeout creates a new GetBackendsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetBackendsParamsWithTimeout(timeout time.Duration) *GetBackendsParams { + var () + return &GetBackendsParams{ + + timeout: timeout, + } +} + +// NewGetBackendsParamsWithContext creates a new GetBackendsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetBackendsParamsWithContext(ctx context.Context) *GetBackendsParams { + var () + return &GetBackendsParams{ + + Context: ctx, + } +} + +// NewGetBackendsParamsWithHTTPClient creates a new GetBackendsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetBackendsParamsWithHTTPClient(client *http.Client) *GetBackendsParams { + var () + return &GetBackendsParams{ + HTTPClient: client, + } +} + +/*GetBackendsParams contains all the parameters to send to the API endpoint +for the get backends operation typically these are written to a http.Request +*/ +type GetBackendsParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*AccountNumber + The Taxnexus Account Number of the Account to be used a record retrieval + + */ + AccountNumber *string + /*BackendID + Taxnexus Id of the Backend to be retrieved + + */ + BackendID *string + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Name + The Name of this Object + + */ + Name *string + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get backends params +func (o *GetBackendsParams) WithTimeout(timeout time.Duration) *GetBackendsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get backends params +func (o *GetBackendsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get backends params +func (o *GetBackendsParams) WithContext(ctx context.Context) *GetBackendsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get backends params +func (o *GetBackendsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get backends params +func (o *GetBackendsParams) WithHTTPClient(client *http.Client) *GetBackendsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get backends params +func (o *GetBackendsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get backends params +func (o *GetBackendsParams) WithAccountID(accountID *string) *GetBackendsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get backends params +func (o *GetBackendsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithAccountNumber adds the accountNumber to the get backends params +func (o *GetBackendsParams) WithAccountNumber(accountNumber *string) *GetBackendsParams { + o.SetAccountNumber(accountNumber) + return o +} + +// SetAccountNumber adds the accountNumber to the get backends params +func (o *GetBackendsParams) SetAccountNumber(accountNumber *string) { + o.AccountNumber = accountNumber +} + +// WithBackendID adds the backendID to the get backends params +func (o *GetBackendsParams) WithBackendID(backendID *string) *GetBackendsParams { + o.SetBackendID(backendID) + return o +} + +// SetBackendID adds the backendId to the get backends params +func (o *GetBackendsParams) SetBackendID(backendID *string) { + o.BackendID = backendID +} + +// WithCompanyID adds the companyID to the get backends params +func (o *GetBackendsParams) WithCompanyID(companyID *string) *GetBackendsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get backends params +func (o *GetBackendsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get backends params +func (o *GetBackendsParams) WithLimit(limit *int64) *GetBackendsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get backends params +func (o *GetBackendsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the get backends params +func (o *GetBackendsParams) WithName(name *string) *GetBackendsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get backends params +func (o *GetBackendsParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the get backends params +func (o *GetBackendsParams) WithOffset(offset *int64) *GetBackendsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get backends params +func (o *GetBackendsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBackendsParams) 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.AccountNumber != nil { + + // query param accountNumber + var qrAccountNumber string + if o.AccountNumber != nil { + qrAccountNumber = *o.AccountNumber + } + qAccountNumber := qrAccountNumber + if qAccountNumber != "" { + if err := r.SetQueryParam("accountNumber", qAccountNumber); err != nil { + return err + } + } + + } + + if o.BackendID != nil { + + // query param backendId + var qrBackendID string + if o.BackendID != nil { + qrBackendID = *o.BackendID + } + qBackendID := qrBackendID + if qBackendID != "" { + if err := r.SetQueryParam("backendId", qBackendID); 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.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/regs/regs_client/backend/get_backends_responses.go b/api/regs/regs_client/backend/get_backends_responses.go new file mode 100644 index 0000000..f837d72 --- /dev/null +++ b/api/regs/regs_client/backend/get_backends_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetBackendsReader is a Reader for the GetBackends structure. +type GetBackendsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBackendsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBackendsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetBackendsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetBackendsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetBackendsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetBackendsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetBackendsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetBackendsOK creates a GetBackendsOK with default headers values +func NewGetBackendsOK() *GetBackendsOK { + return &GetBackendsOK{} +} + +/*GetBackendsOK handles this case with default header values. + +Taxnexus Response with an array of Backend Objects +*/ +type GetBackendsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.BackendResponse +} + +func (o *GetBackendsOK) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsOK %+v", 200, o.Payload) +} + +func (o *GetBackendsOK) GetPayload() *regs_models.BackendResponse { + return o.Payload +} + +func (o *GetBackendsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.BackendResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsUnauthorized creates a GetBackendsUnauthorized with default headers values +func NewGetBackendsUnauthorized() *GetBackendsUnauthorized { + return &GetBackendsUnauthorized{} +} + +/*GetBackendsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetBackendsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetBackendsUnauthorized) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetBackendsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetBackendsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsForbidden creates a GetBackendsForbidden with default headers values +func NewGetBackendsForbidden() *GetBackendsForbidden { + return &GetBackendsForbidden{} +} + +/*GetBackendsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetBackendsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetBackendsForbidden) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsForbidden %+v", 403, o.Payload) +} + +func (o *GetBackendsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetBackendsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsNotFound creates a GetBackendsNotFound with default headers values +func NewGetBackendsNotFound() *GetBackendsNotFound { + return &GetBackendsNotFound{} +} + +/*GetBackendsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetBackendsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetBackendsNotFound) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsNotFound %+v", 404, o.Payload) +} + +func (o *GetBackendsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetBackendsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsUnprocessableEntity creates a GetBackendsUnprocessableEntity with default headers values +func NewGetBackendsUnprocessableEntity() *GetBackendsUnprocessableEntity { + return &GetBackendsUnprocessableEntity{} +} + +/*GetBackendsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetBackendsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetBackendsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetBackendsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetBackendsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsInternalServerError creates a GetBackendsInternalServerError with default headers values +func NewGetBackendsInternalServerError() *GetBackendsInternalServerError { + return &GetBackendsInternalServerError{} +} + +/*GetBackendsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetBackendsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetBackendsInternalServerError) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetBackendsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetBackendsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/backend/post_backends_parameters.go b/api/regs/regs_client/backend/post_backends_parameters.go new file mode 100644 index 0000000..04eaedf --- /dev/null +++ b/api/regs/regs_client/backend/post_backends_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostBackendsParams creates a new PostBackendsParams object +// with the default values initialized. +func NewPostBackendsParams() *PostBackendsParams { + var () + return &PostBackendsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostBackendsParamsWithTimeout creates a new PostBackendsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostBackendsParamsWithTimeout(timeout time.Duration) *PostBackendsParams { + var () + return &PostBackendsParams{ + + timeout: timeout, + } +} + +// NewPostBackendsParamsWithContext creates a new PostBackendsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostBackendsParamsWithContext(ctx context.Context) *PostBackendsParams { + var () + return &PostBackendsParams{ + + Context: ctx, + } +} + +// NewPostBackendsParamsWithHTTPClient creates a new PostBackendsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostBackendsParamsWithHTTPClient(client *http.Client) *PostBackendsParams { + var () + return &PostBackendsParams{ + HTTPClient: client, + } +} + +/*PostBackendsParams contains all the parameters to send to the API endpoint +for the post backends operation typically these are written to a http.Request +*/ +type PostBackendsParams struct { + + /*BackendRequest + An array of new Backend records + + */ + BackendRequest *regs_models.BackendRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post backends params +func (o *PostBackendsParams) WithTimeout(timeout time.Duration) *PostBackendsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post backends params +func (o *PostBackendsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post backends params +func (o *PostBackendsParams) WithContext(ctx context.Context) *PostBackendsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post backends params +func (o *PostBackendsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post backends params +func (o *PostBackendsParams) WithHTTPClient(client *http.Client) *PostBackendsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post backends params +func (o *PostBackendsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBackendRequest adds the backendRequest to the post backends params +func (o *PostBackendsParams) WithBackendRequest(backendRequest *regs_models.BackendRequest) *PostBackendsParams { + o.SetBackendRequest(backendRequest) + return o +} + +// SetBackendRequest adds the backendRequest to the post backends params +func (o *PostBackendsParams) SetBackendRequest(backendRequest *regs_models.BackendRequest) { + o.BackendRequest = backendRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostBackendsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BackendRequest != nil { + if err := r.SetBodyParam(o.BackendRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/backend/post_backends_responses.go b/api/regs/regs_client/backend/post_backends_responses.go new file mode 100644 index 0000000..a8b1b04 --- /dev/null +++ b/api/regs/regs_client/backend/post_backends_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostBackendsReader is a Reader for the PostBackends structure. +type PostBackendsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostBackendsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostBackendsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostBackendsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostBackendsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostBackendsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostBackendsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostBackendsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostBackendsOK creates a PostBackendsOK with default headers values +func NewPostBackendsOK() *PostBackendsOK { + return &PostBackendsOK{} +} + +/*PostBackendsOK handles this case with default header values. + +Taxnexus Response with an array of Backend Objects +*/ +type PostBackendsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.BackendResponse +} + +func (o *PostBackendsOK) Error() string { + return fmt.Sprintf("[POST /backends][%d] postBackendsOK %+v", 200, o.Payload) +} + +func (o *PostBackendsOK) GetPayload() *regs_models.BackendResponse { + return o.Payload +} + +func (o *PostBackendsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.BackendResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostBackendsUnauthorized creates a PostBackendsUnauthorized with default headers values +func NewPostBackendsUnauthorized() *PostBackendsUnauthorized { + return &PostBackendsUnauthorized{} +} + +/*PostBackendsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostBackendsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostBackendsUnauthorized) Error() string { + return fmt.Sprintf("[POST /backends][%d] postBackendsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostBackendsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostBackendsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostBackendsForbidden creates a PostBackendsForbidden with default headers values +func NewPostBackendsForbidden() *PostBackendsForbidden { + return &PostBackendsForbidden{} +} + +/*PostBackendsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostBackendsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostBackendsForbidden) Error() string { + return fmt.Sprintf("[POST /backends][%d] postBackendsForbidden %+v", 403, o.Payload) +} + +func (o *PostBackendsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostBackendsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostBackendsNotFound creates a PostBackendsNotFound with default headers values +func NewPostBackendsNotFound() *PostBackendsNotFound { + return &PostBackendsNotFound{} +} + +/*PostBackendsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostBackendsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostBackendsNotFound) Error() string { + return fmt.Sprintf("[POST /backends][%d] postBackendsNotFound %+v", 404, o.Payload) +} + +func (o *PostBackendsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostBackendsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostBackendsUnprocessableEntity creates a PostBackendsUnprocessableEntity with default headers values +func NewPostBackendsUnprocessableEntity() *PostBackendsUnprocessableEntity { + return &PostBackendsUnprocessableEntity{} +} + +/*PostBackendsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostBackendsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostBackendsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /backends][%d] postBackendsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostBackendsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostBackendsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostBackendsInternalServerError creates a PostBackendsInternalServerError with default headers values +func NewPostBackendsInternalServerError() *PostBackendsInternalServerError { + return &PostBackendsInternalServerError{} +} + +/*PostBackendsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostBackendsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostBackendsInternalServerError) Error() string { + return fmt.Sprintf("[POST /backends][%d] postBackendsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostBackendsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostBackendsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/backend/put_backends_parameters.go b/api/regs/regs_client/backend/put_backends_parameters.go new file mode 100644 index 0000000..30f041f --- /dev/null +++ b/api/regs/regs_client/backend/put_backends_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutBackendsParams creates a new PutBackendsParams object +// with the default values initialized. +func NewPutBackendsParams() *PutBackendsParams { + var () + return &PutBackendsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutBackendsParamsWithTimeout creates a new PutBackendsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutBackendsParamsWithTimeout(timeout time.Duration) *PutBackendsParams { + var () + return &PutBackendsParams{ + + timeout: timeout, + } +} + +// NewPutBackendsParamsWithContext creates a new PutBackendsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutBackendsParamsWithContext(ctx context.Context) *PutBackendsParams { + var () + return &PutBackendsParams{ + + Context: ctx, + } +} + +// NewPutBackendsParamsWithHTTPClient creates a new PutBackendsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutBackendsParamsWithHTTPClient(client *http.Client) *PutBackendsParams { + var () + return &PutBackendsParams{ + HTTPClient: client, + } +} + +/*PutBackendsParams contains all the parameters to send to the API endpoint +for the put backends operation typically these are written to a http.Request +*/ +type PutBackendsParams struct { + + /*BackendRequest + An array of new Backend records + + */ + BackendRequest *regs_models.BackendRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put backends params +func (o *PutBackendsParams) WithTimeout(timeout time.Duration) *PutBackendsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put backends params +func (o *PutBackendsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put backends params +func (o *PutBackendsParams) WithContext(ctx context.Context) *PutBackendsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put backends params +func (o *PutBackendsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put backends params +func (o *PutBackendsParams) WithHTTPClient(client *http.Client) *PutBackendsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put backends params +func (o *PutBackendsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBackendRequest adds the backendRequest to the put backends params +func (o *PutBackendsParams) WithBackendRequest(backendRequest *regs_models.BackendRequest) *PutBackendsParams { + o.SetBackendRequest(backendRequest) + return o +} + +// SetBackendRequest adds the backendRequest to the put backends params +func (o *PutBackendsParams) SetBackendRequest(backendRequest *regs_models.BackendRequest) { + o.BackendRequest = backendRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutBackendsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BackendRequest != nil { + if err := r.SetBodyParam(o.BackendRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/backend/put_backends_responses.go b/api/regs/regs_client/backend/put_backends_responses.go new file mode 100644 index 0000000..62cd704 --- /dev/null +++ b/api/regs/regs_client/backend/put_backends_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backend + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutBackendsReader is a Reader for the PutBackends structure. +type PutBackendsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutBackendsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutBackendsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutBackendsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutBackendsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutBackendsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutBackendsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutBackendsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutBackendsOK creates a PutBackendsOK with default headers values +func NewPutBackendsOK() *PutBackendsOK { + return &PutBackendsOK{} +} + +/*PutBackendsOK handles this case with default header values. + +Taxnexus Response with an array of Backend Objects +*/ +type PutBackendsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.BackendResponse +} + +func (o *PutBackendsOK) Error() string { + return fmt.Sprintf("[PUT /backends][%d] putBackendsOK %+v", 200, o.Payload) +} + +func (o *PutBackendsOK) GetPayload() *regs_models.BackendResponse { + return o.Payload +} + +func (o *PutBackendsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.BackendResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutBackendsUnauthorized creates a PutBackendsUnauthorized with default headers values +func NewPutBackendsUnauthorized() *PutBackendsUnauthorized { + return &PutBackendsUnauthorized{} +} + +/*PutBackendsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutBackendsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutBackendsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /backends][%d] putBackendsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutBackendsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutBackendsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutBackendsForbidden creates a PutBackendsForbidden with default headers values +func NewPutBackendsForbidden() *PutBackendsForbidden { + return &PutBackendsForbidden{} +} + +/*PutBackendsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutBackendsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutBackendsForbidden) Error() string { + return fmt.Sprintf("[PUT /backends][%d] putBackendsForbidden %+v", 403, o.Payload) +} + +func (o *PutBackendsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutBackendsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutBackendsNotFound creates a PutBackendsNotFound with default headers values +func NewPutBackendsNotFound() *PutBackendsNotFound { + return &PutBackendsNotFound{} +} + +/*PutBackendsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutBackendsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutBackendsNotFound) Error() string { + return fmt.Sprintf("[PUT /backends][%d] putBackendsNotFound %+v", 404, o.Payload) +} + +func (o *PutBackendsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutBackendsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutBackendsUnprocessableEntity creates a PutBackendsUnprocessableEntity with default headers values +func NewPutBackendsUnprocessableEntity() *PutBackendsUnprocessableEntity { + return &PutBackendsUnprocessableEntity{} +} + +/*PutBackendsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutBackendsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutBackendsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /backends][%d] putBackendsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutBackendsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutBackendsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutBackendsInternalServerError creates a PutBackendsInternalServerError with default headers values +func NewPutBackendsInternalServerError() *PutBackendsInternalServerError { + return &PutBackendsInternalServerError{} +} + +/*PutBackendsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutBackendsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutBackendsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /backends][%d] putBackendsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutBackendsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutBackendsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/cors/authority_options_parameters.go b/api/regs/regs_client/cors/authority_options_parameters.go new file mode 100644 index 0000000..6b3b5bd --- /dev/null +++ b/api/regs/regs_client/cors/authority_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewAuthorityOptionsParams creates a new AuthorityOptionsParams object +// with the default values initialized. +func NewAuthorityOptionsParams() *AuthorityOptionsParams { + + return &AuthorityOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAuthorityOptionsParamsWithTimeout creates a new AuthorityOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAuthorityOptionsParamsWithTimeout(timeout time.Duration) *AuthorityOptionsParams { + + return &AuthorityOptionsParams{ + + timeout: timeout, + } +} + +// NewAuthorityOptionsParamsWithContext creates a new AuthorityOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewAuthorityOptionsParamsWithContext(ctx context.Context) *AuthorityOptionsParams { + + return &AuthorityOptionsParams{ + + Context: ctx, + } +} + +// NewAuthorityOptionsParamsWithHTTPClient creates a new AuthorityOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAuthorityOptionsParamsWithHTTPClient(client *http.Client) *AuthorityOptionsParams { + + return &AuthorityOptionsParams{ + HTTPClient: client, + } +} + +/*AuthorityOptionsParams contains all the parameters to send to the API endpoint +for the authority options operation typically these are written to a http.Request +*/ +type AuthorityOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the authority options params +func (o *AuthorityOptionsParams) WithTimeout(timeout time.Duration) *AuthorityOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the authority options params +func (o *AuthorityOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the authority options params +func (o *AuthorityOptionsParams) WithContext(ctx context.Context) *AuthorityOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the authority options params +func (o *AuthorityOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the authority options params +func (o *AuthorityOptionsParams) WithHTTPClient(client *http.Client) *AuthorityOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the authority options params +func (o *AuthorityOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *AuthorityOptionsParams) 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/regs/regs_client/cors/authority_options_responses.go b/api/regs/regs_client/cors/authority_options_responses.go new file mode 100644 index 0000000..8cb758a --- /dev/null +++ b/api/regs/regs_client/cors/authority_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// AuthorityOptionsReader is a Reader for the AuthorityOptions structure. +type AuthorityOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AuthorityOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAuthorityOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewAuthorityOptionsOK creates a AuthorityOptionsOK with default headers values +func NewAuthorityOptionsOK() *AuthorityOptionsOK { + return &AuthorityOptionsOK{} +} + +/*AuthorityOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type AuthorityOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *AuthorityOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /authorities][%d] authorityOptionsOK ", 200) +} + +func (o *AuthorityOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/backend_options_parameters.go b/api/regs/regs_client/cors/backend_options_parameters.go new file mode 100644 index 0000000..034ac29 --- /dev/null +++ b/api/regs/regs_client/cors/backend_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewBackendOptionsParams creates a new BackendOptionsParams object +// with the default values initialized. +func NewBackendOptionsParams() *BackendOptionsParams { + + return &BackendOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewBackendOptionsParamsWithTimeout creates a new BackendOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewBackendOptionsParamsWithTimeout(timeout time.Duration) *BackendOptionsParams { + + return &BackendOptionsParams{ + + timeout: timeout, + } +} + +// NewBackendOptionsParamsWithContext creates a new BackendOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewBackendOptionsParamsWithContext(ctx context.Context) *BackendOptionsParams { + + return &BackendOptionsParams{ + + Context: ctx, + } +} + +// NewBackendOptionsParamsWithHTTPClient creates a new BackendOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewBackendOptionsParamsWithHTTPClient(client *http.Client) *BackendOptionsParams { + + return &BackendOptionsParams{ + HTTPClient: client, + } +} + +/*BackendOptionsParams contains all the parameters to send to the API endpoint +for the backend options operation typically these are written to a http.Request +*/ +type BackendOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the backend options params +func (o *BackendOptionsParams) WithTimeout(timeout time.Duration) *BackendOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the backend options params +func (o *BackendOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the backend options params +func (o *BackendOptionsParams) WithContext(ctx context.Context) *BackendOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the backend options params +func (o *BackendOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the backend options params +func (o *BackendOptionsParams) WithHTTPClient(client *http.Client) *BackendOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the backend options params +func (o *BackendOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *BackendOptionsParams) 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/regs/regs_client/cors/backend_options_responses.go b/api/regs/regs_client/cors/backend_options_responses.go new file mode 100644 index 0000000..d1836d5 --- /dev/null +++ b/api/regs/regs_client/cors/backend_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// BackendOptionsReader is a Reader for the BackendOptions structure. +type BackendOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *BackendOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewBackendOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewBackendOptionsOK creates a BackendOptionsOK with default headers values +func NewBackendOptionsOK() *BackendOptionsOK { + return &BackendOptionsOK{} +} + +/*BackendOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type BackendOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *BackendOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /backends][%d] backendOptionsOK ", 200) +} + +func (o *BackendOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/cors_client.go b/api/regs/regs_client/cors/cors_client.go new file mode 100644 index 0000000..7e0c134 --- /dev/null +++ b/api/regs/regs_client/cors/cors_client.go @@ -0,0 +1,436 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + AuthorityOptions(params *AuthorityOptionsParams) (*AuthorityOptionsOK, error) + + BackendOptions(params *BackendOptionsParams) (*BackendOptionsOK, error) + + FilingOptions(params *FilingOptionsParams) (*FilingOptionsOK, error) + + FilingTypeOptions(params *FilingTypeOptionsParams) (*FilingTypeOptionsOK, error) + + LicenseOptions(params *LicenseOptionsParams) (*LicenseOptionsOK, error) + + LicenseTypeOptions(params *LicenseTypeOptionsParams) (*LicenseTypeOptionsOK, error) + + NotebookOptions(params *NotebookOptionsParams) (*NotebookOptionsOK, error) + + RatingEngineOptions(params *RatingEngineOptionsParams) (*RatingEngineOptionsOK, error) + + SubmissionOptions(params *SubmissionOptionsParams) (*SubmissionOptionsOK, error) + + TaxTypeAccountOptions(params *TaxTypeAccountOptionsParams) (*TaxTypeAccountOptionsOK, error) + + TransactionOptions(params *TransactionOptionsParams) (*TransactionOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AuthorityOptions CORS support +*/ +func (a *Client) AuthorityOptions(params *AuthorityOptionsParams) (*AuthorityOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAuthorityOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "authorityOptions", + Method: "OPTIONS", + PathPattern: "/authorities", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AuthorityOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*AuthorityOptionsOK) + 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 authorityOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + BackendOptions CORS support +*/ +func (a *Client) BackendOptions(params *BackendOptionsParams) (*BackendOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewBackendOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "backendOptions", + Method: "OPTIONS", + PathPattern: "/backends", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &BackendOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*BackendOptionsOK) + 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 backendOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + FilingOptions CORS support +*/ +func (a *Client) FilingOptions(params *FilingOptionsParams) (*FilingOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFilingOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "filingOptions", + Method: "OPTIONS", + PathPattern: "/filings", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FilingOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FilingOptionsOK) + 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 filingOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + FilingTypeOptions CORS support +*/ +func (a *Client) FilingTypeOptions(params *FilingTypeOptionsParams) (*FilingTypeOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFilingTypeOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "filingTypeOptions", + Method: "OPTIONS", + PathPattern: "/filingtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FilingTypeOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FilingTypeOptionsOK) + 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 filingTypeOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + LicenseOptions CORS support +*/ +func (a *Client) LicenseOptions(params *LicenseOptionsParams) (*LicenseOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLicenseOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "licenseOptions", + Method: "OPTIONS", + PathPattern: "/licenses", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &LicenseOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*LicenseOptionsOK) + 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 licenseOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + LicenseTypeOptions CORS support +*/ +func (a *Client) LicenseTypeOptions(params *LicenseTypeOptionsParams) (*LicenseTypeOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLicenseTypeOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "licenseTypeOptions", + Method: "OPTIONS", + PathPattern: "/licensetypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &LicenseTypeOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*LicenseTypeOptionsOK) + 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 licenseTypeOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + NotebookOptions CORS support +*/ +func (a *Client) NotebookOptions(params *NotebookOptionsParams) (*NotebookOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewNotebookOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "notebookOptions", + Method: "OPTIONS", + PathPattern: "/notebooks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &NotebookOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*NotebookOptionsOK) + 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 notebookOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + RatingEngineOptions CORS support +*/ +func (a *Client) RatingEngineOptions(params *RatingEngineOptionsParams) (*RatingEngineOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRatingEngineOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ratingEngineOptions", + Method: "OPTIONS", + PathPattern: "/ratingengines", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RatingEngineOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*RatingEngineOptionsOK) + 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 ratingEngineOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + SubmissionOptions CORS support +*/ +func (a *Client) SubmissionOptions(params *SubmissionOptionsParams) (*SubmissionOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSubmissionOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "submissionOptions", + Method: "OPTIONS", + PathPattern: "/submissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SubmissionOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SubmissionOptionsOK) + 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 submissionOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TaxTypeAccountOptions CORS support +*/ +func (a *Client) TaxTypeAccountOptions(params *TaxTypeAccountOptionsParams) (*TaxTypeAccountOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaxTypeAccountOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "taxTypeAccountOptions", + Method: "OPTIONS", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaxTypeAccountOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaxTypeAccountOptionsOK) + 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 taxTypeAccountOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TransactionOptions CORS support +*/ +func (a *Client) TransactionOptions(params *TransactionOptionsParams) (*TransactionOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTransactionOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "transactionOptions", + Method: "OPTIONS", + PathPattern: "/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TransactionOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TransactionOptionsOK) + 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 transactionOptions: 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/regs/regs_client/cors/filing_options_parameters.go b/api/regs/regs_client/cors/filing_options_parameters.go new file mode 100644 index 0000000..f6f8d60 --- /dev/null +++ b/api/regs/regs_client/cors/filing_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewFilingOptionsParams creates a new FilingOptionsParams object +// with the default values initialized. +func NewFilingOptionsParams() *FilingOptionsParams { + + return &FilingOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFilingOptionsParamsWithTimeout creates a new FilingOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFilingOptionsParamsWithTimeout(timeout time.Duration) *FilingOptionsParams { + + return &FilingOptionsParams{ + + timeout: timeout, + } +} + +// NewFilingOptionsParamsWithContext creates a new FilingOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFilingOptionsParamsWithContext(ctx context.Context) *FilingOptionsParams { + + return &FilingOptionsParams{ + + Context: ctx, + } +} + +// NewFilingOptionsParamsWithHTTPClient creates a new FilingOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFilingOptionsParamsWithHTTPClient(client *http.Client) *FilingOptionsParams { + + return &FilingOptionsParams{ + HTTPClient: client, + } +} + +/*FilingOptionsParams contains all the parameters to send to the API endpoint +for the filing options operation typically these are written to a http.Request +*/ +type FilingOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the filing options params +func (o *FilingOptionsParams) WithTimeout(timeout time.Duration) *FilingOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the filing options params +func (o *FilingOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the filing options params +func (o *FilingOptionsParams) WithContext(ctx context.Context) *FilingOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the filing options params +func (o *FilingOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the filing options params +func (o *FilingOptionsParams) WithHTTPClient(client *http.Client) *FilingOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the filing options params +func (o *FilingOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FilingOptionsParams) 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/regs/regs_client/cors/filing_options_responses.go b/api/regs/regs_client/cors/filing_options_responses.go new file mode 100644 index 0000000..d36d64b --- /dev/null +++ b/api/regs/regs_client/cors/filing_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// FilingOptionsReader is a Reader for the FilingOptions structure. +type FilingOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FilingOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFilingOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewFilingOptionsOK creates a FilingOptionsOK with default headers values +func NewFilingOptionsOK() *FilingOptionsOK { + return &FilingOptionsOK{} +} + +/*FilingOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type FilingOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *FilingOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /filings][%d] filingOptionsOK ", 200) +} + +func (o *FilingOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/filing_type_options_parameters.go b/api/regs/regs_client/cors/filing_type_options_parameters.go new file mode 100644 index 0000000..03d60e1 --- /dev/null +++ b/api/regs/regs_client/cors/filing_type_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewFilingTypeOptionsParams creates a new FilingTypeOptionsParams object +// with the default values initialized. +func NewFilingTypeOptionsParams() *FilingTypeOptionsParams { + + return &FilingTypeOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFilingTypeOptionsParamsWithTimeout creates a new FilingTypeOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFilingTypeOptionsParamsWithTimeout(timeout time.Duration) *FilingTypeOptionsParams { + + return &FilingTypeOptionsParams{ + + timeout: timeout, + } +} + +// NewFilingTypeOptionsParamsWithContext creates a new FilingTypeOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFilingTypeOptionsParamsWithContext(ctx context.Context) *FilingTypeOptionsParams { + + return &FilingTypeOptionsParams{ + + Context: ctx, + } +} + +// NewFilingTypeOptionsParamsWithHTTPClient creates a new FilingTypeOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFilingTypeOptionsParamsWithHTTPClient(client *http.Client) *FilingTypeOptionsParams { + + return &FilingTypeOptionsParams{ + HTTPClient: client, + } +} + +/*FilingTypeOptionsParams contains all the parameters to send to the API endpoint +for the filing type options operation typically these are written to a http.Request +*/ +type FilingTypeOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the filing type options params +func (o *FilingTypeOptionsParams) WithTimeout(timeout time.Duration) *FilingTypeOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the filing type options params +func (o *FilingTypeOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the filing type options params +func (o *FilingTypeOptionsParams) WithContext(ctx context.Context) *FilingTypeOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the filing type options params +func (o *FilingTypeOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the filing type options params +func (o *FilingTypeOptionsParams) WithHTTPClient(client *http.Client) *FilingTypeOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the filing type options params +func (o *FilingTypeOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FilingTypeOptionsParams) 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/regs/regs_client/cors/filing_type_options_responses.go b/api/regs/regs_client/cors/filing_type_options_responses.go new file mode 100644 index 0000000..d53b675 --- /dev/null +++ b/api/regs/regs_client/cors/filing_type_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// FilingTypeOptionsReader is a Reader for the FilingTypeOptions structure. +type FilingTypeOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FilingTypeOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFilingTypeOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewFilingTypeOptionsOK creates a FilingTypeOptionsOK with default headers values +func NewFilingTypeOptionsOK() *FilingTypeOptionsOK { + return &FilingTypeOptionsOK{} +} + +/*FilingTypeOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type FilingTypeOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *FilingTypeOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /filingtypes][%d] filingTypeOptionsOK ", 200) +} + +func (o *FilingTypeOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/license_options_parameters.go b/api/regs/regs_client/cors/license_options_parameters.go new file mode 100644 index 0000000..927ca39 --- /dev/null +++ b/api/regs/regs_client/cors/license_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewLicenseOptionsParams creates a new LicenseOptionsParams object +// with the default values initialized. +func NewLicenseOptionsParams() *LicenseOptionsParams { + + return &LicenseOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewLicenseOptionsParamsWithTimeout creates a new LicenseOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewLicenseOptionsParamsWithTimeout(timeout time.Duration) *LicenseOptionsParams { + + return &LicenseOptionsParams{ + + timeout: timeout, + } +} + +// NewLicenseOptionsParamsWithContext creates a new LicenseOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewLicenseOptionsParamsWithContext(ctx context.Context) *LicenseOptionsParams { + + return &LicenseOptionsParams{ + + Context: ctx, + } +} + +// NewLicenseOptionsParamsWithHTTPClient creates a new LicenseOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewLicenseOptionsParamsWithHTTPClient(client *http.Client) *LicenseOptionsParams { + + return &LicenseOptionsParams{ + HTTPClient: client, + } +} + +/*LicenseOptionsParams contains all the parameters to send to the API endpoint +for the license options operation typically these are written to a http.Request +*/ +type LicenseOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the license options params +func (o *LicenseOptionsParams) WithTimeout(timeout time.Duration) *LicenseOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the license options params +func (o *LicenseOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the license options params +func (o *LicenseOptionsParams) WithContext(ctx context.Context) *LicenseOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the license options params +func (o *LicenseOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the license options params +func (o *LicenseOptionsParams) WithHTTPClient(client *http.Client) *LicenseOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the license options params +func (o *LicenseOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *LicenseOptionsParams) 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/regs/regs_client/cors/license_options_responses.go b/api/regs/regs_client/cors/license_options_responses.go new file mode 100644 index 0000000..582a813 --- /dev/null +++ b/api/regs/regs_client/cors/license_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// LicenseOptionsReader is a Reader for the LicenseOptions structure. +type LicenseOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LicenseOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLicenseOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewLicenseOptionsOK creates a LicenseOptionsOK with default headers values +func NewLicenseOptionsOK() *LicenseOptionsOK { + return &LicenseOptionsOK{} +} + +/*LicenseOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type LicenseOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *LicenseOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /licenses][%d] licenseOptionsOK ", 200) +} + +func (o *LicenseOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/license_type_options_parameters.go b/api/regs/regs_client/cors/license_type_options_parameters.go new file mode 100644 index 0000000..7281f10 --- /dev/null +++ b/api/regs/regs_client/cors/license_type_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewLicenseTypeOptionsParams creates a new LicenseTypeOptionsParams object +// with the default values initialized. +func NewLicenseTypeOptionsParams() *LicenseTypeOptionsParams { + + return &LicenseTypeOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewLicenseTypeOptionsParamsWithTimeout creates a new LicenseTypeOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewLicenseTypeOptionsParamsWithTimeout(timeout time.Duration) *LicenseTypeOptionsParams { + + return &LicenseTypeOptionsParams{ + + timeout: timeout, + } +} + +// NewLicenseTypeOptionsParamsWithContext creates a new LicenseTypeOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewLicenseTypeOptionsParamsWithContext(ctx context.Context) *LicenseTypeOptionsParams { + + return &LicenseTypeOptionsParams{ + + Context: ctx, + } +} + +// NewLicenseTypeOptionsParamsWithHTTPClient creates a new LicenseTypeOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewLicenseTypeOptionsParamsWithHTTPClient(client *http.Client) *LicenseTypeOptionsParams { + + return &LicenseTypeOptionsParams{ + HTTPClient: client, + } +} + +/*LicenseTypeOptionsParams contains all the parameters to send to the API endpoint +for the license type options operation typically these are written to a http.Request +*/ +type LicenseTypeOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the license type options params +func (o *LicenseTypeOptionsParams) WithTimeout(timeout time.Duration) *LicenseTypeOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the license type options params +func (o *LicenseTypeOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the license type options params +func (o *LicenseTypeOptionsParams) WithContext(ctx context.Context) *LicenseTypeOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the license type options params +func (o *LicenseTypeOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the license type options params +func (o *LicenseTypeOptionsParams) WithHTTPClient(client *http.Client) *LicenseTypeOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the license type options params +func (o *LicenseTypeOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *LicenseTypeOptionsParams) 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/regs/regs_client/cors/license_type_options_responses.go b/api/regs/regs_client/cors/license_type_options_responses.go new file mode 100644 index 0000000..a72a462 --- /dev/null +++ b/api/regs/regs_client/cors/license_type_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// LicenseTypeOptionsReader is a Reader for the LicenseTypeOptions structure. +type LicenseTypeOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LicenseTypeOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLicenseTypeOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewLicenseTypeOptionsOK creates a LicenseTypeOptionsOK with default headers values +func NewLicenseTypeOptionsOK() *LicenseTypeOptionsOK { + return &LicenseTypeOptionsOK{} +} + +/*LicenseTypeOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type LicenseTypeOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *LicenseTypeOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /licensetypes][%d] licenseTypeOptionsOK ", 200) +} + +func (o *LicenseTypeOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/notebook_options_parameters.go b/api/regs/regs_client/cors/notebook_options_parameters.go new file mode 100644 index 0000000..1421951 --- /dev/null +++ b/api/regs/regs_client/cors/notebook_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewNotebookOptionsParams creates a new NotebookOptionsParams object +// with the default values initialized. +func NewNotebookOptionsParams() *NotebookOptionsParams { + + return &NotebookOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewNotebookOptionsParamsWithTimeout creates a new NotebookOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewNotebookOptionsParamsWithTimeout(timeout time.Duration) *NotebookOptionsParams { + + return &NotebookOptionsParams{ + + timeout: timeout, + } +} + +// NewNotebookOptionsParamsWithContext creates a new NotebookOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewNotebookOptionsParamsWithContext(ctx context.Context) *NotebookOptionsParams { + + return &NotebookOptionsParams{ + + Context: ctx, + } +} + +// NewNotebookOptionsParamsWithHTTPClient creates a new NotebookOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewNotebookOptionsParamsWithHTTPClient(client *http.Client) *NotebookOptionsParams { + + return &NotebookOptionsParams{ + HTTPClient: client, + } +} + +/*NotebookOptionsParams contains all the parameters to send to the API endpoint +for the notebook options operation typically these are written to a http.Request +*/ +type NotebookOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the notebook options params +func (o *NotebookOptionsParams) WithTimeout(timeout time.Duration) *NotebookOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the notebook options params +func (o *NotebookOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the notebook options params +func (o *NotebookOptionsParams) WithContext(ctx context.Context) *NotebookOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the notebook options params +func (o *NotebookOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the notebook options params +func (o *NotebookOptionsParams) WithHTTPClient(client *http.Client) *NotebookOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the notebook options params +func (o *NotebookOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *NotebookOptionsParams) 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/regs/regs_client/cors/notebook_options_responses.go b/api/regs/regs_client/cors/notebook_options_responses.go new file mode 100644 index 0000000..8679011 --- /dev/null +++ b/api/regs/regs_client/cors/notebook_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NotebookOptionsReader is a Reader for the NotebookOptions structure. +type NotebookOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *NotebookOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewNotebookOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewNotebookOptionsOK creates a NotebookOptionsOK with default headers values +func NewNotebookOptionsOK() *NotebookOptionsOK { + return &NotebookOptionsOK{} +} + +/*NotebookOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type NotebookOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *NotebookOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /notebooks][%d] notebookOptionsOK ", 200) +} + +func (o *NotebookOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/rating_engine_options_parameters.go b/api/regs/regs_client/cors/rating_engine_options_parameters.go new file mode 100644 index 0000000..160e86e --- /dev/null +++ b/api/regs/regs_client/cors/rating_engine_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewRatingEngineOptionsParams creates a new RatingEngineOptionsParams object +// with the default values initialized. +func NewRatingEngineOptionsParams() *RatingEngineOptionsParams { + + return &RatingEngineOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRatingEngineOptionsParamsWithTimeout creates a new RatingEngineOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRatingEngineOptionsParamsWithTimeout(timeout time.Duration) *RatingEngineOptionsParams { + + return &RatingEngineOptionsParams{ + + timeout: timeout, + } +} + +// NewRatingEngineOptionsParamsWithContext creates a new RatingEngineOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewRatingEngineOptionsParamsWithContext(ctx context.Context) *RatingEngineOptionsParams { + + return &RatingEngineOptionsParams{ + + Context: ctx, + } +} + +// NewRatingEngineOptionsParamsWithHTTPClient creates a new RatingEngineOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRatingEngineOptionsParamsWithHTTPClient(client *http.Client) *RatingEngineOptionsParams { + + return &RatingEngineOptionsParams{ + HTTPClient: client, + } +} + +/*RatingEngineOptionsParams contains all the parameters to send to the API endpoint +for the rating engine options operation typically these are written to a http.Request +*/ +type RatingEngineOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the rating engine options params +func (o *RatingEngineOptionsParams) WithTimeout(timeout time.Duration) *RatingEngineOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the rating engine options params +func (o *RatingEngineOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the rating engine options params +func (o *RatingEngineOptionsParams) WithContext(ctx context.Context) *RatingEngineOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the rating engine options params +func (o *RatingEngineOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the rating engine options params +func (o *RatingEngineOptionsParams) WithHTTPClient(client *http.Client) *RatingEngineOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the rating engine options params +func (o *RatingEngineOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *RatingEngineOptionsParams) 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/regs/regs_client/cors/rating_engine_options_responses.go b/api/regs/regs_client/cors/rating_engine_options_responses.go new file mode 100644 index 0000000..9726241 --- /dev/null +++ b/api/regs/regs_client/cors/rating_engine_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// RatingEngineOptionsReader is a Reader for the RatingEngineOptions structure. +type RatingEngineOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RatingEngineOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRatingEngineOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewRatingEngineOptionsOK creates a RatingEngineOptionsOK with default headers values +func NewRatingEngineOptionsOK() *RatingEngineOptionsOK { + return &RatingEngineOptionsOK{} +} + +/*RatingEngineOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type RatingEngineOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *RatingEngineOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /ratingengines][%d] ratingEngineOptionsOK ", 200) +} + +func (o *RatingEngineOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/submission_options_parameters.go b/api/regs/regs_client/cors/submission_options_parameters.go new file mode 100644 index 0000000..51bfc1c --- /dev/null +++ b/api/regs/regs_client/cors/submission_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewSubmissionOptionsParams creates a new SubmissionOptionsParams object +// with the default values initialized. +func NewSubmissionOptionsParams() *SubmissionOptionsParams { + + return &SubmissionOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSubmissionOptionsParamsWithTimeout creates a new SubmissionOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSubmissionOptionsParamsWithTimeout(timeout time.Duration) *SubmissionOptionsParams { + + return &SubmissionOptionsParams{ + + timeout: timeout, + } +} + +// NewSubmissionOptionsParamsWithContext creates a new SubmissionOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewSubmissionOptionsParamsWithContext(ctx context.Context) *SubmissionOptionsParams { + + return &SubmissionOptionsParams{ + + Context: ctx, + } +} + +// NewSubmissionOptionsParamsWithHTTPClient creates a new SubmissionOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSubmissionOptionsParamsWithHTTPClient(client *http.Client) *SubmissionOptionsParams { + + return &SubmissionOptionsParams{ + HTTPClient: client, + } +} + +/*SubmissionOptionsParams contains all the parameters to send to the API endpoint +for the submission options operation typically these are written to a http.Request +*/ +type SubmissionOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the submission options params +func (o *SubmissionOptionsParams) WithTimeout(timeout time.Duration) *SubmissionOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the submission options params +func (o *SubmissionOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the submission options params +func (o *SubmissionOptionsParams) WithContext(ctx context.Context) *SubmissionOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the submission options params +func (o *SubmissionOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the submission options params +func (o *SubmissionOptionsParams) WithHTTPClient(client *http.Client) *SubmissionOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the submission options params +func (o *SubmissionOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SubmissionOptionsParams) 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/regs/regs_client/cors/submission_options_responses.go b/api/regs/regs_client/cors/submission_options_responses.go new file mode 100644 index 0000000..c20aaff --- /dev/null +++ b/api/regs/regs_client/cors/submission_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// SubmissionOptionsReader is a Reader for the SubmissionOptions structure. +type SubmissionOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SubmissionOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSubmissionOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewSubmissionOptionsOK creates a SubmissionOptionsOK with default headers values +func NewSubmissionOptionsOK() *SubmissionOptionsOK { + return &SubmissionOptionsOK{} +} + +/*SubmissionOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type SubmissionOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *SubmissionOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /submissions][%d] submissionOptionsOK ", 200) +} + +func (o *SubmissionOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/tax_type_account_options_parameters.go b/api/regs/regs_client/cors/tax_type_account_options_parameters.go new file mode 100644 index 0000000..510ffd3 --- /dev/null +++ b/api/regs/regs_client/cors/tax_type_account_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewTaxTypeAccountOptionsParams creates a new TaxTypeAccountOptionsParams object +// with the default values initialized. +func NewTaxTypeAccountOptionsParams() *TaxTypeAccountOptionsParams { + + return &TaxTypeAccountOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaxTypeAccountOptionsParamsWithTimeout creates a new TaxTypeAccountOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaxTypeAccountOptionsParamsWithTimeout(timeout time.Duration) *TaxTypeAccountOptionsParams { + + return &TaxTypeAccountOptionsParams{ + + timeout: timeout, + } +} + +// NewTaxTypeAccountOptionsParamsWithContext creates a new TaxTypeAccountOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaxTypeAccountOptionsParamsWithContext(ctx context.Context) *TaxTypeAccountOptionsParams { + + return &TaxTypeAccountOptionsParams{ + + Context: ctx, + } +} + +// NewTaxTypeAccountOptionsParamsWithHTTPClient creates a new TaxTypeAccountOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaxTypeAccountOptionsParamsWithHTTPClient(client *http.Client) *TaxTypeAccountOptionsParams { + + return &TaxTypeAccountOptionsParams{ + HTTPClient: client, + } +} + +/*TaxTypeAccountOptionsParams contains all the parameters to send to the API endpoint +for the tax type account options operation typically these are written to a http.Request +*/ +type TaxTypeAccountOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tax type account options params +func (o *TaxTypeAccountOptionsParams) WithTimeout(timeout time.Duration) *TaxTypeAccountOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tax type account options params +func (o *TaxTypeAccountOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tax type account options params +func (o *TaxTypeAccountOptionsParams) WithContext(ctx context.Context) *TaxTypeAccountOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tax type account options params +func (o *TaxTypeAccountOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tax type account options params +func (o *TaxTypeAccountOptionsParams) WithHTTPClient(client *http.Client) *TaxTypeAccountOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tax type account options params +func (o *TaxTypeAccountOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaxTypeAccountOptionsParams) 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/regs/regs_client/cors/tax_type_account_options_responses.go b/api/regs/regs_client/cors/tax_type_account_options_responses.go new file mode 100644 index 0000000..a2e5448 --- /dev/null +++ b/api/regs/regs_client/cors/tax_type_account_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// TaxTypeAccountOptionsReader is a Reader for the TaxTypeAccountOptions structure. +type TaxTypeAccountOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaxTypeAccountOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaxTypeAccountOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTaxTypeAccountOptionsOK creates a TaxTypeAccountOptionsOK with default headers values +func NewTaxTypeAccountOptionsOK() *TaxTypeAccountOptionsOK { + return &TaxTypeAccountOptionsOK{} +} + +/*TaxTypeAccountOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type TaxTypeAccountOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *TaxTypeAccountOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxtypeaccounts][%d] taxTypeAccountOptionsOK ", 200) +} + +func (o *TaxTypeAccountOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/cors/transaction_options_parameters.go b/api/regs/regs_client/cors/transaction_options_parameters.go new file mode 100644 index 0000000..638c7cb --- /dev/null +++ b/api/regs/regs_client/cors/transaction_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewTransactionOptionsParams creates a new TransactionOptionsParams object +// with the default values initialized. +func NewTransactionOptionsParams() *TransactionOptionsParams { + + return &TransactionOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTransactionOptionsParamsWithTimeout creates a new TransactionOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTransactionOptionsParamsWithTimeout(timeout time.Duration) *TransactionOptionsParams { + + return &TransactionOptionsParams{ + + timeout: timeout, + } +} + +// NewTransactionOptionsParamsWithContext creates a new TransactionOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTransactionOptionsParamsWithContext(ctx context.Context) *TransactionOptionsParams { + + return &TransactionOptionsParams{ + + Context: ctx, + } +} + +// NewTransactionOptionsParamsWithHTTPClient creates a new TransactionOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTransactionOptionsParamsWithHTTPClient(client *http.Client) *TransactionOptionsParams { + + return &TransactionOptionsParams{ + HTTPClient: client, + } +} + +/*TransactionOptionsParams contains all the parameters to send to the API endpoint +for the transaction options operation typically these are written to a http.Request +*/ +type TransactionOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the transaction options params +func (o *TransactionOptionsParams) WithTimeout(timeout time.Duration) *TransactionOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the transaction options params +func (o *TransactionOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the transaction options params +func (o *TransactionOptionsParams) WithContext(ctx context.Context) *TransactionOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the transaction options params +func (o *TransactionOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the transaction options params +func (o *TransactionOptionsParams) WithHTTPClient(client *http.Client) *TransactionOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the transaction options params +func (o *TransactionOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TransactionOptionsParams) 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/regs/regs_client/cors/transaction_options_responses.go b/api/regs/regs_client/cors/transaction_options_responses.go new file mode 100644 index 0000000..17a3521 --- /dev/null +++ b/api/regs/regs_client/cors/transaction_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// TransactionOptionsReader is a Reader for the TransactionOptions structure. +type TransactionOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TransactionOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTransactionOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTransactionOptionsOK creates a TransactionOptionsOK with default headers values +func NewTransactionOptionsOK() *TransactionOptionsOK { + return &TransactionOptionsOK{} +} + +/*TransactionOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type TransactionOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *TransactionOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /transactions][%d] transactionOptionsOK ", 200) +} + +func (o *TransactionOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/regs/regs_client/filing/filing_client.go b/api/regs/regs_client/filing/filing_client.go new file mode 100644 index 0000000..e138521 --- /dev/null +++ b/api/regs/regs_client/filing/filing_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing + +// 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 filing API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for filing API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetFilings(params *GetFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingsOK, error) + + PostFilings(params *PostFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingsOK, error) + + PutFilings(params *PutFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetFilings gets a list of filings + + Return a list of available Regulatory Filings +*/ +func (a *Client) GetFilings(params *GetFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetFilingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getFilings", + Method: "GET", + PathPattern: "/filings", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetFilingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetFilingsOK) + 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 getFilings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostFilings creates new filings + + Create new Filings +*/ +func (a *Client) PostFilings(params *PostFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostFilingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postFilings", + Method: "POST", + PathPattern: "/filings", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostFilingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostFilingsOK) + 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 postFilings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutFilings updates a filing + + Update all the fields in a Filing record identified by Taxnexus ID +*/ +func (a *Client) PutFilings(params *PutFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutFilingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putFilings", + Method: "PUT", + PathPattern: "/filings", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutFilingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutFilingsOK) + 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 putFilings: 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/regs/regs_client/filing/get_filings_parameters.go b/api/regs/regs_client/filing/get_filings_parameters.go new file mode 100644 index 0000000..1293c6b --- /dev/null +++ b/api/regs/regs_client/filing/get_filings_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing + +// 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" +) + +// NewGetFilingsParams creates a new GetFilingsParams object +// with the default values initialized. +func NewGetFilingsParams() *GetFilingsParams { + var () + return &GetFilingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetFilingsParamsWithTimeout creates a new GetFilingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetFilingsParamsWithTimeout(timeout time.Duration) *GetFilingsParams { + var () + return &GetFilingsParams{ + + timeout: timeout, + } +} + +// NewGetFilingsParamsWithContext creates a new GetFilingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetFilingsParamsWithContext(ctx context.Context) *GetFilingsParams { + var () + return &GetFilingsParams{ + + Context: ctx, + } +} + +// NewGetFilingsParamsWithHTTPClient creates a new GetFilingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetFilingsParamsWithHTTPClient(client *http.Client) *GetFilingsParams { + var () + return &GetFilingsParams{ + HTTPClient: client, + } +} + +/*GetFilingsParams contains all the parameters to send to the API endpoint +for the get filings operation typically these are written to a http.Request +*/ +type GetFilingsParams struct { + + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*FilingID + Taxnexus Record Id of a Filing + + */ + FilingID *string + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get filings params +func (o *GetFilingsParams) WithTimeout(timeout time.Duration) *GetFilingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get filings params +func (o *GetFilingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get filings params +func (o *GetFilingsParams) WithContext(ctx context.Context) *GetFilingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get filings params +func (o *GetFilingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get filings params +func (o *GetFilingsParams) WithHTTPClient(client *http.Client) *GetFilingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get filings params +func (o *GetFilingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyID adds the companyID to the get filings params +func (o *GetFilingsParams) WithCompanyID(companyID *string) *GetFilingsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get filings params +func (o *GetFilingsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithFilingID adds the filingID to the get filings params +func (o *GetFilingsParams) WithFilingID(filingID *string) *GetFilingsParams { + o.SetFilingID(filingID) + return o +} + +// SetFilingID adds the filingId to the get filings params +func (o *GetFilingsParams) SetFilingID(filingID *string) { + o.FilingID = filingID +} + +// WithID adds the id to the get filings params +func (o *GetFilingsParams) WithID(id *string) *GetFilingsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get filings params +func (o *GetFilingsParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get filings params +func (o *GetFilingsParams) WithLimit(limit *int64) *GetFilingsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get filings params +func (o *GetFilingsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get filings params +func (o *GetFilingsParams) WithOffset(offset *int64) *GetFilingsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get filings params +func (o *GetFilingsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetFilingsParams) 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.FilingID != nil { + + // query param filingId + var qrFilingID string + if o.FilingID != nil { + qrFilingID = *o.FilingID + } + qFilingID := qrFilingID + if qFilingID != "" { + if err := r.SetQueryParam("filingId", qFilingID); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/filing/get_filings_responses.go b/api/regs/regs_client/filing/get_filings_responses.go new file mode 100644 index 0000000..07eb276 --- /dev/null +++ b/api/regs/regs_client/filing/get_filings_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetFilingsReader is a Reader for the GetFilings structure. +type GetFilingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetFilingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetFilingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetFilingsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetFilingsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetFilingsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetFilingsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetFilingsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetFilingsOK creates a GetFilingsOK with default headers values +func NewGetFilingsOK() *GetFilingsOK { + return &GetFilingsOK{} +} + +/*GetFilingsOK handles this case with default header values. + +Taxnexus Response with an array of Filing objects +*/ +type GetFilingsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.FilingResponse +} + +func (o *GetFilingsOK) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsOK %+v", 200, o.Payload) +} + +func (o *GetFilingsOK) GetPayload() *regs_models.FilingResponse { + return o.Payload +} + +func (o *GetFilingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.FilingResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsUnauthorized creates a GetFilingsUnauthorized with default headers values +func NewGetFilingsUnauthorized() *GetFilingsUnauthorized { + return &GetFilingsUnauthorized{} +} + +/*GetFilingsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetFilingsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingsUnauthorized) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetFilingsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsForbidden creates a GetFilingsForbidden with default headers values +func NewGetFilingsForbidden() *GetFilingsForbidden { + return &GetFilingsForbidden{} +} + +/*GetFilingsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetFilingsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingsForbidden) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsForbidden %+v", 403, o.Payload) +} + +func (o *GetFilingsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsNotFound creates a GetFilingsNotFound with default headers values +func NewGetFilingsNotFound() *GetFilingsNotFound { + return &GetFilingsNotFound{} +} + +/*GetFilingsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetFilingsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingsNotFound) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsNotFound %+v", 404, o.Payload) +} + +func (o *GetFilingsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsUnprocessableEntity creates a GetFilingsUnprocessableEntity with default headers values +func NewGetFilingsUnprocessableEntity() *GetFilingsUnprocessableEntity { + return &GetFilingsUnprocessableEntity{} +} + +/*GetFilingsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetFilingsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetFilingsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsInternalServerError creates a GetFilingsInternalServerError with default headers values +func NewGetFilingsInternalServerError() *GetFilingsInternalServerError { + return &GetFilingsInternalServerError{} +} + +/*GetFilingsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetFilingsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingsInternalServerError) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetFilingsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/filing/post_filings_parameters.go b/api/regs/regs_client/filing/post_filings_parameters.go new file mode 100644 index 0000000..66fad89 --- /dev/null +++ b/api/regs/regs_client/filing/post_filings_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostFilingsParams creates a new PostFilingsParams object +// with the default values initialized. +func NewPostFilingsParams() *PostFilingsParams { + var () + return &PostFilingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostFilingsParamsWithTimeout creates a new PostFilingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostFilingsParamsWithTimeout(timeout time.Duration) *PostFilingsParams { + var () + return &PostFilingsParams{ + + timeout: timeout, + } +} + +// NewPostFilingsParamsWithContext creates a new PostFilingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostFilingsParamsWithContext(ctx context.Context) *PostFilingsParams { + var () + return &PostFilingsParams{ + + Context: ctx, + } +} + +// NewPostFilingsParamsWithHTTPClient creates a new PostFilingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostFilingsParamsWithHTTPClient(client *http.Client) *PostFilingsParams { + var () + return &PostFilingsParams{ + HTTPClient: client, + } +} + +/*PostFilingsParams contains all the parameters to send to the API endpoint +for the post filings operation typically these are written to a http.Request +*/ +type PostFilingsParams struct { + + /*FilingRequest + A request with an array of Filing Objects + + */ + FilingRequest *regs_models.FilingRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post filings params +func (o *PostFilingsParams) WithTimeout(timeout time.Duration) *PostFilingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post filings params +func (o *PostFilingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post filings params +func (o *PostFilingsParams) WithContext(ctx context.Context) *PostFilingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post filings params +func (o *PostFilingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post filings params +func (o *PostFilingsParams) WithHTTPClient(client *http.Client) *PostFilingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post filings params +func (o *PostFilingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingRequest adds the filingRequest to the post filings params +func (o *PostFilingsParams) WithFilingRequest(filingRequest *regs_models.FilingRequest) *PostFilingsParams { + o.SetFilingRequest(filingRequest) + return o +} + +// SetFilingRequest adds the filingRequest to the post filings params +func (o *PostFilingsParams) SetFilingRequest(filingRequest *regs_models.FilingRequest) { + o.FilingRequest = filingRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostFilingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingRequest != nil { + if err := r.SetBodyParam(o.FilingRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/filing/post_filings_responses.go b/api/regs/regs_client/filing/post_filings_responses.go new file mode 100644 index 0000000..b45be38 --- /dev/null +++ b/api/regs/regs_client/filing/post_filings_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostFilingsReader is a Reader for the PostFilings structure. +type PostFilingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostFilingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostFilingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostFilingsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostFilingsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostFilingsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostFilingsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostFilingsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostFilingsOK creates a PostFilingsOK with default headers values +func NewPostFilingsOK() *PostFilingsOK { + return &PostFilingsOK{} +} + +/*PostFilingsOK handles this case with default header values. + +Taxnexus Response with an array of Filing objects +*/ +type PostFilingsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.FilingResponse +} + +func (o *PostFilingsOK) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsOK %+v", 200, o.Payload) +} + +func (o *PostFilingsOK) GetPayload() *regs_models.FilingResponse { + return o.Payload +} + +func (o *PostFilingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.FilingResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsUnauthorized creates a PostFilingsUnauthorized with default headers values +func NewPostFilingsUnauthorized() *PostFilingsUnauthorized { + return &PostFilingsUnauthorized{} +} + +/*PostFilingsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostFilingsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingsUnauthorized) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostFilingsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsForbidden creates a PostFilingsForbidden with default headers values +func NewPostFilingsForbidden() *PostFilingsForbidden { + return &PostFilingsForbidden{} +} + +/*PostFilingsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostFilingsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingsForbidden) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsForbidden %+v", 403, o.Payload) +} + +func (o *PostFilingsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsNotFound creates a PostFilingsNotFound with default headers values +func NewPostFilingsNotFound() *PostFilingsNotFound { + return &PostFilingsNotFound{} +} + +/*PostFilingsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostFilingsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingsNotFound) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsNotFound %+v", 404, o.Payload) +} + +func (o *PostFilingsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsUnprocessableEntity creates a PostFilingsUnprocessableEntity with default headers values +func NewPostFilingsUnprocessableEntity() *PostFilingsUnprocessableEntity { + return &PostFilingsUnprocessableEntity{} +} + +/*PostFilingsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostFilingsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostFilingsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsInternalServerError creates a PostFilingsInternalServerError with default headers values +func NewPostFilingsInternalServerError() *PostFilingsInternalServerError { + return &PostFilingsInternalServerError{} +} + +/*PostFilingsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostFilingsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingsInternalServerError) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostFilingsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/filing/put_filings_parameters.go b/api/regs/regs_client/filing/put_filings_parameters.go new file mode 100644 index 0000000..d9e0c3c --- /dev/null +++ b/api/regs/regs_client/filing/put_filings_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutFilingsParams creates a new PutFilingsParams object +// with the default values initialized. +func NewPutFilingsParams() *PutFilingsParams { + var () + return &PutFilingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutFilingsParamsWithTimeout creates a new PutFilingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutFilingsParamsWithTimeout(timeout time.Duration) *PutFilingsParams { + var () + return &PutFilingsParams{ + + timeout: timeout, + } +} + +// NewPutFilingsParamsWithContext creates a new PutFilingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutFilingsParamsWithContext(ctx context.Context) *PutFilingsParams { + var () + return &PutFilingsParams{ + + Context: ctx, + } +} + +// NewPutFilingsParamsWithHTTPClient creates a new PutFilingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutFilingsParamsWithHTTPClient(client *http.Client) *PutFilingsParams { + var () + return &PutFilingsParams{ + HTTPClient: client, + } +} + +/*PutFilingsParams contains all the parameters to send to the API endpoint +for the put filings operation typically these are written to a http.Request +*/ +type PutFilingsParams struct { + + /*FilingRequest + A request with an array of Filing Objects + + */ + FilingRequest *regs_models.FilingRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put filings params +func (o *PutFilingsParams) WithTimeout(timeout time.Duration) *PutFilingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put filings params +func (o *PutFilingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put filings params +func (o *PutFilingsParams) WithContext(ctx context.Context) *PutFilingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put filings params +func (o *PutFilingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put filings params +func (o *PutFilingsParams) WithHTTPClient(client *http.Client) *PutFilingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put filings params +func (o *PutFilingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingRequest adds the filingRequest to the put filings params +func (o *PutFilingsParams) WithFilingRequest(filingRequest *regs_models.FilingRequest) *PutFilingsParams { + o.SetFilingRequest(filingRequest) + return o +} + +// SetFilingRequest adds the filingRequest to the put filings params +func (o *PutFilingsParams) SetFilingRequest(filingRequest *regs_models.FilingRequest) { + o.FilingRequest = filingRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutFilingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingRequest != nil { + if err := r.SetBodyParam(o.FilingRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/filing/put_filings_responses.go b/api/regs/regs_client/filing/put_filings_responses.go new file mode 100644 index 0000000..c957f07 --- /dev/null +++ b/api/regs/regs_client/filing/put_filings_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutFilingsReader is a Reader for the PutFilings structure. +type PutFilingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutFilingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutFilingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutFilingsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutFilingsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutFilingsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutFilingsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutFilingsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutFilingsOK creates a PutFilingsOK with default headers values +func NewPutFilingsOK() *PutFilingsOK { + return &PutFilingsOK{} +} + +/*PutFilingsOK handles this case with default header values. + +Taxnexus Response with an array of Filing objects +*/ +type PutFilingsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.FilingResponse +} + +func (o *PutFilingsOK) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsOK %+v", 200, o.Payload) +} + +func (o *PutFilingsOK) GetPayload() *regs_models.FilingResponse { + return o.Payload +} + +func (o *PutFilingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.FilingResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsUnauthorized creates a PutFilingsUnauthorized with default headers values +func NewPutFilingsUnauthorized() *PutFilingsUnauthorized { + return &PutFilingsUnauthorized{} +} + +/*PutFilingsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutFilingsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutFilingsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsForbidden creates a PutFilingsForbidden with default headers values +func NewPutFilingsForbidden() *PutFilingsForbidden { + return &PutFilingsForbidden{} +} + +/*PutFilingsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutFilingsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingsForbidden) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsForbidden %+v", 403, o.Payload) +} + +func (o *PutFilingsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsNotFound creates a PutFilingsNotFound with default headers values +func NewPutFilingsNotFound() *PutFilingsNotFound { + return &PutFilingsNotFound{} +} + +/*PutFilingsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutFilingsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingsNotFound) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsNotFound %+v", 404, o.Payload) +} + +func (o *PutFilingsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsUnprocessableEntity creates a PutFilingsUnprocessableEntity with default headers values +func NewPutFilingsUnprocessableEntity() *PutFilingsUnprocessableEntity { + return &PutFilingsUnprocessableEntity{} +} + +/*PutFilingsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutFilingsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutFilingsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsInternalServerError creates a PutFilingsInternalServerError with default headers values +func NewPutFilingsInternalServerError() *PutFilingsInternalServerError { + return &PutFilingsInternalServerError{} +} + +/*PutFilingsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutFilingsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutFilingsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/filing_type/filing_type_client.go b/api/regs/regs_client/filing_type/filing_type_client.go new file mode 100644 index 0000000..cf8e74b --- /dev/null +++ b/api/regs/regs_client/filing_type/filing_type_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_type + +// 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 filing type API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for filing type API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetFilingTypes(params *GetFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingTypesOK, error) + + PostFilingTypes(params *PostFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingTypesOK, error) + + PutFilingTypes(params *PutFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingTypesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetFilingTypes gets a list of filing types + + Return a list of available Regulatory FilingTypes +*/ +func (a *Client) GetFilingTypes(params *GetFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetFilingTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getFilingTypes", + Method: "GET", + PathPattern: "/filingtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetFilingTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetFilingTypesOK) + 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 getFilingTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostFilingTypes creates new filing types + + Create new FilingTypes +*/ +func (a *Client) PostFilingTypes(params *PostFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostFilingTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postFilingTypes", + Method: "POST", + PathPattern: "/filingtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostFilingTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostFilingTypesOK) + 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 postFilingTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutFilingTypes updates a filing type + + Update all the fields in a FilingType record identified by Taxnexus ID +*/ +func (a *Client) PutFilingTypes(params *PutFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutFilingTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putFilingTypes", + Method: "PUT", + PathPattern: "/filingtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutFilingTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutFilingTypesOK) + 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 putFilingTypes: 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/regs/regs_client/filing_type/get_filing_types_parameters.go b/api/regs/regs_client/filing_type/get_filing_types_parameters.go new file mode 100644 index 0000000..04dc0fc --- /dev/null +++ b/api/regs/regs_client/filing_type/get_filing_types_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_type + +// 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" +) + +// NewGetFilingTypesParams creates a new GetFilingTypesParams object +// with the default values initialized. +func NewGetFilingTypesParams() *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetFilingTypesParamsWithTimeout creates a new GetFilingTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetFilingTypesParamsWithTimeout(timeout time.Duration) *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + + timeout: timeout, + } +} + +// NewGetFilingTypesParamsWithContext creates a new GetFilingTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetFilingTypesParamsWithContext(ctx context.Context) *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + + Context: ctx, + } +} + +// NewGetFilingTypesParamsWithHTTPClient creates a new GetFilingTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetFilingTypesParamsWithHTTPClient(client *http.Client) *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + HTTPClient: client, + } +} + +/*GetFilingTypesParams contains all the parameters to send to the API endpoint +for the get filing types operation typically these are written to a http.Request +*/ +type GetFilingTypesParams struct { + + /*FilingTypeID + Taxnexus Record Id of a Filing + + */ + FilingTypeID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get filing types params +func (o *GetFilingTypesParams) WithTimeout(timeout time.Duration) *GetFilingTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get filing types params +func (o *GetFilingTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get filing types params +func (o *GetFilingTypesParams) WithContext(ctx context.Context) *GetFilingTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get filing types params +func (o *GetFilingTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get filing types params +func (o *GetFilingTypesParams) WithHTTPClient(client *http.Client) *GetFilingTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get filing types params +func (o *GetFilingTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingTypeID adds the filingTypeID to the get filing types params +func (o *GetFilingTypesParams) WithFilingTypeID(filingTypeID *string) *GetFilingTypesParams { + o.SetFilingTypeID(filingTypeID) + return o +} + +// SetFilingTypeID adds the filingTypeId to the get filing types params +func (o *GetFilingTypesParams) SetFilingTypeID(filingTypeID *string) { + o.FilingTypeID = filingTypeID +} + +// WithLimit adds the limit to the get filing types params +func (o *GetFilingTypesParams) WithLimit(limit *int64) *GetFilingTypesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get filing types params +func (o *GetFilingTypesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get filing types params +func (o *GetFilingTypesParams) WithOffset(offset *int64) *GetFilingTypesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get filing types params +func (o *GetFilingTypesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetFilingTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingTypeID != nil { + + // query param filingTypeId + var qrFilingTypeID string + if o.FilingTypeID != nil { + qrFilingTypeID = *o.FilingTypeID + } + qFilingTypeID := qrFilingTypeID + if qFilingTypeID != "" { + if err := r.SetQueryParam("filingTypeId", qFilingTypeID); 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/regs/regs_client/filing_type/get_filing_types_responses.go b/api/regs/regs_client/filing_type/get_filing_types_responses.go new file mode 100644 index 0000000..5c06482 --- /dev/null +++ b/api/regs/regs_client/filing_type/get_filing_types_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_type + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetFilingTypesReader is a Reader for the GetFilingTypes structure. +type GetFilingTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetFilingTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetFilingTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetFilingTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetFilingTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetFilingTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetFilingTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetFilingTypesOK creates a GetFilingTypesOK with default headers values +func NewGetFilingTypesOK() *GetFilingTypesOK { + return &GetFilingTypesOK{} +} + +/*GetFilingTypesOK handles this case with default header values. + +Taxnexus Response with an array of FilingType objects +*/ +type GetFilingTypesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.FilingTypeResponse +} + +func (o *GetFilingTypesOK) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesOK %+v", 200, o.Payload) +} + +func (o *GetFilingTypesOK) GetPayload() *regs_models.FilingTypeResponse { + return o.Payload +} + +func (o *GetFilingTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.FilingTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesUnauthorized creates a GetFilingTypesUnauthorized with default headers values +func NewGetFilingTypesUnauthorized() *GetFilingTypesUnauthorized { + return &GetFilingTypesUnauthorized{} +} + +/*GetFilingTypesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetFilingTypesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetFilingTypesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesForbidden creates a GetFilingTypesForbidden with default headers values +func NewGetFilingTypesForbidden() *GetFilingTypesForbidden { + return &GetFilingTypesForbidden{} +} + +/*GetFilingTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetFilingTypesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingTypesForbidden) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetFilingTypesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesNotFound creates a GetFilingTypesNotFound with default headers values +func NewGetFilingTypesNotFound() *GetFilingTypesNotFound { + return &GetFilingTypesNotFound{} +} + +/*GetFilingTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetFilingTypesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingTypesNotFound) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetFilingTypesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesUnprocessableEntity creates a GetFilingTypesUnprocessableEntity with default headers values +func NewGetFilingTypesUnprocessableEntity() *GetFilingTypesUnprocessableEntity { + return &GetFilingTypesUnprocessableEntity{} +} + +/*GetFilingTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetFilingTypesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetFilingTypesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesInternalServerError creates a GetFilingTypesInternalServerError with default headers values +func NewGetFilingTypesInternalServerError() *GetFilingTypesInternalServerError { + return &GetFilingTypesInternalServerError{} +} + +/*GetFilingTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetFilingTypesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetFilingTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetFilingTypesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetFilingTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/filing_type/post_filing_types_parameters.go b/api/regs/regs_client/filing_type/post_filing_types_parameters.go new file mode 100644 index 0000000..63e882f --- /dev/null +++ b/api/regs/regs_client/filing_type/post_filing_types_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_type + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostFilingTypesParams creates a new PostFilingTypesParams object +// with the default values initialized. +func NewPostFilingTypesParams() *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostFilingTypesParamsWithTimeout creates a new PostFilingTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostFilingTypesParamsWithTimeout(timeout time.Duration) *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + + timeout: timeout, + } +} + +// NewPostFilingTypesParamsWithContext creates a new PostFilingTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostFilingTypesParamsWithContext(ctx context.Context) *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + + Context: ctx, + } +} + +// NewPostFilingTypesParamsWithHTTPClient creates a new PostFilingTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostFilingTypesParamsWithHTTPClient(client *http.Client) *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + HTTPClient: client, + } +} + +/*PostFilingTypesParams contains all the parameters to send to the API endpoint +for the post filing types operation typically these are written to a http.Request +*/ +type PostFilingTypesParams struct { + + /*FilingTypeRequest + A request with an array of FilingType Objects + + */ + FilingTypeRequest *regs_models.FilingTypeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post filing types params +func (o *PostFilingTypesParams) WithTimeout(timeout time.Duration) *PostFilingTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post filing types params +func (o *PostFilingTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post filing types params +func (o *PostFilingTypesParams) WithContext(ctx context.Context) *PostFilingTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post filing types params +func (o *PostFilingTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post filing types params +func (o *PostFilingTypesParams) WithHTTPClient(client *http.Client) *PostFilingTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post filing types params +func (o *PostFilingTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingTypeRequest adds the filingTypeRequest to the post filing types params +func (o *PostFilingTypesParams) WithFilingTypeRequest(filingTypeRequest *regs_models.FilingTypeRequest) *PostFilingTypesParams { + o.SetFilingTypeRequest(filingTypeRequest) + return o +} + +// SetFilingTypeRequest adds the filingTypeRequest to the post filing types params +func (o *PostFilingTypesParams) SetFilingTypeRequest(filingTypeRequest *regs_models.FilingTypeRequest) { + o.FilingTypeRequest = filingTypeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostFilingTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingTypeRequest != nil { + if err := r.SetBodyParam(o.FilingTypeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/filing_type/post_filing_types_responses.go b/api/regs/regs_client/filing_type/post_filing_types_responses.go new file mode 100644 index 0000000..7d2a998 --- /dev/null +++ b/api/regs/regs_client/filing_type/post_filing_types_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_type + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostFilingTypesReader is a Reader for the PostFilingTypes structure. +type PostFilingTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostFilingTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostFilingTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostFilingTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostFilingTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostFilingTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostFilingTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostFilingTypesOK creates a PostFilingTypesOK with default headers values +func NewPostFilingTypesOK() *PostFilingTypesOK { + return &PostFilingTypesOK{} +} + +/*PostFilingTypesOK handles this case with default header values. + +Taxnexus Response with an array of FilingType objects +*/ +type PostFilingTypesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.FilingTypeResponse +} + +func (o *PostFilingTypesOK) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesOK %+v", 200, o.Payload) +} + +func (o *PostFilingTypesOK) GetPayload() *regs_models.FilingTypeResponse { + return o.Payload +} + +func (o *PostFilingTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.FilingTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesUnauthorized creates a PostFilingTypesUnauthorized with default headers values +func NewPostFilingTypesUnauthorized() *PostFilingTypesUnauthorized { + return &PostFilingTypesUnauthorized{} +} + +/*PostFilingTypesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostFilingTypesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingTypesUnauthorized) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostFilingTypesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesForbidden creates a PostFilingTypesForbidden with default headers values +func NewPostFilingTypesForbidden() *PostFilingTypesForbidden { + return &PostFilingTypesForbidden{} +} + +/*PostFilingTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostFilingTypesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingTypesForbidden) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesForbidden %+v", 403, o.Payload) +} + +func (o *PostFilingTypesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesNotFound creates a PostFilingTypesNotFound with default headers values +func NewPostFilingTypesNotFound() *PostFilingTypesNotFound { + return &PostFilingTypesNotFound{} +} + +/*PostFilingTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostFilingTypesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingTypesNotFound) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesNotFound %+v", 404, o.Payload) +} + +func (o *PostFilingTypesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesUnprocessableEntity creates a PostFilingTypesUnprocessableEntity with default headers values +func NewPostFilingTypesUnprocessableEntity() *PostFilingTypesUnprocessableEntity { + return &PostFilingTypesUnprocessableEntity{} +} + +/*PostFilingTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostFilingTypesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostFilingTypesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesInternalServerError creates a PostFilingTypesInternalServerError with default headers values +func NewPostFilingTypesInternalServerError() *PostFilingTypesInternalServerError { + return &PostFilingTypesInternalServerError{} +} + +/*PostFilingTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostFilingTypesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostFilingTypesInternalServerError) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostFilingTypesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostFilingTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/filing_type/put_filing_types_parameters.go b/api/regs/regs_client/filing_type/put_filing_types_parameters.go new file mode 100644 index 0000000..e9754c4 --- /dev/null +++ b/api/regs/regs_client/filing_type/put_filing_types_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_type + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutFilingTypesParams creates a new PutFilingTypesParams object +// with the default values initialized. +func NewPutFilingTypesParams() *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutFilingTypesParamsWithTimeout creates a new PutFilingTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutFilingTypesParamsWithTimeout(timeout time.Duration) *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + + timeout: timeout, + } +} + +// NewPutFilingTypesParamsWithContext creates a new PutFilingTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutFilingTypesParamsWithContext(ctx context.Context) *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + + Context: ctx, + } +} + +// NewPutFilingTypesParamsWithHTTPClient creates a new PutFilingTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutFilingTypesParamsWithHTTPClient(client *http.Client) *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + HTTPClient: client, + } +} + +/*PutFilingTypesParams contains all the parameters to send to the API endpoint +for the put filing types operation typically these are written to a http.Request +*/ +type PutFilingTypesParams struct { + + /*FilingTypeRequest + A request with an array of FilingType Objects + + */ + FilingTypeRequest *regs_models.FilingTypeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put filing types params +func (o *PutFilingTypesParams) WithTimeout(timeout time.Duration) *PutFilingTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put filing types params +func (o *PutFilingTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put filing types params +func (o *PutFilingTypesParams) WithContext(ctx context.Context) *PutFilingTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put filing types params +func (o *PutFilingTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put filing types params +func (o *PutFilingTypesParams) WithHTTPClient(client *http.Client) *PutFilingTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put filing types params +func (o *PutFilingTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingTypeRequest adds the filingTypeRequest to the put filing types params +func (o *PutFilingTypesParams) WithFilingTypeRequest(filingTypeRequest *regs_models.FilingTypeRequest) *PutFilingTypesParams { + o.SetFilingTypeRequest(filingTypeRequest) + return o +} + +// SetFilingTypeRequest adds the filingTypeRequest to the put filing types params +func (o *PutFilingTypesParams) SetFilingTypeRequest(filingTypeRequest *regs_models.FilingTypeRequest) { + o.FilingTypeRequest = filingTypeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutFilingTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingTypeRequest != nil { + if err := r.SetBodyParam(o.FilingTypeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/filing_type/put_filing_types_responses.go b/api/regs/regs_client/filing_type/put_filing_types_responses.go new file mode 100644 index 0000000..fdfc3e4 --- /dev/null +++ b/api/regs/regs_client/filing_type/put_filing_types_responses.go @@ -0,0 +1,259 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_type + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutFilingTypesReader is a Reader for the PutFilingTypes structure. +type PutFilingTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutFilingTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutFilingTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutFilingTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutFilingTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutFilingTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutFilingTypesOK creates a PutFilingTypesOK with default headers values +func NewPutFilingTypesOK() *PutFilingTypesOK { + return &PutFilingTypesOK{} +} + +/*PutFilingTypesOK handles this case with default header values. + +Taxnexus Response with an array of FilingType objects +*/ +type PutFilingTypesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.FilingTypeResponse +} + +func (o *PutFilingTypesOK) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesOK %+v", 200, o.Payload) +} + +func (o *PutFilingTypesOK) GetPayload() *regs_models.FilingTypeResponse { + return o.Payload +} + +func (o *PutFilingTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.FilingTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesUnauthorized creates a PutFilingTypesUnauthorized with default headers values +func NewPutFilingTypesUnauthorized() *PutFilingTypesUnauthorized { + return &PutFilingTypesUnauthorized{} +} + +/*PutFilingTypesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutFilingTypesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingTypesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutFilingTypesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesForbidden creates a PutFilingTypesForbidden with default headers values +func NewPutFilingTypesForbidden() *PutFilingTypesForbidden { + return &PutFilingTypesForbidden{} +} + +/*PutFilingTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutFilingTypesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingTypesForbidden) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesForbidden %+v", 403, o.Payload) +} + +func (o *PutFilingTypesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesNotFound creates a PutFilingTypesNotFound with default headers values +func NewPutFilingTypesNotFound() *PutFilingTypesNotFound { + return &PutFilingTypesNotFound{} +} + +/*PutFilingTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutFilingTypesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingTypesNotFound) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesNotFound %+v", 404, o.Payload) +} + +func (o *PutFilingTypesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesInternalServerError creates a PutFilingTypesInternalServerError with default headers values +func NewPutFilingTypesInternalServerError() *PutFilingTypesInternalServerError { + return &PutFilingTypesInternalServerError{} +} + +/*PutFilingTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutFilingTypesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutFilingTypesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutFilingTypesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutFilingTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/license/get_licenses_parameters.go b/api/regs/regs_client/license/get_licenses_parameters.go new file mode 100644 index 0000000..d57feb1 --- /dev/null +++ b/api/regs/regs_client/license/get_licenses_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license + +// 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" +) + +// NewGetLicensesParams creates a new GetLicensesParams object +// with the default values initialized. +func NewGetLicensesParams() *GetLicensesParams { + var () + return &GetLicensesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLicensesParamsWithTimeout creates a new GetLicensesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLicensesParamsWithTimeout(timeout time.Duration) *GetLicensesParams { + var () + return &GetLicensesParams{ + + timeout: timeout, + } +} + +// NewGetLicensesParamsWithContext creates a new GetLicensesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLicensesParamsWithContext(ctx context.Context) *GetLicensesParams { + var () + return &GetLicensesParams{ + + Context: ctx, + } +} + +// NewGetLicensesParamsWithHTTPClient creates a new GetLicensesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLicensesParamsWithHTTPClient(client *http.Client) *GetLicensesParams { + var () + return &GetLicensesParams{ + HTTPClient: client, + } +} + +/*GetLicensesParams contains all the parameters to send to the API endpoint +for the get licenses operation typically these are written to a http.Request +*/ +type GetLicensesParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + /*LicenseID + Taxnexus Record Id of a License + + */ + LicenseID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get licenses params +func (o *GetLicensesParams) WithTimeout(timeout time.Duration) *GetLicensesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get licenses params +func (o *GetLicensesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get licenses params +func (o *GetLicensesParams) WithContext(ctx context.Context) *GetLicensesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get licenses params +func (o *GetLicensesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get licenses params +func (o *GetLicensesParams) WithHTTPClient(client *http.Client) *GetLicensesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get licenses params +func (o *GetLicensesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get licenses params +func (o *GetLicensesParams) WithAccountID(accountID *string) *GetLicensesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get licenses params +func (o *GetLicensesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithCompanyID adds the companyID to the get licenses params +func (o *GetLicensesParams) WithCompanyID(companyID *string) *GetLicensesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get licenses params +func (o *GetLicensesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithID adds the id to the get licenses params +func (o *GetLicensesParams) WithID(id *string) *GetLicensesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get licenses params +func (o *GetLicensesParams) SetID(id *string) { + o.ID = id +} + +// WithLicenseID adds the licenseID to the get licenses params +func (o *GetLicensesParams) WithLicenseID(licenseID *string) *GetLicensesParams { + o.SetLicenseID(licenseID) + return o +} + +// SetLicenseID adds the licenseId to the get licenses params +func (o *GetLicensesParams) SetLicenseID(licenseID *string) { + o.LicenseID = licenseID +} + +// WithLimit adds the limit to the get licenses params +func (o *GetLicensesParams) WithLimit(limit *int64) *GetLicensesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get licenses params +func (o *GetLicensesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get licenses params +func (o *GetLicensesParams) WithOffset(offset *int64) *GetLicensesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get licenses params +func (o *GetLicensesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLicensesParams) 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.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.LicenseID != nil { + + // query param licenseId + var qrLicenseID string + if o.LicenseID != nil { + qrLicenseID = *o.LicenseID + } + qLicenseID := qrLicenseID + if qLicenseID != "" { + if err := r.SetQueryParam("licenseId", qLicenseID); 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/regs/regs_client/license/get_licenses_responses.go b/api/regs/regs_client/license/get_licenses_responses.go new file mode 100644 index 0000000..f346318 --- /dev/null +++ b/api/regs/regs_client/license/get_licenses_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetLicensesReader is a Reader for the GetLicenses structure. +type GetLicensesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLicensesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLicensesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLicensesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLicensesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLicensesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetLicensesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLicensesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetLicensesOK creates a GetLicensesOK with default headers values +func NewGetLicensesOK() *GetLicensesOK { + return &GetLicensesOK{} +} + +/*GetLicensesOK handles this case with default header values. + +Taxnexus Response with License objects +*/ +type GetLicensesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.LicenseResponse +} + +func (o *GetLicensesOK) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesOK %+v", 200, o.Payload) +} + +func (o *GetLicensesOK) GetPayload() *regs_models.LicenseResponse { + return o.Payload +} + +func (o *GetLicensesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.LicenseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesUnauthorized creates a GetLicensesUnauthorized with default headers values +func NewGetLicensesUnauthorized() *GetLicensesUnauthorized { + return &GetLicensesUnauthorized{} +} + +/*GetLicensesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetLicensesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicensesUnauthorized) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetLicensesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicensesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesForbidden creates a GetLicensesForbidden with default headers values +func NewGetLicensesForbidden() *GetLicensesForbidden { + return &GetLicensesForbidden{} +} + +/*GetLicensesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetLicensesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicensesForbidden) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesForbidden %+v", 403, o.Payload) +} + +func (o *GetLicensesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicensesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesNotFound creates a GetLicensesNotFound with default headers values +func NewGetLicensesNotFound() *GetLicensesNotFound { + return &GetLicensesNotFound{} +} + +/*GetLicensesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetLicensesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicensesNotFound) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesNotFound %+v", 404, o.Payload) +} + +func (o *GetLicensesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicensesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesUnprocessableEntity creates a GetLicensesUnprocessableEntity with default headers values +func NewGetLicensesUnprocessableEntity() *GetLicensesUnprocessableEntity { + return &GetLicensesUnprocessableEntity{} +} + +/*GetLicensesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetLicensesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicensesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetLicensesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicensesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesInternalServerError creates a GetLicensesInternalServerError with default headers values +func NewGetLicensesInternalServerError() *GetLicensesInternalServerError { + return &GetLicensesInternalServerError{} +} + +/*GetLicensesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetLicensesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicensesInternalServerError) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetLicensesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicensesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/license/license_client.go b/api/regs/regs_client/license/license_client.go new file mode 100644 index 0000000..bcbaaeb --- /dev/null +++ b/api/regs/regs_client/license/license_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license + +// 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 license API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for license API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetLicenses(params *GetLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicensesOK, error) + + PostLicenses(params *PostLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PostLicensesOK, error) + + PutLicenses(params *PutLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PutLicensesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetLicenses retrieves licenses + + Retrieve all licenses, filter with parameters +*/ +func (a *Client) GetLicenses(params *GetLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicensesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLicensesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getLicenses", + Method: "GET", + PathPattern: "/licenses", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLicensesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetLicensesOK) + 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 getLicenses: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostLicenses creates new licenses + + Create new Licenses +*/ +func (a *Client) PostLicenses(params *PostLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PostLicensesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostLicensesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postLicenses", + Method: "POST", + PathPattern: "/licenses", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostLicensesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostLicensesOK) + 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 postLicenses: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutLicenses upserts a license + + Add or update licenses +*/ +func (a *Client) PutLicenses(params *PutLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PutLicensesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutLicensesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putLicenses", + Method: "PUT", + PathPattern: "/licenses", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutLicensesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutLicensesOK) + 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 putLicenses: 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/regs/regs_client/license/post_licenses_parameters.go b/api/regs/regs_client/license/post_licenses_parameters.go new file mode 100644 index 0000000..9b15977 --- /dev/null +++ b/api/regs/regs_client/license/post_licenses_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostLicensesParams creates a new PostLicensesParams object +// with the default values initialized. +func NewPostLicensesParams() *PostLicensesParams { + var () + return &PostLicensesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostLicensesParamsWithTimeout creates a new PostLicensesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostLicensesParamsWithTimeout(timeout time.Duration) *PostLicensesParams { + var () + return &PostLicensesParams{ + + timeout: timeout, + } +} + +// NewPostLicensesParamsWithContext creates a new PostLicensesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostLicensesParamsWithContext(ctx context.Context) *PostLicensesParams { + var () + return &PostLicensesParams{ + + Context: ctx, + } +} + +// NewPostLicensesParamsWithHTTPClient creates a new PostLicensesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostLicensesParamsWithHTTPClient(client *http.Client) *PostLicensesParams { + var () + return &PostLicensesParams{ + HTTPClient: client, + } +} + +/*PostLicensesParams contains all the parameters to send to the API endpoint +for the post licenses operation typically these are written to a http.Request +*/ +type PostLicensesParams struct { + + /*LicenseRequest + The new licenses + + */ + LicenseRequest *regs_models.LicenseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post licenses params +func (o *PostLicensesParams) WithTimeout(timeout time.Duration) *PostLicensesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post licenses params +func (o *PostLicensesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post licenses params +func (o *PostLicensesParams) WithContext(ctx context.Context) *PostLicensesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post licenses params +func (o *PostLicensesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post licenses params +func (o *PostLicensesParams) WithHTTPClient(client *http.Client) *PostLicensesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post licenses params +func (o *PostLicensesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicenseRequest adds the licenseRequest to the post licenses params +func (o *PostLicensesParams) WithLicenseRequest(licenseRequest *regs_models.LicenseRequest) *PostLicensesParams { + o.SetLicenseRequest(licenseRequest) + return o +} + +// SetLicenseRequest adds the licenseRequest to the post licenses params +func (o *PostLicensesParams) SetLicenseRequest(licenseRequest *regs_models.LicenseRequest) { + o.LicenseRequest = licenseRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostLicensesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LicenseRequest != nil { + if err := r.SetBodyParam(o.LicenseRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/license/post_licenses_responses.go b/api/regs/regs_client/license/post_licenses_responses.go new file mode 100644 index 0000000..279f40b --- /dev/null +++ b/api/regs/regs_client/license/post_licenses_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostLicensesReader is a Reader for the PostLicenses structure. +type PostLicensesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostLicensesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostLicensesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostLicensesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostLicensesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostLicensesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostLicensesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostLicensesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostLicensesOK creates a PostLicensesOK with default headers values +func NewPostLicensesOK() *PostLicensesOK { + return &PostLicensesOK{} +} + +/*PostLicensesOK handles this case with default header values. + +Taxnexus Response with License objects +*/ +type PostLicensesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.LicenseResponse +} + +func (o *PostLicensesOK) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesOK %+v", 200, o.Payload) +} + +func (o *PostLicensesOK) GetPayload() *regs_models.LicenseResponse { + return o.Payload +} + +func (o *PostLicensesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.LicenseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesUnauthorized creates a PostLicensesUnauthorized with default headers values +func NewPostLicensesUnauthorized() *PostLicensesUnauthorized { + return &PostLicensesUnauthorized{} +} + +/*PostLicensesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostLicensesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicensesUnauthorized) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostLicensesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicensesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesForbidden creates a PostLicensesForbidden with default headers values +func NewPostLicensesForbidden() *PostLicensesForbidden { + return &PostLicensesForbidden{} +} + +/*PostLicensesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostLicensesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicensesForbidden) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesForbidden %+v", 403, o.Payload) +} + +func (o *PostLicensesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicensesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesNotFound creates a PostLicensesNotFound with default headers values +func NewPostLicensesNotFound() *PostLicensesNotFound { + return &PostLicensesNotFound{} +} + +/*PostLicensesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostLicensesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicensesNotFound) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesNotFound %+v", 404, o.Payload) +} + +func (o *PostLicensesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicensesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesUnprocessableEntity creates a PostLicensesUnprocessableEntity with default headers values +func NewPostLicensesUnprocessableEntity() *PostLicensesUnprocessableEntity { + return &PostLicensesUnprocessableEntity{} +} + +/*PostLicensesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostLicensesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicensesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostLicensesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicensesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesInternalServerError creates a PostLicensesInternalServerError with default headers values +func NewPostLicensesInternalServerError() *PostLicensesInternalServerError { + return &PostLicensesInternalServerError{} +} + +/*PostLicensesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostLicensesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicensesInternalServerError) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostLicensesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicensesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/license/put_licenses_parameters.go b/api/regs/regs_client/license/put_licenses_parameters.go new file mode 100644 index 0000000..3157e00 --- /dev/null +++ b/api/regs/regs_client/license/put_licenses_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutLicensesParams creates a new PutLicensesParams object +// with the default values initialized. +func NewPutLicensesParams() *PutLicensesParams { + var () + return &PutLicensesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutLicensesParamsWithTimeout creates a new PutLicensesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutLicensesParamsWithTimeout(timeout time.Duration) *PutLicensesParams { + var () + return &PutLicensesParams{ + + timeout: timeout, + } +} + +// NewPutLicensesParamsWithContext creates a new PutLicensesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutLicensesParamsWithContext(ctx context.Context) *PutLicensesParams { + var () + return &PutLicensesParams{ + + Context: ctx, + } +} + +// NewPutLicensesParamsWithHTTPClient creates a new PutLicensesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutLicensesParamsWithHTTPClient(client *http.Client) *PutLicensesParams { + var () + return &PutLicensesParams{ + HTTPClient: client, + } +} + +/*PutLicensesParams contains all the parameters to send to the API endpoint +for the put licenses operation typically these are written to a http.Request +*/ +type PutLicensesParams struct { + + /*LicenseRequest + The updated licenses + + */ + LicenseRequest *regs_models.LicenseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put licenses params +func (o *PutLicensesParams) WithTimeout(timeout time.Duration) *PutLicensesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put licenses params +func (o *PutLicensesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put licenses params +func (o *PutLicensesParams) WithContext(ctx context.Context) *PutLicensesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put licenses params +func (o *PutLicensesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put licenses params +func (o *PutLicensesParams) WithHTTPClient(client *http.Client) *PutLicensesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put licenses params +func (o *PutLicensesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicenseRequest adds the licenseRequest to the put licenses params +func (o *PutLicensesParams) WithLicenseRequest(licenseRequest *regs_models.LicenseRequest) *PutLicensesParams { + o.SetLicenseRequest(licenseRequest) + return o +} + +// SetLicenseRequest adds the licenseRequest to the put licenses params +func (o *PutLicensesParams) SetLicenseRequest(licenseRequest *regs_models.LicenseRequest) { + o.LicenseRequest = licenseRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutLicensesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LicenseRequest != nil { + if err := r.SetBodyParam(o.LicenseRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/license/put_licenses_responses.go b/api/regs/regs_client/license/put_licenses_responses.go new file mode 100644 index 0000000..32489a1 --- /dev/null +++ b/api/regs/regs_client/license/put_licenses_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutLicensesReader is a Reader for the PutLicenses structure. +type PutLicensesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutLicensesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutLicensesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutLicensesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutLicensesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutLicensesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutLicensesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutLicensesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutLicensesOK creates a PutLicensesOK with default headers values +func NewPutLicensesOK() *PutLicensesOK { + return &PutLicensesOK{} +} + +/*PutLicensesOK handles this case with default header values. + +Taxnexus Response with License objects +*/ +type PutLicensesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.LicenseResponse +} + +func (o *PutLicensesOK) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesOK %+v", 200, o.Payload) +} + +func (o *PutLicensesOK) GetPayload() *regs_models.LicenseResponse { + return o.Payload +} + +func (o *PutLicensesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.LicenseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesUnauthorized creates a PutLicensesUnauthorized with default headers values +func NewPutLicensesUnauthorized() *PutLicensesUnauthorized { + return &PutLicensesUnauthorized{} +} + +/*PutLicensesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutLicensesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutLicensesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutLicensesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutLicensesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesForbidden creates a PutLicensesForbidden with default headers values +func NewPutLicensesForbidden() *PutLicensesForbidden { + return &PutLicensesForbidden{} +} + +/*PutLicensesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutLicensesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutLicensesForbidden) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesForbidden %+v", 403, o.Payload) +} + +func (o *PutLicensesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutLicensesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesNotFound creates a PutLicensesNotFound with default headers values +func NewPutLicensesNotFound() *PutLicensesNotFound { + return &PutLicensesNotFound{} +} + +/*PutLicensesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutLicensesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutLicensesNotFound) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesNotFound %+v", 404, o.Payload) +} + +func (o *PutLicensesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutLicensesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesUnprocessableEntity creates a PutLicensesUnprocessableEntity with default headers values +func NewPutLicensesUnprocessableEntity() *PutLicensesUnprocessableEntity { + return &PutLicensesUnprocessableEntity{} +} + +/*PutLicensesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutLicensesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutLicensesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutLicensesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutLicensesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesInternalServerError creates a PutLicensesInternalServerError with default headers values +func NewPutLicensesInternalServerError() *PutLicensesInternalServerError { + return &PutLicensesInternalServerError{} +} + +/*PutLicensesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutLicensesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutLicensesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutLicensesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutLicensesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/license_type/get_license_types_parameters.go b/api/regs/regs_client/license_type/get_license_types_parameters.go new file mode 100644 index 0000000..e5be45e --- /dev/null +++ b/api/regs/regs_client/license_type/get_license_types_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_type + +// 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" +) + +// NewGetLicenseTypesParams creates a new GetLicenseTypesParams object +// with the default values initialized. +func NewGetLicenseTypesParams() *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLicenseTypesParamsWithTimeout creates a new GetLicenseTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLicenseTypesParamsWithTimeout(timeout time.Duration) *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + + timeout: timeout, + } +} + +// NewGetLicenseTypesParamsWithContext creates a new GetLicenseTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLicenseTypesParamsWithContext(ctx context.Context) *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + + Context: ctx, + } +} + +// NewGetLicenseTypesParamsWithHTTPClient creates a new GetLicenseTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLicenseTypesParamsWithHTTPClient(client *http.Client) *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + HTTPClient: client, + } +} + +/*GetLicenseTypesParams contains all the parameters to send to the API endpoint +for the get license types operation typically these are written to a http.Request +*/ +type GetLicenseTypesParams struct { + + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + /*LicensetypeID + Taxnexus Record Id of a License Type + + */ + LicensetypeID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get license types params +func (o *GetLicenseTypesParams) WithTimeout(timeout time.Duration) *GetLicenseTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get license types params +func (o *GetLicenseTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get license types params +func (o *GetLicenseTypesParams) WithContext(ctx context.Context) *GetLicenseTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get license types params +func (o *GetLicenseTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get license types params +func (o *GetLicenseTypesParams) WithHTTPClient(client *http.Client) *GetLicenseTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get license types params +func (o *GetLicenseTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyID adds the companyID to the get license types params +func (o *GetLicenseTypesParams) WithCompanyID(companyID *string) *GetLicenseTypesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get license types params +func (o *GetLicenseTypesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithID adds the id to the get license types params +func (o *GetLicenseTypesParams) WithID(id *string) *GetLicenseTypesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get license types params +func (o *GetLicenseTypesParams) SetID(id *string) { + o.ID = id +} + +// WithLicensetypeID adds the licensetypeID to the get license types params +func (o *GetLicenseTypesParams) WithLicensetypeID(licensetypeID *string) *GetLicenseTypesParams { + o.SetLicensetypeID(licensetypeID) + return o +} + +// SetLicensetypeID adds the licensetypeId to the get license types params +func (o *GetLicenseTypesParams) SetLicensetypeID(licensetypeID *string) { + o.LicensetypeID = licensetypeID +} + +// WithLimit adds the limit to the get license types params +func (o *GetLicenseTypesParams) WithLimit(limit *int64) *GetLicenseTypesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get license types params +func (o *GetLicenseTypesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get license types params +func (o *GetLicenseTypesParams) WithOffset(offset *int64) *GetLicenseTypesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get license types params +func (o *GetLicenseTypesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLicenseTypesParams) 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.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.LicensetypeID != nil { + + // query param licensetypeId + var qrLicensetypeID string + if o.LicensetypeID != nil { + qrLicensetypeID = *o.LicensetypeID + } + qLicensetypeID := qrLicensetypeID + if qLicensetypeID != "" { + if err := r.SetQueryParam("licensetypeId", qLicensetypeID); 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/regs/regs_client/license_type/get_license_types_responses.go b/api/regs/regs_client/license_type/get_license_types_responses.go new file mode 100644 index 0000000..61322ec --- /dev/null +++ b/api/regs/regs_client/license_type/get_license_types_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_type + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetLicenseTypesReader is a Reader for the GetLicenseTypes structure. +type GetLicenseTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLicenseTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLicenseTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLicenseTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLicenseTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLicenseTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetLicenseTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLicenseTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetLicenseTypesOK creates a GetLicenseTypesOK with default headers values +func NewGetLicenseTypesOK() *GetLicenseTypesOK { + return &GetLicenseTypesOK{} +} + +/*GetLicenseTypesOK handles this case with default header values. + +Taxnexus Response with License objects +*/ +type GetLicenseTypesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.LicenseTypeResponse +} + +func (o *GetLicenseTypesOK) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesOK %+v", 200, o.Payload) +} + +func (o *GetLicenseTypesOK) GetPayload() *regs_models.LicenseTypeResponse { + return o.Payload +} + +func (o *GetLicenseTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.LicenseTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesUnauthorized creates a GetLicenseTypesUnauthorized with default headers values +func NewGetLicenseTypesUnauthorized() *GetLicenseTypesUnauthorized { + return &GetLicenseTypesUnauthorized{} +} + +/*GetLicenseTypesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetLicenseTypesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicenseTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetLicenseTypesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesForbidden creates a GetLicenseTypesForbidden with default headers values +func NewGetLicenseTypesForbidden() *GetLicenseTypesForbidden { + return &GetLicenseTypesForbidden{} +} + +/*GetLicenseTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetLicenseTypesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicenseTypesForbidden) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetLicenseTypesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesNotFound creates a GetLicenseTypesNotFound with default headers values +func NewGetLicenseTypesNotFound() *GetLicenseTypesNotFound { + return &GetLicenseTypesNotFound{} +} + +/*GetLicenseTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetLicenseTypesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicenseTypesNotFound) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetLicenseTypesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesUnprocessableEntity creates a GetLicenseTypesUnprocessableEntity with default headers values +func NewGetLicenseTypesUnprocessableEntity() *GetLicenseTypesUnprocessableEntity { + return &GetLicenseTypesUnprocessableEntity{} +} + +/*GetLicenseTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetLicenseTypesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicenseTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetLicenseTypesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesInternalServerError creates a GetLicenseTypesInternalServerError with default headers values +func NewGetLicenseTypesInternalServerError() *GetLicenseTypesInternalServerError { + return &GetLicenseTypesInternalServerError{} +} + +/*GetLicenseTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetLicenseTypesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetLicenseTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetLicenseTypesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/license_type/license_type_client.go b/api/regs/regs_client/license_type/license_type_client.go new file mode 100644 index 0000000..78f9157 --- /dev/null +++ b/api/regs/regs_client/license_type/license_type_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_type + +// 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 license type API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for license type API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetLicenseTypes(params *GetLicenseTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicenseTypesOK, error) + + PostLicenseTypes(params *PostLicenseTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostLicenseTypesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetLicenseTypes retrieves license type records + + Retrieve LicenseType records +*/ +func (a *Client) GetLicenseTypes(params *GetLicenseTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicenseTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLicenseTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getLicenseTypes", + Method: "GET", + PathPattern: "/licensetypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLicenseTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetLicenseTypesOK) + 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 getLicenseTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostLicenseTypes creates new licensetypes + + Create new LicenseType +*/ +func (a *Client) PostLicenseTypes(params *PostLicenseTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostLicenseTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostLicenseTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postLicenseTypes", + Method: "POST", + PathPattern: "/licensetypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostLicenseTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostLicenseTypesOK) + 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 postLicenseTypes: 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/regs/regs_client/license_type/post_license_types_parameters.go b/api/regs/regs_client/license_type/post_license_types_parameters.go new file mode 100644 index 0000000..05622a0 --- /dev/null +++ b/api/regs/regs_client/license_type/post_license_types_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_type + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostLicenseTypesParams creates a new PostLicenseTypesParams object +// with the default values initialized. +func NewPostLicenseTypesParams() *PostLicenseTypesParams { + var () + return &PostLicenseTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostLicenseTypesParamsWithTimeout creates a new PostLicenseTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostLicenseTypesParamsWithTimeout(timeout time.Duration) *PostLicenseTypesParams { + var () + return &PostLicenseTypesParams{ + + timeout: timeout, + } +} + +// NewPostLicenseTypesParamsWithContext creates a new PostLicenseTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostLicenseTypesParamsWithContext(ctx context.Context) *PostLicenseTypesParams { + var () + return &PostLicenseTypesParams{ + + Context: ctx, + } +} + +// NewPostLicenseTypesParamsWithHTTPClient creates a new PostLicenseTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostLicenseTypesParamsWithHTTPClient(client *http.Client) *PostLicenseTypesParams { + var () + return &PostLicenseTypesParams{ + HTTPClient: client, + } +} + +/*PostLicenseTypesParams contains all the parameters to send to the API endpoint +for the post license types operation typically these are written to a http.Request +*/ +type PostLicenseTypesParams struct { + + /*LicenseTypeRequest + The new license types + + */ + LicenseTypeRequest *regs_models.LicenseTypeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post license types params +func (o *PostLicenseTypesParams) WithTimeout(timeout time.Duration) *PostLicenseTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post license types params +func (o *PostLicenseTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post license types params +func (o *PostLicenseTypesParams) WithContext(ctx context.Context) *PostLicenseTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post license types params +func (o *PostLicenseTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post license types params +func (o *PostLicenseTypesParams) WithHTTPClient(client *http.Client) *PostLicenseTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post license types params +func (o *PostLicenseTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicenseTypeRequest adds the licenseTypeRequest to the post license types params +func (o *PostLicenseTypesParams) WithLicenseTypeRequest(licenseTypeRequest *regs_models.LicenseTypeRequest) *PostLicenseTypesParams { + o.SetLicenseTypeRequest(licenseTypeRequest) + return o +} + +// SetLicenseTypeRequest adds the licenseTypeRequest to the post license types params +func (o *PostLicenseTypesParams) SetLicenseTypeRequest(licenseTypeRequest *regs_models.LicenseTypeRequest) { + o.LicenseTypeRequest = licenseTypeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostLicenseTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LicenseTypeRequest != nil { + if err := r.SetBodyParam(o.LicenseTypeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/license_type/post_license_types_responses.go b/api/regs/regs_client/license_type/post_license_types_responses.go new file mode 100644 index 0000000..3237cff --- /dev/null +++ b/api/regs/regs_client/license_type/post_license_types_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_type + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostLicenseTypesReader is a Reader for the PostLicenseTypes structure. +type PostLicenseTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostLicenseTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostLicenseTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostLicenseTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostLicenseTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostLicenseTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostLicenseTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostLicenseTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostLicenseTypesOK creates a PostLicenseTypesOK with default headers values +func NewPostLicenseTypesOK() *PostLicenseTypesOK { + return &PostLicenseTypesOK{} +} + +/*PostLicenseTypesOK handles this case with default header values. + +Taxnexus Response with License objects +*/ +type PostLicenseTypesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.LicenseTypeResponse +} + +func (o *PostLicenseTypesOK) Error() string { + return fmt.Sprintf("[POST /licensetypes][%d] postLicenseTypesOK %+v", 200, o.Payload) +} + +func (o *PostLicenseTypesOK) GetPayload() *regs_models.LicenseTypeResponse { + return o.Payload +} + +func (o *PostLicenseTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.LicenseTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicenseTypesUnauthorized creates a PostLicenseTypesUnauthorized with default headers values +func NewPostLicenseTypesUnauthorized() *PostLicenseTypesUnauthorized { + return &PostLicenseTypesUnauthorized{} +} + +/*PostLicenseTypesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostLicenseTypesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicenseTypesUnauthorized) Error() string { + return fmt.Sprintf("[POST /licensetypes][%d] postLicenseTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostLicenseTypesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicenseTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicenseTypesForbidden creates a PostLicenseTypesForbidden with default headers values +func NewPostLicenseTypesForbidden() *PostLicenseTypesForbidden { + return &PostLicenseTypesForbidden{} +} + +/*PostLicenseTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostLicenseTypesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicenseTypesForbidden) Error() string { + return fmt.Sprintf("[POST /licensetypes][%d] postLicenseTypesForbidden %+v", 403, o.Payload) +} + +func (o *PostLicenseTypesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicenseTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicenseTypesNotFound creates a PostLicenseTypesNotFound with default headers values +func NewPostLicenseTypesNotFound() *PostLicenseTypesNotFound { + return &PostLicenseTypesNotFound{} +} + +/*PostLicenseTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostLicenseTypesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicenseTypesNotFound) Error() string { + return fmt.Sprintf("[POST /licensetypes][%d] postLicenseTypesNotFound %+v", 404, o.Payload) +} + +func (o *PostLicenseTypesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicenseTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicenseTypesUnprocessableEntity creates a PostLicenseTypesUnprocessableEntity with default headers values +func NewPostLicenseTypesUnprocessableEntity() *PostLicenseTypesUnprocessableEntity { + return &PostLicenseTypesUnprocessableEntity{} +} + +/*PostLicenseTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostLicenseTypesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicenseTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /licensetypes][%d] postLicenseTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostLicenseTypesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicenseTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicenseTypesInternalServerError creates a PostLicenseTypesInternalServerError with default headers values +func NewPostLicenseTypesInternalServerError() *PostLicenseTypesInternalServerError { + return &PostLicenseTypesInternalServerError{} +} + +/*PostLicenseTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostLicenseTypesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostLicenseTypesInternalServerError) Error() string { + return fmt.Sprintf("[POST /licensetypes][%d] postLicenseTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostLicenseTypesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostLicenseTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/notebook/get_notebooks_parameters.go b/api/regs/regs_client/notebook/get_notebooks_parameters.go new file mode 100644 index 0000000..6e612aa --- /dev/null +++ b/api/regs/regs_client/notebook/get_notebooks_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebook + +// 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" +) + +// NewGetNotebooksParams creates a new GetNotebooksParams object +// with the default values initialized. +func NewGetNotebooksParams() *GetNotebooksParams { + var () + return &GetNotebooksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetNotebooksParamsWithTimeout creates a new GetNotebooksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetNotebooksParamsWithTimeout(timeout time.Duration) *GetNotebooksParams { + var () + return &GetNotebooksParams{ + + timeout: timeout, + } +} + +// NewGetNotebooksParamsWithContext creates a new GetNotebooksParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetNotebooksParamsWithContext(ctx context.Context) *GetNotebooksParams { + var () + return &GetNotebooksParams{ + + Context: ctx, + } +} + +// NewGetNotebooksParamsWithHTTPClient creates a new GetNotebooksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetNotebooksParamsWithHTTPClient(client *http.Client) *GetNotebooksParams { + var () + return &GetNotebooksParams{ + HTTPClient: client, + } +} + +/*GetNotebooksParams contains all the parameters to send to the API endpoint +for the get notebooks operation typically these are written to a http.Request +*/ +type GetNotebooksParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*NotebookID + Template ID + + */ + NotebookID *string + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get notebooks params +func (o *GetNotebooksParams) WithTimeout(timeout time.Duration) *GetNotebooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get notebooks params +func (o *GetNotebooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get notebooks params +func (o *GetNotebooksParams) WithContext(ctx context.Context) *GetNotebooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get notebooks params +func (o *GetNotebooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get notebooks params +func (o *GetNotebooksParams) WithHTTPClient(client *http.Client) *GetNotebooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get notebooks params +func (o *GetNotebooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get notebooks params +func (o *GetNotebooksParams) WithLimit(limit *int64) *GetNotebooksParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get notebooks params +func (o *GetNotebooksParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithNotebookID adds the notebookID to the get notebooks params +func (o *GetNotebooksParams) WithNotebookID(notebookID *string) *GetNotebooksParams { + o.SetNotebookID(notebookID) + return o +} + +// SetNotebookID adds the notebookId to the get notebooks params +func (o *GetNotebooksParams) SetNotebookID(notebookID *string) { + o.NotebookID = notebookID +} + +// WithOffset adds the offset to the get notebooks params +func (o *GetNotebooksParams) WithOffset(offset *int64) *GetNotebooksParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get notebooks params +func (o *GetNotebooksParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetNotebooksParams) 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.NotebookID != nil { + + // query param notebookId + var qrNotebookID string + if o.NotebookID != nil { + qrNotebookID = *o.NotebookID + } + qNotebookID := qrNotebookID + if qNotebookID != "" { + if err := r.SetQueryParam("notebookId", qNotebookID); 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/regs/regs_client/notebook/get_notebooks_responses.go b/api/regs/regs_client/notebook/get_notebooks_responses.go new file mode 100644 index 0000000..368f22b --- /dev/null +++ b/api/regs/regs_client/notebook/get_notebooks_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebook + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetNotebooksReader is a Reader for the GetNotebooks structure. +type GetNotebooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetNotebooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetNotebooksUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetNotebooksForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetNotebooksNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetNotebooksUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetNotebooksInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetNotebooksOK creates a GetNotebooksOK with default headers values +func NewGetNotebooksOK() *GetNotebooksOK { + return &GetNotebooksOK{} +} + +/*GetNotebooksOK handles this case with default header values. + +Taxnexus Response with Notebook objects +*/ +type GetNotebooksOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.NotebookResponse +} + +func (o *GetNotebooksOK) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksOK %+v", 200, o.Payload) +} + +func (o *GetNotebooksOK) GetPayload() *regs_models.NotebookResponse { + return o.Payload +} + +func (o *GetNotebooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.NotebookResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksUnauthorized creates a GetNotebooksUnauthorized with default headers values +func NewGetNotebooksUnauthorized() *GetNotebooksUnauthorized { + return &GetNotebooksUnauthorized{} +} + +/*GetNotebooksUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetNotebooksUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetNotebooksUnauthorized) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksUnauthorized %+v", 401, o.Payload) +} + +func (o *GetNotebooksUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetNotebooksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksForbidden creates a GetNotebooksForbidden with default headers values +func NewGetNotebooksForbidden() *GetNotebooksForbidden { + return &GetNotebooksForbidden{} +} + +/*GetNotebooksForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetNotebooksForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetNotebooksForbidden) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksForbidden %+v", 403, o.Payload) +} + +func (o *GetNotebooksForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetNotebooksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksNotFound creates a GetNotebooksNotFound with default headers values +func NewGetNotebooksNotFound() *GetNotebooksNotFound { + return &GetNotebooksNotFound{} +} + +/*GetNotebooksNotFound handles this case with default header values. + +Resource was not found +*/ +type GetNotebooksNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetNotebooksNotFound) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksNotFound %+v", 404, o.Payload) +} + +func (o *GetNotebooksNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetNotebooksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksUnprocessableEntity creates a GetNotebooksUnprocessableEntity with default headers values +func NewGetNotebooksUnprocessableEntity() *GetNotebooksUnprocessableEntity { + return &GetNotebooksUnprocessableEntity{} +} + +/*GetNotebooksUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetNotebooksUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetNotebooksUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetNotebooksUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetNotebooksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksInternalServerError creates a GetNotebooksInternalServerError with default headers values +func NewGetNotebooksInternalServerError() *GetNotebooksInternalServerError { + return &GetNotebooksInternalServerError{} +} + +/*GetNotebooksInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetNotebooksInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetNotebooksInternalServerError) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksInternalServerError %+v", 500, o.Payload) +} + +func (o *GetNotebooksInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetNotebooksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/notebook/notebook_client.go b/api/regs/regs_client/notebook/notebook_client.go new file mode 100644 index 0000000..3edbb75 --- /dev/null +++ b/api/regs/regs_client/notebook/notebook_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebook + +// 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 notebook API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for notebook API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetNotebooks(params *GetNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*GetNotebooksOK, error) + + PostNotebooks(params *PostNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PostNotebooksOK, error) + + PutNotebooks(params *PutNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PutNotebooksOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetNotebooks gets a list of notebooks + + Return a list of Notebook records from the datastore +*/ +func (a *Client) GetNotebooks(params *GetNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*GetNotebooksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetNotebooksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getNotebooks", + Method: "GET", + PathPattern: "/notebooks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetNotebooksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetNotebooksOK) + 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 getNotebooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostNotebooks creates new notebooka + + Create Notebooks in Taxnexus +*/ +func (a *Client) PostNotebooks(params *PostNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PostNotebooksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostNotebooksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postNotebooks", + Method: "POST", + PathPattern: "/notebooks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostNotebooksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostNotebooksOK) + 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 postNotebooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutNotebooks updates notebooks + + Update Notebooks in Taxnexus +*/ +func (a *Client) PutNotebooks(params *PutNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PutNotebooksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutNotebooksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putNotebooks", + Method: "PUT", + PathPattern: "/notebooks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutNotebooksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutNotebooksOK) + 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 putNotebooks: 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/regs/regs_client/notebook/post_notebooks_parameters.go b/api/regs/regs_client/notebook/post_notebooks_parameters.go new file mode 100644 index 0000000..8d15698 --- /dev/null +++ b/api/regs/regs_client/notebook/post_notebooks_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebook + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostNotebooksParams creates a new PostNotebooksParams object +// with the default values initialized. +func NewPostNotebooksParams() *PostNotebooksParams { + var () + return &PostNotebooksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostNotebooksParamsWithTimeout creates a new PostNotebooksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostNotebooksParamsWithTimeout(timeout time.Duration) *PostNotebooksParams { + var () + return &PostNotebooksParams{ + + timeout: timeout, + } +} + +// NewPostNotebooksParamsWithContext creates a new PostNotebooksParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostNotebooksParamsWithContext(ctx context.Context) *PostNotebooksParams { + var () + return &PostNotebooksParams{ + + Context: ctx, + } +} + +// NewPostNotebooksParamsWithHTTPClient creates a new PostNotebooksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostNotebooksParamsWithHTTPClient(client *http.Client) *PostNotebooksParams { + var () + return &PostNotebooksParams{ + HTTPClient: client, + } +} + +/*PostNotebooksParams contains all the parameters to send to the API endpoint +for the post notebooks operation typically these are written to a http.Request +*/ +type PostNotebooksParams struct { + + /*NotebookRequest + An array of Notebook records + + */ + NotebookRequest *regs_models.NotebookRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post notebooks params +func (o *PostNotebooksParams) WithTimeout(timeout time.Duration) *PostNotebooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post notebooks params +func (o *PostNotebooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post notebooks params +func (o *PostNotebooksParams) WithContext(ctx context.Context) *PostNotebooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post notebooks params +func (o *PostNotebooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post notebooks params +func (o *PostNotebooksParams) WithHTTPClient(client *http.Client) *PostNotebooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post notebooks params +func (o *PostNotebooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNotebookRequest adds the notebookRequest to the post notebooks params +func (o *PostNotebooksParams) WithNotebookRequest(notebookRequest *regs_models.NotebookRequest) *PostNotebooksParams { + o.SetNotebookRequest(notebookRequest) + return o +} + +// SetNotebookRequest adds the notebookRequest to the post notebooks params +func (o *PostNotebooksParams) SetNotebookRequest(notebookRequest *regs_models.NotebookRequest) { + o.NotebookRequest = notebookRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostNotebooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.NotebookRequest != nil { + if err := r.SetBodyParam(o.NotebookRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/notebook/post_notebooks_responses.go b/api/regs/regs_client/notebook/post_notebooks_responses.go new file mode 100644 index 0000000..90e6858 --- /dev/null +++ b/api/regs/regs_client/notebook/post_notebooks_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebook + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostNotebooksReader is a Reader for the PostNotebooks structure. +type PostNotebooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostNotebooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostNotebooksUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostNotebooksForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostNotebooksNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostNotebooksUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostNotebooksInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostNotebooksOK creates a PostNotebooksOK with default headers values +func NewPostNotebooksOK() *PostNotebooksOK { + return &PostNotebooksOK{} +} + +/*PostNotebooksOK handles this case with default header values. + +Taxnexus Response with Notebook objects +*/ +type PostNotebooksOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.NotebookResponse +} + +func (o *PostNotebooksOK) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksOK %+v", 200, o.Payload) +} + +func (o *PostNotebooksOK) GetPayload() *regs_models.NotebookResponse { + return o.Payload +} + +func (o *PostNotebooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.NotebookResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksUnauthorized creates a PostNotebooksUnauthorized with default headers values +func NewPostNotebooksUnauthorized() *PostNotebooksUnauthorized { + return &PostNotebooksUnauthorized{} +} + +/*PostNotebooksUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostNotebooksUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostNotebooksUnauthorized) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksUnauthorized %+v", 401, o.Payload) +} + +func (o *PostNotebooksUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostNotebooksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksForbidden creates a PostNotebooksForbidden with default headers values +func NewPostNotebooksForbidden() *PostNotebooksForbidden { + return &PostNotebooksForbidden{} +} + +/*PostNotebooksForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostNotebooksForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostNotebooksForbidden) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksForbidden %+v", 403, o.Payload) +} + +func (o *PostNotebooksForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostNotebooksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksNotFound creates a PostNotebooksNotFound with default headers values +func NewPostNotebooksNotFound() *PostNotebooksNotFound { + return &PostNotebooksNotFound{} +} + +/*PostNotebooksNotFound handles this case with default header values. + +Resource was not found +*/ +type PostNotebooksNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostNotebooksNotFound) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksNotFound %+v", 404, o.Payload) +} + +func (o *PostNotebooksNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostNotebooksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksUnprocessableEntity creates a PostNotebooksUnprocessableEntity with default headers values +func NewPostNotebooksUnprocessableEntity() *PostNotebooksUnprocessableEntity { + return &PostNotebooksUnprocessableEntity{} +} + +/*PostNotebooksUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostNotebooksUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostNotebooksUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostNotebooksUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostNotebooksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksInternalServerError creates a PostNotebooksInternalServerError with default headers values +func NewPostNotebooksInternalServerError() *PostNotebooksInternalServerError { + return &PostNotebooksInternalServerError{} +} + +/*PostNotebooksInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostNotebooksInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostNotebooksInternalServerError) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksInternalServerError %+v", 500, o.Payload) +} + +func (o *PostNotebooksInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostNotebooksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/notebook/put_notebooks_parameters.go b/api/regs/regs_client/notebook/put_notebooks_parameters.go new file mode 100644 index 0000000..4c2df11 --- /dev/null +++ b/api/regs/regs_client/notebook/put_notebooks_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebook + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutNotebooksParams creates a new PutNotebooksParams object +// with the default values initialized. +func NewPutNotebooksParams() *PutNotebooksParams { + var () + return &PutNotebooksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutNotebooksParamsWithTimeout creates a new PutNotebooksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutNotebooksParamsWithTimeout(timeout time.Duration) *PutNotebooksParams { + var () + return &PutNotebooksParams{ + + timeout: timeout, + } +} + +// NewPutNotebooksParamsWithContext creates a new PutNotebooksParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutNotebooksParamsWithContext(ctx context.Context) *PutNotebooksParams { + var () + return &PutNotebooksParams{ + + Context: ctx, + } +} + +// NewPutNotebooksParamsWithHTTPClient creates a new PutNotebooksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutNotebooksParamsWithHTTPClient(client *http.Client) *PutNotebooksParams { + var () + return &PutNotebooksParams{ + HTTPClient: client, + } +} + +/*PutNotebooksParams contains all the parameters to send to the API endpoint +for the put notebooks operation typically these are written to a http.Request +*/ +type PutNotebooksParams struct { + + /*NotebookRequest + An array of Notebook records + + */ + NotebookRequest *regs_models.NotebookRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put notebooks params +func (o *PutNotebooksParams) WithTimeout(timeout time.Duration) *PutNotebooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put notebooks params +func (o *PutNotebooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put notebooks params +func (o *PutNotebooksParams) WithContext(ctx context.Context) *PutNotebooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put notebooks params +func (o *PutNotebooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put notebooks params +func (o *PutNotebooksParams) WithHTTPClient(client *http.Client) *PutNotebooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put notebooks params +func (o *PutNotebooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNotebookRequest adds the notebookRequest to the put notebooks params +func (o *PutNotebooksParams) WithNotebookRequest(notebookRequest *regs_models.NotebookRequest) *PutNotebooksParams { + o.SetNotebookRequest(notebookRequest) + return o +} + +// SetNotebookRequest adds the notebookRequest to the put notebooks params +func (o *PutNotebooksParams) SetNotebookRequest(notebookRequest *regs_models.NotebookRequest) { + o.NotebookRequest = notebookRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutNotebooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.NotebookRequest != nil { + if err := r.SetBodyParam(o.NotebookRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/notebook/put_notebooks_responses.go b/api/regs/regs_client/notebook/put_notebooks_responses.go new file mode 100644 index 0000000..3d26e7a --- /dev/null +++ b/api/regs/regs_client/notebook/put_notebooks_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebook + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutNotebooksReader is a Reader for the PutNotebooks structure. +type PutNotebooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutNotebooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutNotebooksUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutNotebooksForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutNotebooksNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutNotebooksUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutNotebooksInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutNotebooksOK creates a PutNotebooksOK with default headers values +func NewPutNotebooksOK() *PutNotebooksOK { + return &PutNotebooksOK{} +} + +/*PutNotebooksOK handles this case with default header values. + +Taxnexus Response with Notebook objects +*/ +type PutNotebooksOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.NotebookResponse +} + +func (o *PutNotebooksOK) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksOK %+v", 200, o.Payload) +} + +func (o *PutNotebooksOK) GetPayload() *regs_models.NotebookResponse { + return o.Payload +} + +func (o *PutNotebooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.NotebookResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksUnauthorized creates a PutNotebooksUnauthorized with default headers values +func NewPutNotebooksUnauthorized() *PutNotebooksUnauthorized { + return &PutNotebooksUnauthorized{} +} + +/*PutNotebooksUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutNotebooksUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutNotebooksUnauthorized) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksUnauthorized %+v", 401, o.Payload) +} + +func (o *PutNotebooksUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutNotebooksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksForbidden creates a PutNotebooksForbidden with default headers values +func NewPutNotebooksForbidden() *PutNotebooksForbidden { + return &PutNotebooksForbidden{} +} + +/*PutNotebooksForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutNotebooksForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutNotebooksForbidden) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksForbidden %+v", 403, o.Payload) +} + +func (o *PutNotebooksForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutNotebooksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksNotFound creates a PutNotebooksNotFound with default headers values +func NewPutNotebooksNotFound() *PutNotebooksNotFound { + return &PutNotebooksNotFound{} +} + +/*PutNotebooksNotFound handles this case with default header values. + +Resource was not found +*/ +type PutNotebooksNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutNotebooksNotFound) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksNotFound %+v", 404, o.Payload) +} + +func (o *PutNotebooksNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutNotebooksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksUnprocessableEntity creates a PutNotebooksUnprocessableEntity with default headers values +func NewPutNotebooksUnprocessableEntity() *PutNotebooksUnprocessableEntity { + return &PutNotebooksUnprocessableEntity{} +} + +/*PutNotebooksUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutNotebooksUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutNotebooksUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutNotebooksUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutNotebooksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksInternalServerError creates a PutNotebooksInternalServerError with default headers values +func NewPutNotebooksInternalServerError() *PutNotebooksInternalServerError { + return &PutNotebooksInternalServerError{} +} + +/*PutNotebooksInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutNotebooksInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutNotebooksInternalServerError) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksInternalServerError %+v", 500, o.Payload) +} + +func (o *PutNotebooksInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutNotebooksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/rating_engine/delete_rating_engine_parameters.go b/api/regs/regs_client/rating_engine/delete_rating_engine_parameters.go new file mode 100644 index 0000000..301e673 --- /dev/null +++ b/api/regs/regs_client/rating_engine/delete_rating_engine_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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" +) + +// NewDeleteRatingEngineParams creates a new DeleteRatingEngineParams object +// with the default values initialized. +func NewDeleteRatingEngineParams() *DeleteRatingEngineParams { + var () + return &DeleteRatingEngineParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteRatingEngineParamsWithTimeout creates a new DeleteRatingEngineParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteRatingEngineParamsWithTimeout(timeout time.Duration) *DeleteRatingEngineParams { + var () + return &DeleteRatingEngineParams{ + + timeout: timeout, + } +} + +// NewDeleteRatingEngineParamsWithContext creates a new DeleteRatingEngineParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteRatingEngineParamsWithContext(ctx context.Context) *DeleteRatingEngineParams { + var () + return &DeleteRatingEngineParams{ + + Context: ctx, + } +} + +// NewDeleteRatingEngineParamsWithHTTPClient creates a new DeleteRatingEngineParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteRatingEngineParamsWithHTTPClient(client *http.Client) *DeleteRatingEngineParams { + var () + return &DeleteRatingEngineParams{ + HTTPClient: client, + } +} + +/*DeleteRatingEngineParams contains all the parameters to send to the API endpoint +for the delete rating engine operation typically these are written to a http.Request +*/ +type DeleteRatingEngineParams struct { + + /*ID + Taxnexus Id of the Record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete rating engine params +func (o *DeleteRatingEngineParams) WithTimeout(timeout time.Duration) *DeleteRatingEngineParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete rating engine params +func (o *DeleteRatingEngineParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete rating engine params +func (o *DeleteRatingEngineParams) WithContext(ctx context.Context) *DeleteRatingEngineParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete rating engine params +func (o *DeleteRatingEngineParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete rating engine params +func (o *DeleteRatingEngineParams) WithHTTPClient(client *http.Client) *DeleteRatingEngineParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete rating engine params +func (o *DeleteRatingEngineParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete rating engine params +func (o *DeleteRatingEngineParams) WithID(id *string) *DeleteRatingEngineParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete rating engine params +func (o *DeleteRatingEngineParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteRatingEngineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/rating_engine/delete_rating_engine_responses.go b/api/regs/regs_client/rating_engine/delete_rating_engine_responses.go new file mode 100644 index 0000000..0885ce0 --- /dev/null +++ b/api/regs/regs_client/rating_engine/delete_rating_engine_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// DeleteRatingEngineReader is a Reader for the DeleteRatingEngine structure. +type DeleteRatingEngineReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteRatingEngineReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteRatingEngineOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteRatingEngineUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteRatingEngineForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteRatingEngineNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteRatingEngineUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteRatingEngineInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteRatingEngineOK creates a DeleteRatingEngineOK with default headers values +func NewDeleteRatingEngineOK() *DeleteRatingEngineOK { + return &DeleteRatingEngineOK{} +} + +/*DeleteRatingEngineOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteRatingEngineOK struct { + AccessControlAllowOrigin string + + Payload *regs_models.DeleteResponse +} + +func (o *DeleteRatingEngineOK) Error() string { + return fmt.Sprintf("[DELETE /ratingengines][%d] deleteRatingEngineOK %+v", 200, o.Payload) +} + +func (o *DeleteRatingEngineOK) GetPayload() *regs_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteRatingEngineOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRatingEngineUnauthorized creates a DeleteRatingEngineUnauthorized with default headers values +func NewDeleteRatingEngineUnauthorized() *DeleteRatingEngineUnauthorized { + return &DeleteRatingEngineUnauthorized{} +} + +/*DeleteRatingEngineUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type DeleteRatingEngineUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteRatingEngineUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /ratingengines][%d] deleteRatingEngineUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteRatingEngineUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteRatingEngineUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRatingEngineForbidden creates a DeleteRatingEngineForbidden with default headers values +func NewDeleteRatingEngineForbidden() *DeleteRatingEngineForbidden { + return &DeleteRatingEngineForbidden{} +} + +/*DeleteRatingEngineForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteRatingEngineForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteRatingEngineForbidden) Error() string { + return fmt.Sprintf("[DELETE /ratingengines][%d] deleteRatingEngineForbidden %+v", 403, o.Payload) +} + +func (o *DeleteRatingEngineForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteRatingEngineForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRatingEngineNotFound creates a DeleteRatingEngineNotFound with default headers values +func NewDeleteRatingEngineNotFound() *DeleteRatingEngineNotFound { + return &DeleteRatingEngineNotFound{} +} + +/*DeleteRatingEngineNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteRatingEngineNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteRatingEngineNotFound) Error() string { + return fmt.Sprintf("[DELETE /ratingengines][%d] deleteRatingEngineNotFound %+v", 404, o.Payload) +} + +func (o *DeleteRatingEngineNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteRatingEngineNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRatingEngineUnprocessableEntity creates a DeleteRatingEngineUnprocessableEntity with default headers values +func NewDeleteRatingEngineUnprocessableEntity() *DeleteRatingEngineUnprocessableEntity { + return &DeleteRatingEngineUnprocessableEntity{} +} + +/*DeleteRatingEngineUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteRatingEngineUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteRatingEngineUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /ratingengines][%d] deleteRatingEngineUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteRatingEngineUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteRatingEngineUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteRatingEngineInternalServerError creates a DeleteRatingEngineInternalServerError with default headers values +func NewDeleteRatingEngineInternalServerError() *DeleteRatingEngineInternalServerError { + return &DeleteRatingEngineInternalServerError{} +} + +/*DeleteRatingEngineInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteRatingEngineInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteRatingEngineInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /ratingengines][%d] deleteRatingEngineInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteRatingEngineInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteRatingEngineInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/rating_engine/get_rating_engines_parameters.go b/api/regs/regs_client/rating_engine/get_rating_engines_parameters.go new file mode 100644 index 0000000..32f9d2d --- /dev/null +++ b/api/regs/regs_client/rating_engine/get_rating_engines_parameters.go @@ -0,0 +1,375 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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" +) + +// NewGetRatingEnginesParams creates a new GetRatingEnginesParams object +// with the default values initialized. +func NewGetRatingEnginesParams() *GetRatingEnginesParams { + var () + return &GetRatingEnginesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRatingEnginesParamsWithTimeout creates a new GetRatingEnginesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRatingEnginesParamsWithTimeout(timeout time.Duration) *GetRatingEnginesParams { + var () + return &GetRatingEnginesParams{ + + timeout: timeout, + } +} + +// NewGetRatingEnginesParamsWithContext creates a new GetRatingEnginesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRatingEnginesParamsWithContext(ctx context.Context) *GetRatingEnginesParams { + var () + return &GetRatingEnginesParams{ + + Context: ctx, + } +} + +// NewGetRatingEnginesParamsWithHTTPClient creates a new GetRatingEnginesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRatingEnginesParamsWithHTTPClient(client *http.Client) *GetRatingEnginesParams { + var () + return &GetRatingEnginesParams{ + HTTPClient: client, + } +} + +/*GetRatingEnginesParams contains all the parameters to send to the API endpoint +for the get rating engines operation typically these are written to a http.Request +*/ +type GetRatingEnginesParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*AccountNumber + The Taxnexus Account Number of the Account to be used a record retrieval + + */ + AccountNumber *string + /*BackendID + Taxnexus Id of the Backend to be retrieved + + */ + BackendID *string + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Name + The Name of this Object + + */ + Name *string + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get rating engines params +func (o *GetRatingEnginesParams) WithTimeout(timeout time.Duration) *GetRatingEnginesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get rating engines params +func (o *GetRatingEnginesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get rating engines params +func (o *GetRatingEnginesParams) WithContext(ctx context.Context) *GetRatingEnginesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get rating engines params +func (o *GetRatingEnginesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get rating engines params +func (o *GetRatingEnginesParams) WithHTTPClient(client *http.Client) *GetRatingEnginesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get rating engines params +func (o *GetRatingEnginesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get rating engines params +func (o *GetRatingEnginesParams) WithAccountID(accountID *string) *GetRatingEnginesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get rating engines params +func (o *GetRatingEnginesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithAccountNumber adds the accountNumber to the get rating engines params +func (o *GetRatingEnginesParams) WithAccountNumber(accountNumber *string) *GetRatingEnginesParams { + o.SetAccountNumber(accountNumber) + return o +} + +// SetAccountNumber adds the accountNumber to the get rating engines params +func (o *GetRatingEnginesParams) SetAccountNumber(accountNumber *string) { + o.AccountNumber = accountNumber +} + +// WithBackendID adds the backendID to the get rating engines params +func (o *GetRatingEnginesParams) WithBackendID(backendID *string) *GetRatingEnginesParams { + o.SetBackendID(backendID) + return o +} + +// SetBackendID adds the backendId to the get rating engines params +func (o *GetRatingEnginesParams) SetBackendID(backendID *string) { + o.BackendID = backendID +} + +// WithCompanyID adds the companyID to the get rating engines params +func (o *GetRatingEnginesParams) WithCompanyID(companyID *string) *GetRatingEnginesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get rating engines params +func (o *GetRatingEnginesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithID adds the id to the get rating engines params +func (o *GetRatingEnginesParams) WithID(id *string) *GetRatingEnginesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get rating engines params +func (o *GetRatingEnginesParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get rating engines params +func (o *GetRatingEnginesParams) WithLimit(limit *int64) *GetRatingEnginesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get rating engines params +func (o *GetRatingEnginesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the get rating engines params +func (o *GetRatingEnginesParams) WithName(name *string) *GetRatingEnginesParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get rating engines params +func (o *GetRatingEnginesParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the get rating engines params +func (o *GetRatingEnginesParams) WithOffset(offset *int64) *GetRatingEnginesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get rating engines params +func (o *GetRatingEnginesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRatingEnginesParams) 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.AccountNumber != nil { + + // query param accountNumber + var qrAccountNumber string + if o.AccountNumber != nil { + qrAccountNumber = *o.AccountNumber + } + qAccountNumber := qrAccountNumber + if qAccountNumber != "" { + if err := r.SetQueryParam("accountNumber", qAccountNumber); err != nil { + return err + } + } + + } + + if o.BackendID != nil { + + // query param backendId + var qrBackendID string + if o.BackendID != nil { + qrBackendID = *o.BackendID + } + qBackendID := qrBackendID + if qBackendID != "" { + if err := r.SetQueryParam("backendId", qBackendID); 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.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.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/regs/regs_client/rating_engine/get_rating_engines_responses.go b/api/regs/regs_client/rating_engine/get_rating_engines_responses.go new file mode 100644 index 0000000..f550885 --- /dev/null +++ b/api/regs/regs_client/rating_engine/get_rating_engines_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetRatingEnginesReader is a Reader for the GetRatingEngines structure. +type GetRatingEnginesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRatingEnginesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRatingEnginesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRatingEnginesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRatingEnginesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRatingEnginesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRatingEnginesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRatingEnginesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRatingEnginesOK creates a GetRatingEnginesOK with default headers values +func NewGetRatingEnginesOK() *GetRatingEnginesOK { + return &GetRatingEnginesOK{} +} + +/*GetRatingEnginesOK handles this case with default header values. + +Taxnexus Response with Rating Engine objects +*/ +type GetRatingEnginesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.RatingEngineResponse +} + +func (o *GetRatingEnginesOK) Error() string { + return fmt.Sprintf("[GET /ratingengines][%d] getRatingEnginesOK %+v", 200, o.Payload) +} + +func (o *GetRatingEnginesOK) GetPayload() *regs_models.RatingEngineResponse { + return o.Payload +} + +func (o *GetRatingEnginesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.RatingEngineResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRatingEnginesUnauthorized creates a GetRatingEnginesUnauthorized with default headers values +func NewGetRatingEnginesUnauthorized() *GetRatingEnginesUnauthorized { + return &GetRatingEnginesUnauthorized{} +} + +/*GetRatingEnginesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetRatingEnginesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetRatingEnginesUnauthorized) Error() string { + return fmt.Sprintf("[GET /ratingengines][%d] getRatingEnginesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRatingEnginesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetRatingEnginesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRatingEnginesForbidden creates a GetRatingEnginesForbidden with default headers values +func NewGetRatingEnginesForbidden() *GetRatingEnginesForbidden { + return &GetRatingEnginesForbidden{} +} + +/*GetRatingEnginesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRatingEnginesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetRatingEnginesForbidden) Error() string { + return fmt.Sprintf("[GET /ratingengines][%d] getRatingEnginesForbidden %+v", 403, o.Payload) +} + +func (o *GetRatingEnginesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetRatingEnginesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRatingEnginesNotFound creates a GetRatingEnginesNotFound with default headers values +func NewGetRatingEnginesNotFound() *GetRatingEnginesNotFound { + return &GetRatingEnginesNotFound{} +} + +/*GetRatingEnginesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRatingEnginesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetRatingEnginesNotFound) Error() string { + return fmt.Sprintf("[GET /ratingengines][%d] getRatingEnginesNotFound %+v", 404, o.Payload) +} + +func (o *GetRatingEnginesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetRatingEnginesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRatingEnginesUnprocessableEntity creates a GetRatingEnginesUnprocessableEntity with default headers values +func NewGetRatingEnginesUnprocessableEntity() *GetRatingEnginesUnprocessableEntity { + return &GetRatingEnginesUnprocessableEntity{} +} + +/*GetRatingEnginesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRatingEnginesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetRatingEnginesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /ratingengines][%d] getRatingEnginesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRatingEnginesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetRatingEnginesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRatingEnginesInternalServerError creates a GetRatingEnginesInternalServerError with default headers values +func NewGetRatingEnginesInternalServerError() *GetRatingEnginesInternalServerError { + return &GetRatingEnginesInternalServerError{} +} + +/*GetRatingEnginesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRatingEnginesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetRatingEnginesInternalServerError) Error() string { + return fmt.Sprintf("[GET /ratingengines][%d] getRatingEnginesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRatingEnginesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetRatingEnginesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/rating_engine/post_rating_engines_parameters.go b/api/regs/regs_client/rating_engine/post_rating_engines_parameters.go new file mode 100644 index 0000000..ef72649 --- /dev/null +++ b/api/regs/regs_client/rating_engine/post_rating_engines_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostRatingEnginesParams creates a new PostRatingEnginesParams object +// with the default values initialized. +func NewPostRatingEnginesParams() *PostRatingEnginesParams { + var () + return &PostRatingEnginesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostRatingEnginesParamsWithTimeout creates a new PostRatingEnginesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostRatingEnginesParamsWithTimeout(timeout time.Duration) *PostRatingEnginesParams { + var () + return &PostRatingEnginesParams{ + + timeout: timeout, + } +} + +// NewPostRatingEnginesParamsWithContext creates a new PostRatingEnginesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostRatingEnginesParamsWithContext(ctx context.Context) *PostRatingEnginesParams { + var () + return &PostRatingEnginesParams{ + + Context: ctx, + } +} + +// NewPostRatingEnginesParamsWithHTTPClient creates a new PostRatingEnginesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostRatingEnginesParamsWithHTTPClient(client *http.Client) *PostRatingEnginesParams { + var () + return &PostRatingEnginesParams{ + HTTPClient: client, + } +} + +/*PostRatingEnginesParams contains all the parameters to send to the API endpoint +for the post rating engines operation typically these are written to a http.Request +*/ +type PostRatingEnginesParams struct { + + /*RatingEngineRequest + An array of new Submission records + + */ + RatingEngineRequest *regs_models.RatingEngineRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post rating engines params +func (o *PostRatingEnginesParams) WithTimeout(timeout time.Duration) *PostRatingEnginesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post rating engines params +func (o *PostRatingEnginesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post rating engines params +func (o *PostRatingEnginesParams) WithContext(ctx context.Context) *PostRatingEnginesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post rating engines params +func (o *PostRatingEnginesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post rating engines params +func (o *PostRatingEnginesParams) WithHTTPClient(client *http.Client) *PostRatingEnginesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post rating engines params +func (o *PostRatingEnginesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRatingEngineRequest adds the ratingEngineRequest to the post rating engines params +func (o *PostRatingEnginesParams) WithRatingEngineRequest(ratingEngineRequest *regs_models.RatingEngineRequest) *PostRatingEnginesParams { + o.SetRatingEngineRequest(ratingEngineRequest) + return o +} + +// SetRatingEngineRequest adds the ratingEngineRequest to the post rating engines params +func (o *PostRatingEnginesParams) SetRatingEngineRequest(ratingEngineRequest *regs_models.RatingEngineRequest) { + o.RatingEngineRequest = ratingEngineRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostRatingEnginesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RatingEngineRequest != nil { + if err := r.SetBodyParam(o.RatingEngineRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/rating_engine/post_rating_engines_responses.go b/api/regs/regs_client/rating_engine/post_rating_engines_responses.go new file mode 100644 index 0000000..b26aea0 --- /dev/null +++ b/api/regs/regs_client/rating_engine/post_rating_engines_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostRatingEnginesReader is a Reader for the PostRatingEngines structure. +type PostRatingEnginesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostRatingEnginesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostRatingEnginesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostRatingEnginesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostRatingEnginesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostRatingEnginesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostRatingEnginesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostRatingEnginesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostRatingEnginesOK creates a PostRatingEnginesOK with default headers values +func NewPostRatingEnginesOK() *PostRatingEnginesOK { + return &PostRatingEnginesOK{} +} + +/*PostRatingEnginesOK handles this case with default header values. + +Taxnexus Response with License objects +*/ +type PostRatingEnginesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.LicenseTypeResponse +} + +func (o *PostRatingEnginesOK) Error() string { + return fmt.Sprintf("[POST /ratingengines][%d] postRatingEnginesOK %+v", 200, o.Payload) +} + +func (o *PostRatingEnginesOK) GetPayload() *regs_models.LicenseTypeResponse { + return o.Payload +} + +func (o *PostRatingEnginesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.LicenseTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRatingEnginesUnauthorized creates a PostRatingEnginesUnauthorized with default headers values +func NewPostRatingEnginesUnauthorized() *PostRatingEnginesUnauthorized { + return &PostRatingEnginesUnauthorized{} +} + +/*PostRatingEnginesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostRatingEnginesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostRatingEnginesUnauthorized) Error() string { + return fmt.Sprintf("[POST /ratingengines][%d] postRatingEnginesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostRatingEnginesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostRatingEnginesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRatingEnginesForbidden creates a PostRatingEnginesForbidden with default headers values +func NewPostRatingEnginesForbidden() *PostRatingEnginesForbidden { + return &PostRatingEnginesForbidden{} +} + +/*PostRatingEnginesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostRatingEnginesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostRatingEnginesForbidden) Error() string { + return fmt.Sprintf("[POST /ratingengines][%d] postRatingEnginesForbidden %+v", 403, o.Payload) +} + +func (o *PostRatingEnginesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostRatingEnginesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRatingEnginesNotFound creates a PostRatingEnginesNotFound with default headers values +func NewPostRatingEnginesNotFound() *PostRatingEnginesNotFound { + return &PostRatingEnginesNotFound{} +} + +/*PostRatingEnginesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostRatingEnginesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostRatingEnginesNotFound) Error() string { + return fmt.Sprintf("[POST /ratingengines][%d] postRatingEnginesNotFound %+v", 404, o.Payload) +} + +func (o *PostRatingEnginesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostRatingEnginesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRatingEnginesUnprocessableEntity creates a PostRatingEnginesUnprocessableEntity with default headers values +func NewPostRatingEnginesUnprocessableEntity() *PostRatingEnginesUnprocessableEntity { + return &PostRatingEnginesUnprocessableEntity{} +} + +/*PostRatingEnginesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostRatingEnginesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostRatingEnginesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /ratingengines][%d] postRatingEnginesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostRatingEnginesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostRatingEnginesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostRatingEnginesInternalServerError creates a PostRatingEnginesInternalServerError with default headers values +func NewPostRatingEnginesInternalServerError() *PostRatingEnginesInternalServerError { + return &PostRatingEnginesInternalServerError{} +} + +/*PostRatingEnginesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostRatingEnginesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostRatingEnginesInternalServerError) Error() string { + return fmt.Sprintf("[POST /ratingengines][%d] postRatingEnginesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostRatingEnginesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostRatingEnginesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/rating_engine/put_rating_engines_parameters.go b/api/regs/regs_client/rating_engine/put_rating_engines_parameters.go new file mode 100644 index 0000000..7789000 --- /dev/null +++ b/api/regs/regs_client/rating_engine/put_rating_engines_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutRatingEnginesParams creates a new PutRatingEnginesParams object +// with the default values initialized. +func NewPutRatingEnginesParams() *PutRatingEnginesParams { + var () + return &PutRatingEnginesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutRatingEnginesParamsWithTimeout creates a new PutRatingEnginesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutRatingEnginesParamsWithTimeout(timeout time.Duration) *PutRatingEnginesParams { + var () + return &PutRatingEnginesParams{ + + timeout: timeout, + } +} + +// NewPutRatingEnginesParamsWithContext creates a new PutRatingEnginesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutRatingEnginesParamsWithContext(ctx context.Context) *PutRatingEnginesParams { + var () + return &PutRatingEnginesParams{ + + Context: ctx, + } +} + +// NewPutRatingEnginesParamsWithHTTPClient creates a new PutRatingEnginesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutRatingEnginesParamsWithHTTPClient(client *http.Client) *PutRatingEnginesParams { + var () + return &PutRatingEnginesParams{ + HTTPClient: client, + } +} + +/*PutRatingEnginesParams contains all the parameters to send to the API endpoint +for the put rating engines operation typically these are written to a http.Request +*/ +type PutRatingEnginesParams struct { + + /*RatingEngineRequest + An array of new Submission records + + */ + RatingEngineRequest *regs_models.RatingEngineRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put rating engines params +func (o *PutRatingEnginesParams) WithTimeout(timeout time.Duration) *PutRatingEnginesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put rating engines params +func (o *PutRatingEnginesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put rating engines params +func (o *PutRatingEnginesParams) WithContext(ctx context.Context) *PutRatingEnginesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put rating engines params +func (o *PutRatingEnginesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put rating engines params +func (o *PutRatingEnginesParams) WithHTTPClient(client *http.Client) *PutRatingEnginesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put rating engines params +func (o *PutRatingEnginesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRatingEngineRequest adds the ratingEngineRequest to the put rating engines params +func (o *PutRatingEnginesParams) WithRatingEngineRequest(ratingEngineRequest *regs_models.RatingEngineRequest) *PutRatingEnginesParams { + o.SetRatingEngineRequest(ratingEngineRequest) + return o +} + +// SetRatingEngineRequest adds the ratingEngineRequest to the put rating engines params +func (o *PutRatingEnginesParams) SetRatingEngineRequest(ratingEngineRequest *regs_models.RatingEngineRequest) { + o.RatingEngineRequest = ratingEngineRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutRatingEnginesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RatingEngineRequest != nil { + if err := r.SetBodyParam(o.RatingEngineRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/rating_engine/put_rating_engines_responses.go b/api/regs/regs_client/rating_engine/put_rating_engines_responses.go new file mode 100644 index 0000000..2d64bdf --- /dev/null +++ b/api/regs/regs_client/rating_engine/put_rating_engines_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutRatingEnginesReader is a Reader for the PutRatingEngines structure. +type PutRatingEnginesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutRatingEnginesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutRatingEnginesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutRatingEnginesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutRatingEnginesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutRatingEnginesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutRatingEnginesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutRatingEnginesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutRatingEnginesOK creates a PutRatingEnginesOK with default headers values +func NewPutRatingEnginesOK() *PutRatingEnginesOK { + return &PutRatingEnginesOK{} +} + +/*PutRatingEnginesOK handles this case with default header values. + +Taxnexus Response with License objects +*/ +type PutRatingEnginesOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.LicenseTypeResponse +} + +func (o *PutRatingEnginesOK) Error() string { + return fmt.Sprintf("[PUT /ratingengines][%d] putRatingEnginesOK %+v", 200, o.Payload) +} + +func (o *PutRatingEnginesOK) GetPayload() *regs_models.LicenseTypeResponse { + return o.Payload +} + +func (o *PutRatingEnginesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.LicenseTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRatingEnginesUnauthorized creates a PutRatingEnginesUnauthorized with default headers values +func NewPutRatingEnginesUnauthorized() *PutRatingEnginesUnauthorized { + return &PutRatingEnginesUnauthorized{} +} + +/*PutRatingEnginesUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutRatingEnginesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutRatingEnginesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /ratingengines][%d] putRatingEnginesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutRatingEnginesUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutRatingEnginesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRatingEnginesForbidden creates a PutRatingEnginesForbidden with default headers values +func NewPutRatingEnginesForbidden() *PutRatingEnginesForbidden { + return &PutRatingEnginesForbidden{} +} + +/*PutRatingEnginesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutRatingEnginesForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutRatingEnginesForbidden) Error() string { + return fmt.Sprintf("[PUT /ratingengines][%d] putRatingEnginesForbidden %+v", 403, o.Payload) +} + +func (o *PutRatingEnginesForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutRatingEnginesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRatingEnginesNotFound creates a PutRatingEnginesNotFound with default headers values +func NewPutRatingEnginesNotFound() *PutRatingEnginesNotFound { + return &PutRatingEnginesNotFound{} +} + +/*PutRatingEnginesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutRatingEnginesNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutRatingEnginesNotFound) Error() string { + return fmt.Sprintf("[PUT /ratingengines][%d] putRatingEnginesNotFound %+v", 404, o.Payload) +} + +func (o *PutRatingEnginesNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutRatingEnginesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRatingEnginesUnprocessableEntity creates a PutRatingEnginesUnprocessableEntity with default headers values +func NewPutRatingEnginesUnprocessableEntity() *PutRatingEnginesUnprocessableEntity { + return &PutRatingEnginesUnprocessableEntity{} +} + +/*PutRatingEnginesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutRatingEnginesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutRatingEnginesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /ratingengines][%d] putRatingEnginesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutRatingEnginesUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutRatingEnginesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutRatingEnginesInternalServerError creates a PutRatingEnginesInternalServerError with default headers values +func NewPutRatingEnginesInternalServerError() *PutRatingEnginesInternalServerError { + return &PutRatingEnginesInternalServerError{} +} + +/*PutRatingEnginesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutRatingEnginesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutRatingEnginesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /ratingengines][%d] putRatingEnginesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutRatingEnginesInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutRatingEnginesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/rating_engine/rating_engine_client.go b/api/regs/regs_client/rating_engine/rating_engine_client.go new file mode 100644 index 0000000..df9974f --- /dev/null +++ b/api/regs/regs_client/rating_engine/rating_engine_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package rating_engine + +// 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 rating engine API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for rating engine API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteRatingEngine(params *DeleteRatingEngineParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRatingEngineOK, error) + + GetRatingEngines(params *GetRatingEnginesParams, authInfo runtime.ClientAuthInfoWriter) (*GetRatingEnginesOK, error) + + PostRatingEngines(params *PostRatingEnginesParams, authInfo runtime.ClientAuthInfoWriter) (*PostRatingEnginesOK, error) + + PutRatingEngines(params *PutRatingEnginesParams, authInfo runtime.ClientAuthInfoWriter) (*PutRatingEnginesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteRatingEngine deletes a rating engine + + Delete Taxnexus Backend record +*/ +func (a *Client) DeleteRatingEngine(params *DeleteRatingEngineParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRatingEngineOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteRatingEngineParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteRatingEngine", + Method: "DELETE", + PathPattern: "/ratingengines", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteRatingEngineReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteRatingEngineOK) + 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 deleteRatingEngine: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetRatingEngines gets a list of rating engines + + Return a list of Rating Engines +*/ +func (a *Client) GetRatingEngines(params *GetRatingEnginesParams, authInfo runtime.ClientAuthInfoWriter) (*GetRatingEnginesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRatingEnginesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRatingEngines", + Method: "GET", + PathPattern: "/ratingengines", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRatingEnginesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRatingEnginesOK) + 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 getRatingEngines: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostRatingEngines adds rating engine + + Rating Engine records to be added +*/ +func (a *Client) PostRatingEngines(params *PostRatingEnginesParams, authInfo runtime.ClientAuthInfoWriter) (*PostRatingEnginesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostRatingEnginesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postRatingEngines", + Method: "POST", + PathPattern: "/ratingengines", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostRatingEnginesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostRatingEnginesOK) + 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 postRatingEngines: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutRatingEngines updates rating engine + + Update Rating Engine records +*/ +func (a *Client) PutRatingEngines(params *PutRatingEnginesParams, authInfo runtime.ClientAuthInfoWriter) (*PutRatingEnginesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutRatingEnginesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putRatingEngines", + Method: "PUT", + PathPattern: "/ratingengines", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutRatingEnginesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutRatingEnginesOK) + 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 putRatingEngines: 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/regs/regs_client/regs_client.go b/api/regs/regs_client/regs_client.go new file mode 100644 index 0000000..4e59f4e --- /dev/null +++ b/api/regs/regs_client/regs_client.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_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" + + "github.com/taxnexus/go/lib/api/regs/regs_client/authority" + "github.com/taxnexus/go/lib/api/regs/regs_client/backend" + "github.com/taxnexus/go/lib/api/regs/regs_client/cors" + "github.com/taxnexus/go/lib/api/regs/regs_client/filing" + "github.com/taxnexus/go/lib/api/regs/regs_client/filing_type" + "github.com/taxnexus/go/lib/api/regs/regs_client/license" + "github.com/taxnexus/go/lib/api/regs/regs_client/license_type" + "github.com/taxnexus/go/lib/api/regs/regs_client/notebook" + "github.com/taxnexus/go/lib/api/regs/regs_client/rating_engine" + "github.com/taxnexus/go/lib/api/regs/regs_client/submission" + "github.com/taxnexus/go/lib/api/regs/regs_client/tax_type_account" + "github.com/taxnexus/go/lib/api/regs/regs_client/transaction" +) + +// Default regs HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "regs.fabric.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 regs HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Regs { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new regs HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Regs { + // 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 regs client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Regs { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Regs) + cli.Transport = transport + cli.Authority = authority.New(transport, formats) + cli.Backend = backend.New(transport, formats) + cli.Cors = cors.New(transport, formats) + cli.Filing = filing.New(transport, formats) + cli.FilingType = filing_type.New(transport, formats) + cli.License = license.New(transport, formats) + cli.LicenseType = license_type.New(transport, formats) + cli.Notebook = notebook.New(transport, formats) + cli.RatingEngine = rating_engine.New(transport, formats) + cli.Submission = submission.New(transport, formats) + cli.TaxTypeAccount = tax_type_account.New(transport, formats) + cli.Transaction = transaction.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 +} + +// Regs is a client for regs +type Regs struct { + Authority authority.ClientService + + Backend backend.ClientService + + Cors cors.ClientService + + Filing filing.ClientService + + FilingType filing_type.ClientService + + License license.ClientService + + LicenseType license_type.ClientService + + Notebook notebook.ClientService + + RatingEngine rating_engine.ClientService + + Submission submission.ClientService + + TaxTypeAccount tax_type_account.ClientService + + Transaction transaction.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Regs) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Authority.SetTransport(transport) + c.Backend.SetTransport(transport) + c.Cors.SetTransport(transport) + c.Filing.SetTransport(transport) + c.FilingType.SetTransport(transport) + c.License.SetTransport(transport) + c.LicenseType.SetTransport(transport) + c.Notebook.SetTransport(transport) + c.RatingEngine.SetTransport(transport) + c.Submission.SetTransport(transport) + c.TaxTypeAccount.SetTransport(transport) + c.Transaction.SetTransport(transport) +} diff --git a/api/regs/regs_client/submission/get_submissions_parameters.go b/api/regs/regs_client/submission/get_submissions_parameters.go new file mode 100644 index 0000000..15c530d --- /dev/null +++ b/api/regs/regs_client/submission/get_submissions_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submission + +// 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" +) + +// NewGetSubmissionsParams creates a new GetSubmissionsParams object +// with the default values initialized. +func NewGetSubmissionsParams() *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubmissionsParamsWithTimeout creates a new GetSubmissionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSubmissionsParamsWithTimeout(timeout time.Duration) *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + + timeout: timeout, + } +} + +// NewGetSubmissionsParamsWithContext creates a new GetSubmissionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSubmissionsParamsWithContext(ctx context.Context) *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + + Context: ctx, + } +} + +// NewGetSubmissionsParamsWithHTTPClient creates a new GetSubmissionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSubmissionsParamsWithHTTPClient(client *http.Client) *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + HTTPClient: client, + } +} + +/*GetSubmissionsParams contains all the parameters to send to the API endpoint +for the get submissions operation typically these are written to a http.Request +*/ +type GetSubmissionsParams struct { + + /*CompanyID + Taxnexus Record Id of a Company + + */ + CompanyID *string + /*ID + Taxnexus Id of the record to be retrieved + + */ + ID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*SubmissionID + Taxnexus Record Id of a Submisssion + + */ + SubmissionID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get submissions params +func (o *GetSubmissionsParams) WithTimeout(timeout time.Duration) *GetSubmissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get submissions params +func (o *GetSubmissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get submissions params +func (o *GetSubmissionsParams) WithContext(ctx context.Context) *GetSubmissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get submissions params +func (o *GetSubmissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get submissions params +func (o *GetSubmissionsParams) WithHTTPClient(client *http.Client) *GetSubmissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get submissions params +func (o *GetSubmissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyID adds the companyID to the get submissions params +func (o *GetSubmissionsParams) WithCompanyID(companyID *string) *GetSubmissionsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get submissions params +func (o *GetSubmissionsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithID adds the id to the get submissions params +func (o *GetSubmissionsParams) WithID(id *string) *GetSubmissionsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get submissions params +func (o *GetSubmissionsParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the get submissions params +func (o *GetSubmissionsParams) WithLimit(limit *int64) *GetSubmissionsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get submissions params +func (o *GetSubmissionsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get submissions params +func (o *GetSubmissionsParams) WithOffset(offset *int64) *GetSubmissionsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get submissions params +func (o *GetSubmissionsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSubmissionID adds the submissionID to the get submissions params +func (o *GetSubmissionsParams) WithSubmissionID(submissionID *string) *GetSubmissionsParams { + o.SetSubmissionID(submissionID) + return o +} + +// SetSubmissionID adds the submissionId to the get submissions params +func (o *GetSubmissionsParams) SetSubmissionID(submissionID *string) { + o.SubmissionID = submissionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubmissionsParams) 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.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.SubmissionID != nil { + + // query param submissionId + var qrSubmissionID string + if o.SubmissionID != nil { + qrSubmissionID = *o.SubmissionID + } + qSubmissionID := qrSubmissionID + if qSubmissionID != "" { + if err := r.SetQueryParam("submissionId", qSubmissionID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/submission/get_submissions_responses.go b/api/regs/regs_client/submission/get_submissions_responses.go new file mode 100644 index 0000000..deadb1b --- /dev/null +++ b/api/regs/regs_client/submission/get_submissions_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submission + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetSubmissionsReader is a Reader for the GetSubmissions structure. +type GetSubmissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubmissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubmissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSubmissionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSubmissionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSubmissionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetSubmissionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSubmissionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSubmissionsOK creates a GetSubmissionsOK with default headers values +func NewGetSubmissionsOK() *GetSubmissionsOK { + return &GetSubmissionsOK{} +} + +/*GetSubmissionsOK handles this case with default header values. + +Taxnexus Response with Submission objects +*/ +type GetSubmissionsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.SubmissionResponse +} + +func (o *GetSubmissionsOK) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsOK %+v", 200, o.Payload) +} + +func (o *GetSubmissionsOK) GetPayload() *regs_models.SubmissionResponse { + return o.Payload +} + +func (o *GetSubmissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.SubmissionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsUnauthorized creates a GetSubmissionsUnauthorized with default headers values +func NewGetSubmissionsUnauthorized() *GetSubmissionsUnauthorized { + return &GetSubmissionsUnauthorized{} +} + +/*GetSubmissionsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetSubmissionsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetSubmissionsUnauthorized) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSubmissionsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetSubmissionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsForbidden creates a GetSubmissionsForbidden with default headers values +func NewGetSubmissionsForbidden() *GetSubmissionsForbidden { + return &GetSubmissionsForbidden{} +} + +/*GetSubmissionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSubmissionsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetSubmissionsForbidden) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsForbidden %+v", 403, o.Payload) +} + +func (o *GetSubmissionsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetSubmissionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsNotFound creates a GetSubmissionsNotFound with default headers values +func NewGetSubmissionsNotFound() *GetSubmissionsNotFound { + return &GetSubmissionsNotFound{} +} + +/*GetSubmissionsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSubmissionsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetSubmissionsNotFound) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsNotFound %+v", 404, o.Payload) +} + +func (o *GetSubmissionsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetSubmissionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsUnprocessableEntity creates a GetSubmissionsUnprocessableEntity with default headers values +func NewGetSubmissionsUnprocessableEntity() *GetSubmissionsUnprocessableEntity { + return &GetSubmissionsUnprocessableEntity{} +} + +/*GetSubmissionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetSubmissionsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetSubmissionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetSubmissionsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetSubmissionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsInternalServerError creates a GetSubmissionsInternalServerError with default headers values +func NewGetSubmissionsInternalServerError() *GetSubmissionsInternalServerError { + return &GetSubmissionsInternalServerError{} +} + +/*GetSubmissionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSubmissionsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetSubmissionsInternalServerError) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSubmissionsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetSubmissionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/submission/post_submissions_parameters.go b/api/regs/regs_client/submission/post_submissions_parameters.go new file mode 100644 index 0000000..e7bd519 --- /dev/null +++ b/api/regs/regs_client/submission/post_submissions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submission + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostSubmissionsParams creates a new PostSubmissionsParams object +// with the default values initialized. +func NewPostSubmissionsParams() *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSubmissionsParamsWithTimeout creates a new PostSubmissionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSubmissionsParamsWithTimeout(timeout time.Duration) *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + + timeout: timeout, + } +} + +// NewPostSubmissionsParamsWithContext creates a new PostSubmissionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSubmissionsParamsWithContext(ctx context.Context) *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + + Context: ctx, + } +} + +// NewPostSubmissionsParamsWithHTTPClient creates a new PostSubmissionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSubmissionsParamsWithHTTPClient(client *http.Client) *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + HTTPClient: client, + } +} + +/*PostSubmissionsParams contains all the parameters to send to the API endpoint +for the post submissions operation typically these are written to a http.Request +*/ +type PostSubmissionsParams struct { + + /*SubmissionRequest + An array of new Submission records + + */ + SubmissionRequest *regs_models.SubmissionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post submissions params +func (o *PostSubmissionsParams) WithTimeout(timeout time.Duration) *PostSubmissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post submissions params +func (o *PostSubmissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post submissions params +func (o *PostSubmissionsParams) WithContext(ctx context.Context) *PostSubmissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post submissions params +func (o *PostSubmissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post submissions params +func (o *PostSubmissionsParams) WithHTTPClient(client *http.Client) *PostSubmissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post submissions params +func (o *PostSubmissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubmissionRequest adds the submissionRequest to the post submissions params +func (o *PostSubmissionsParams) WithSubmissionRequest(submissionRequest *regs_models.SubmissionRequest) *PostSubmissionsParams { + o.SetSubmissionRequest(submissionRequest) + return o +} + +// SetSubmissionRequest adds the submissionRequest to the post submissions params +func (o *PostSubmissionsParams) SetSubmissionRequest(submissionRequest *regs_models.SubmissionRequest) { + o.SubmissionRequest = submissionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSubmissionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubmissionRequest != nil { + if err := r.SetBodyParam(o.SubmissionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/submission/post_submissions_responses.go b/api/regs/regs_client/submission/post_submissions_responses.go new file mode 100644 index 0000000..0cb1dc4 --- /dev/null +++ b/api/regs/regs_client/submission/post_submissions_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submission + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostSubmissionsReader is a Reader for the PostSubmissions structure. +type PostSubmissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSubmissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSubmissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostSubmissionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostSubmissionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostSubmissionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostSubmissionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostSubmissionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostSubmissionsOK creates a PostSubmissionsOK with default headers values +func NewPostSubmissionsOK() *PostSubmissionsOK { + return &PostSubmissionsOK{} +} + +/*PostSubmissionsOK handles this case with default header values. + +Taxnexus Response with Submission objects +*/ +type PostSubmissionsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.SubmissionResponse +} + +func (o *PostSubmissionsOK) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsOK %+v", 200, o.Payload) +} + +func (o *PostSubmissionsOK) GetPayload() *regs_models.SubmissionResponse { + return o.Payload +} + +func (o *PostSubmissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.SubmissionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsUnauthorized creates a PostSubmissionsUnauthorized with default headers values +func NewPostSubmissionsUnauthorized() *PostSubmissionsUnauthorized { + return &PostSubmissionsUnauthorized{} +} + +/*PostSubmissionsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostSubmissionsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostSubmissionsUnauthorized) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostSubmissionsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostSubmissionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsForbidden creates a PostSubmissionsForbidden with default headers values +func NewPostSubmissionsForbidden() *PostSubmissionsForbidden { + return &PostSubmissionsForbidden{} +} + +/*PostSubmissionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostSubmissionsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostSubmissionsForbidden) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsForbidden %+v", 403, o.Payload) +} + +func (o *PostSubmissionsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostSubmissionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsNotFound creates a PostSubmissionsNotFound with default headers values +func NewPostSubmissionsNotFound() *PostSubmissionsNotFound { + return &PostSubmissionsNotFound{} +} + +/*PostSubmissionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostSubmissionsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostSubmissionsNotFound) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsNotFound %+v", 404, o.Payload) +} + +func (o *PostSubmissionsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostSubmissionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsUnprocessableEntity creates a PostSubmissionsUnprocessableEntity with default headers values +func NewPostSubmissionsUnprocessableEntity() *PostSubmissionsUnprocessableEntity { + return &PostSubmissionsUnprocessableEntity{} +} + +/*PostSubmissionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostSubmissionsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostSubmissionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostSubmissionsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostSubmissionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsInternalServerError creates a PostSubmissionsInternalServerError with default headers values +func NewPostSubmissionsInternalServerError() *PostSubmissionsInternalServerError { + return &PostSubmissionsInternalServerError{} +} + +/*PostSubmissionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostSubmissionsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostSubmissionsInternalServerError) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostSubmissionsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostSubmissionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/submission/put_submissions_parameters.go b/api/regs/regs_client/submission/put_submissions_parameters.go new file mode 100644 index 0000000..c019012 --- /dev/null +++ b/api/regs/regs_client/submission/put_submissions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submission + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutSubmissionsParams creates a new PutSubmissionsParams object +// with the default values initialized. +func NewPutSubmissionsParams() *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutSubmissionsParamsWithTimeout creates a new PutSubmissionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutSubmissionsParamsWithTimeout(timeout time.Duration) *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + + timeout: timeout, + } +} + +// NewPutSubmissionsParamsWithContext creates a new PutSubmissionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutSubmissionsParamsWithContext(ctx context.Context) *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + + Context: ctx, + } +} + +// NewPutSubmissionsParamsWithHTTPClient creates a new PutSubmissionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutSubmissionsParamsWithHTTPClient(client *http.Client) *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + HTTPClient: client, + } +} + +/*PutSubmissionsParams contains all the parameters to send to the API endpoint +for the put submissions operation typically these are written to a http.Request +*/ +type PutSubmissionsParams struct { + + /*SubmissionRequest + An array of new Submission records + + */ + SubmissionRequest *regs_models.SubmissionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put submissions params +func (o *PutSubmissionsParams) WithTimeout(timeout time.Duration) *PutSubmissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put submissions params +func (o *PutSubmissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put submissions params +func (o *PutSubmissionsParams) WithContext(ctx context.Context) *PutSubmissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put submissions params +func (o *PutSubmissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put submissions params +func (o *PutSubmissionsParams) WithHTTPClient(client *http.Client) *PutSubmissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put submissions params +func (o *PutSubmissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubmissionRequest adds the submissionRequest to the put submissions params +func (o *PutSubmissionsParams) WithSubmissionRequest(submissionRequest *regs_models.SubmissionRequest) *PutSubmissionsParams { + o.SetSubmissionRequest(submissionRequest) + return o +} + +// SetSubmissionRequest adds the submissionRequest to the put submissions params +func (o *PutSubmissionsParams) SetSubmissionRequest(submissionRequest *regs_models.SubmissionRequest) { + o.SubmissionRequest = submissionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutSubmissionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubmissionRequest != nil { + if err := r.SetBodyParam(o.SubmissionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/submission/put_submissions_responses.go b/api/regs/regs_client/submission/put_submissions_responses.go new file mode 100644 index 0000000..c6fd563 --- /dev/null +++ b/api/regs/regs_client/submission/put_submissions_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submission + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutSubmissionsReader is a Reader for the PutSubmissions structure. +type PutSubmissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutSubmissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutSubmissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutSubmissionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutSubmissionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutSubmissionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutSubmissionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutSubmissionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutSubmissionsOK creates a PutSubmissionsOK with default headers values +func NewPutSubmissionsOK() *PutSubmissionsOK { + return &PutSubmissionsOK{} +} + +/*PutSubmissionsOK handles this case with default header values. + +Taxnexus Response with Submission objects +*/ +type PutSubmissionsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.SubmissionResponse +} + +func (o *PutSubmissionsOK) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsOK %+v", 200, o.Payload) +} + +func (o *PutSubmissionsOK) GetPayload() *regs_models.SubmissionResponse { + return o.Payload +} + +func (o *PutSubmissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.SubmissionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsUnauthorized creates a PutSubmissionsUnauthorized with default headers values +func NewPutSubmissionsUnauthorized() *PutSubmissionsUnauthorized { + return &PutSubmissionsUnauthorized{} +} + +/*PutSubmissionsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutSubmissionsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutSubmissionsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutSubmissionsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutSubmissionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsForbidden creates a PutSubmissionsForbidden with default headers values +func NewPutSubmissionsForbidden() *PutSubmissionsForbidden { + return &PutSubmissionsForbidden{} +} + +/*PutSubmissionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutSubmissionsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutSubmissionsForbidden) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsForbidden %+v", 403, o.Payload) +} + +func (o *PutSubmissionsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutSubmissionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsNotFound creates a PutSubmissionsNotFound with default headers values +func NewPutSubmissionsNotFound() *PutSubmissionsNotFound { + return &PutSubmissionsNotFound{} +} + +/*PutSubmissionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutSubmissionsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutSubmissionsNotFound) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsNotFound %+v", 404, o.Payload) +} + +func (o *PutSubmissionsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutSubmissionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsUnprocessableEntity creates a PutSubmissionsUnprocessableEntity with default headers values +func NewPutSubmissionsUnprocessableEntity() *PutSubmissionsUnprocessableEntity { + return &PutSubmissionsUnprocessableEntity{} +} + +/*PutSubmissionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutSubmissionsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutSubmissionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutSubmissionsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutSubmissionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsInternalServerError creates a PutSubmissionsInternalServerError with default headers values +func NewPutSubmissionsInternalServerError() *PutSubmissionsInternalServerError { + return &PutSubmissionsInternalServerError{} +} + +/*PutSubmissionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutSubmissionsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutSubmissionsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutSubmissionsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutSubmissionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/submission/submission_client.go b/api/regs/regs_client/submission/submission_client.go new file mode 100644 index 0000000..b5c9a26 --- /dev/null +++ b/api/regs/regs_client/submission/submission_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submission + +// 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 submission API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for submission API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetSubmissions(params *GetSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubmissionsOK, error) + + PostSubmissions(params *PostSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubmissionsOK, error) + + PutSubmissions(params *PutSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubmissionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetSubmissions gets a list of submissions + + Return a list of available Submissions +*/ +func (a *Client) GetSubmissions(params *GetSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubmissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubmissionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSubmissions", + Method: "GET", + PathPattern: "/submissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSubmissionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSubmissionsOK) + 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 getSubmissions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostSubmissions adds new submissions + + Create new Sumissions +*/ +func (a *Client) PostSubmissions(params *PostSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubmissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSubmissionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postSubmissions", + Method: "POST", + PathPattern: "/submissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSubmissionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostSubmissionsOK) + 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 postSubmissions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutSubmissions updates a submission + + Update all the fields in a Submission record identified by Taxnexus Id +*/ +func (a *Client) PutSubmissions(params *PutSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubmissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutSubmissionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putSubmissions", + Method: "PUT", + PathPattern: "/submissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutSubmissionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutSubmissionsOK) + 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 putSubmissions: 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/regs/regs_client/tax_type_account/delete_type_accounts_parameters.go b/api/regs/regs_client/tax_type_account/delete_type_accounts_parameters.go new file mode 100644 index 0000000..2fdbf91 --- /dev/null +++ b/api/regs/regs_client/tax_type_account/delete_type_accounts_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" +) + +// NewDeleteTypeAccountsParams creates a new DeleteTypeAccountsParams object +// with the default values initialized. +func NewDeleteTypeAccountsParams() *DeleteTypeAccountsParams { + var () + return &DeleteTypeAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTypeAccountsParamsWithTimeout creates a new DeleteTypeAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteTypeAccountsParamsWithTimeout(timeout time.Duration) *DeleteTypeAccountsParams { + var () + return &DeleteTypeAccountsParams{ + + timeout: timeout, + } +} + +// NewDeleteTypeAccountsParamsWithContext creates a new DeleteTypeAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteTypeAccountsParamsWithContext(ctx context.Context) *DeleteTypeAccountsParams { + var () + return &DeleteTypeAccountsParams{ + + Context: ctx, + } +} + +// NewDeleteTypeAccountsParamsWithHTTPClient creates a new DeleteTypeAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteTypeAccountsParamsWithHTTPClient(client *http.Client) *DeleteTypeAccountsParams { + var () + return &DeleteTypeAccountsParams{ + HTTPClient: client, + } +} + +/*DeleteTypeAccountsParams contains all the parameters to send to the API endpoint +for the delete type accounts operation typically these are written to a http.Request +*/ +type DeleteTypeAccountsParams struct { + + /*ID + Taxnexus Id of the Record to be retrieved + + */ + ID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete type accounts params +func (o *DeleteTypeAccountsParams) WithTimeout(timeout time.Duration) *DeleteTypeAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete type accounts params +func (o *DeleteTypeAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete type accounts params +func (o *DeleteTypeAccountsParams) WithContext(ctx context.Context) *DeleteTypeAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete type accounts params +func (o *DeleteTypeAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete type accounts params +func (o *DeleteTypeAccountsParams) WithHTTPClient(client *http.Client) *DeleteTypeAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete type accounts params +func (o *DeleteTypeAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete type accounts params +func (o *DeleteTypeAccountsParams) WithID(id *string) *DeleteTypeAccountsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete type accounts params +func (o *DeleteTypeAccountsParams) SetID(id *string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTypeAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/tax_type_account/delete_type_accounts_responses.go b/api/regs/regs_client/tax_type_account/delete_type_accounts_responses.go new file mode 100644 index 0000000..f30fc7d --- /dev/null +++ b/api/regs/regs_client/tax_type_account/delete_type_accounts_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// DeleteTypeAccountsReader is a Reader for the DeleteTypeAccounts structure. +type DeleteTypeAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTypeAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewDeleteTypeAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteTypeAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteTypeAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteTypeAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteTypeAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteTypeAccountsOK creates a DeleteTypeAccountsOK with default headers values +func NewDeleteTypeAccountsOK() *DeleteTypeAccountsOK { + return &DeleteTypeAccountsOK{} +} + +/*DeleteTypeAccountsOK handles this case with default header values. + +Taxnexus Response with Message Objects with Delete Status +*/ +type DeleteTypeAccountsOK struct { + AccessControlAllowOrigin string + + Payload *regs_models.DeleteResponse +} + +func (o *DeleteTypeAccountsOK) Error() string { + return fmt.Sprintf("[DELETE /taxtypeaccounts][%d] deleteTypeAccountsOK %+v", 200, o.Payload) +} + +func (o *DeleteTypeAccountsOK) GetPayload() *regs_models.DeleteResponse { + return o.Payload +} + +func (o *DeleteTypeAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.DeleteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteTypeAccountsUnauthorized creates a DeleteTypeAccountsUnauthorized with default headers values +func NewDeleteTypeAccountsUnauthorized() *DeleteTypeAccountsUnauthorized { + return &DeleteTypeAccountsUnauthorized{} +} + +/*DeleteTypeAccountsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type DeleteTypeAccountsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteTypeAccountsUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /taxtypeaccounts][%d] deleteTypeAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteTypeAccountsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteTypeAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteTypeAccountsForbidden creates a DeleteTypeAccountsForbidden with default headers values +func NewDeleteTypeAccountsForbidden() *DeleteTypeAccountsForbidden { + return &DeleteTypeAccountsForbidden{} +} + +/*DeleteTypeAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteTypeAccountsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteTypeAccountsForbidden) Error() string { + return fmt.Sprintf("[DELETE /taxtypeaccounts][%d] deleteTypeAccountsForbidden %+v", 403, o.Payload) +} + +func (o *DeleteTypeAccountsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteTypeAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteTypeAccountsNotFound creates a DeleteTypeAccountsNotFound with default headers values +func NewDeleteTypeAccountsNotFound() *DeleteTypeAccountsNotFound { + return &DeleteTypeAccountsNotFound{} +} + +/*DeleteTypeAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type DeleteTypeAccountsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteTypeAccountsNotFound) Error() string { + return fmt.Sprintf("[DELETE /taxtypeaccounts][%d] deleteTypeAccountsNotFound %+v", 404, o.Payload) +} + +func (o *DeleteTypeAccountsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteTypeAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteTypeAccountsUnprocessableEntity creates a DeleteTypeAccountsUnprocessableEntity with default headers values +func NewDeleteTypeAccountsUnprocessableEntity() *DeleteTypeAccountsUnprocessableEntity { + return &DeleteTypeAccountsUnprocessableEntity{} +} + +/*DeleteTypeAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type DeleteTypeAccountsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteTypeAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /taxtypeaccounts][%d] deleteTypeAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteTypeAccountsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteTypeAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteTypeAccountsInternalServerError creates a DeleteTypeAccountsInternalServerError with default headers values +func NewDeleteTypeAccountsInternalServerError() *DeleteTypeAccountsInternalServerError { + return &DeleteTypeAccountsInternalServerError{} +} + +/*DeleteTypeAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type DeleteTypeAccountsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *DeleteTypeAccountsInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /taxtypeaccounts][%d] deleteTypeAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteTypeAccountsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *DeleteTypeAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/tax_type_account/get_tax_type_accounts_parameters.go b/api/regs/regs_client/tax_type_account/get_tax_type_accounts_parameters.go new file mode 100644 index 0000000..452358d --- /dev/null +++ b/api/regs/regs_client/tax_type_account/get_tax_type_accounts_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + "github.com/go-openapi/swag" +) + +// NewGetTaxTypeAccountsParams creates a new GetTaxTypeAccountsParams object +// with the default values initialized. +func NewGetTaxTypeAccountsParams() *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxTypeAccountsParamsWithTimeout creates a new GetTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxTypeAccountsParamsWithTimeout(timeout time.Duration) *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + + timeout: timeout, + } +} + +// NewGetTaxTypeAccountsParamsWithContext creates a new GetTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxTypeAccountsParamsWithContext(ctx context.Context) *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + + Context: ctx, + } +} + +// NewGetTaxTypeAccountsParamsWithHTTPClient creates a new GetTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxTypeAccountsParamsWithHTTPClient(client *http.Client) *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + HTTPClient: client, + } +} + +/*GetTaxTypeAccountsParams contains all the parameters to send to the API endpoint +for the get tax type accounts operation typically these are written to a http.Request +*/ +type GetTaxTypeAccountsParams struct { + + /*AccountID + Taxnexus Record Id of an Account + + */ + AccountID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TaxTypeAccountID + Taxnexus Record Id of the Tax Type Account + + */ + TaxTypeAccountID *string + /*TaxTypeID + Taxnexus Record Id of the Tax Type + + */ + TaxTypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithTimeout(timeout time.Duration) *GetTaxTypeAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithContext(ctx context.Context) *GetTaxTypeAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithHTTPClient(client *http.Client) *GetTaxTypeAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithAccountID(accountID *string) *GetTaxTypeAccountsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithLimit adds the limit to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithLimit(limit *int64) *GetTaxTypeAccountsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithOffset(offset *int64) *GetTaxTypeAccountsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithTaxTypeAccountID adds the taxTypeAccountID to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithTaxTypeAccountID(taxTypeAccountID *string) *GetTaxTypeAccountsParams { + o.SetTaxTypeAccountID(taxTypeAccountID) + return o +} + +// SetTaxTypeAccountID adds the taxTypeAccountId to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetTaxTypeAccountID(taxTypeAccountID *string) { + o.TaxTypeAccountID = taxTypeAccountID +} + +// WithTaxTypeID adds the taxTypeID to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithTaxTypeID(taxTypeID *string) *GetTaxTypeAccountsParams { + o.SetTaxTypeID(taxTypeID) + return o +} + +// SetTaxTypeID adds the taxTypeId to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetTaxTypeID(taxTypeID *string) { + o.TaxTypeID = taxTypeID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxTypeAccountsParams) 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.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.TaxTypeAccountID != nil { + + // query param taxTypeAccountId + var qrTaxTypeAccountID string + if o.TaxTypeAccountID != nil { + qrTaxTypeAccountID = *o.TaxTypeAccountID + } + qTaxTypeAccountID := qrTaxTypeAccountID + if qTaxTypeAccountID != "" { + if err := r.SetQueryParam("taxTypeAccountId", qTaxTypeAccountID); err != nil { + return err + } + } + + } + + if o.TaxTypeID != nil { + + // query param taxTypeId + var qrTaxTypeID string + if o.TaxTypeID != nil { + qrTaxTypeID = *o.TaxTypeID + } + qTaxTypeID := qrTaxTypeID + if qTaxTypeID != "" { + if err := r.SetQueryParam("taxTypeId", qTaxTypeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/tax_type_account/get_tax_type_accounts_responses.go b/api/regs/regs_client/tax_type_account/get_tax_type_accounts_responses.go new file mode 100644 index 0000000..9568c59 --- /dev/null +++ b/api/regs/regs_client/tax_type_account/get_tax_type_accounts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetTaxTypeAccountsReader is a Reader for the GetTaxTypeAccounts structure. +type GetTaxTypeAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxTypeAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxTypeAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxTypeAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxTypeAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxTypeAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxTypeAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxTypeAccountsOK creates a GetTaxTypeAccountsOK with default headers values +func NewGetTaxTypeAccountsOK() *GetTaxTypeAccountsOK { + return &GetTaxTypeAccountsOK{} +} + +/*GetTaxTypeAccountsOK handles this case with default header values. + +Taxnexus Response with Tax Type Account objects +*/ +type GetTaxTypeAccountsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.TaxTypeAccountResponse +} + +func (o *GetTaxTypeAccountsOK) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsOK %+v", 200, o.Payload) +} + +func (o *GetTaxTypeAccountsOK) GetPayload() *regs_models.TaxTypeAccountResponse { + return o.Payload +} + +func (o *GetTaxTypeAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.TaxTypeAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsUnauthorized creates a GetTaxTypeAccountsUnauthorized with default headers values +func NewGetTaxTypeAccountsUnauthorized() *GetTaxTypeAccountsUnauthorized { + return &GetTaxTypeAccountsUnauthorized{} +} + +/*GetTaxTypeAccountsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTaxTypeAccountsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTaxTypeAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxTypeAccountsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsForbidden creates a GetTaxTypeAccountsForbidden with default headers values +func NewGetTaxTypeAccountsForbidden() *GetTaxTypeAccountsForbidden { + return &GetTaxTypeAccountsForbidden{} +} + +/*GetTaxTypeAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxTypeAccountsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTaxTypeAccountsForbidden) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxTypeAccountsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsNotFound creates a GetTaxTypeAccountsNotFound with default headers values +func NewGetTaxTypeAccountsNotFound() *GetTaxTypeAccountsNotFound { + return &GetTaxTypeAccountsNotFound{} +} + +/*GetTaxTypeAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxTypeAccountsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTaxTypeAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxTypeAccountsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsUnprocessableEntity creates a GetTaxTypeAccountsUnprocessableEntity with default headers values +func NewGetTaxTypeAccountsUnprocessableEntity() *GetTaxTypeAccountsUnprocessableEntity { + return &GetTaxTypeAccountsUnprocessableEntity{} +} + +/*GetTaxTypeAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxTypeAccountsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTaxTypeAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxTypeAccountsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsInternalServerError creates a GetTaxTypeAccountsInternalServerError with default headers values +func NewGetTaxTypeAccountsInternalServerError() *GetTaxTypeAccountsInternalServerError { + return &GetTaxTypeAccountsInternalServerError{} +} + +/*GetTaxTypeAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxTypeAccountsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTaxTypeAccountsInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxTypeAccountsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/tax_type_account/post_tax_type_accounts_parameters.go b/api/regs/regs_client/tax_type_account/post_tax_type_accounts_parameters.go new file mode 100644 index 0000000..8305c61 --- /dev/null +++ b/api/regs/regs_client/tax_type_account/post_tax_type_accounts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostTaxTypeAccountsParams creates a new PostTaxTypeAccountsParams object +// with the default values initialized. +func NewPostTaxTypeAccountsParams() *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxTypeAccountsParamsWithTimeout creates a new PostTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxTypeAccountsParamsWithTimeout(timeout time.Duration) *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + + timeout: timeout, + } +} + +// NewPostTaxTypeAccountsParamsWithContext creates a new PostTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxTypeAccountsParamsWithContext(ctx context.Context) *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + + Context: ctx, + } +} + +// NewPostTaxTypeAccountsParamsWithHTTPClient creates a new PostTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxTypeAccountsParamsWithHTTPClient(client *http.Client) *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + HTTPClient: client, + } +} + +/*PostTaxTypeAccountsParams contains all the parameters to send to the API endpoint +for the post tax type accounts operation typically these are written to a http.Request +*/ +type PostTaxTypeAccountsParams struct { + + /*TaxTypeAccountRequest + A request with an array of Tax Type Account Objects + + */ + TaxTypeAccountRequest *regs_models.TaxTypeAccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithTimeout(timeout time.Duration) *PostTaxTypeAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithContext(ctx context.Context) *PostTaxTypeAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithHTTPClient(client *http.Client) *PostTaxTypeAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaxTypeAccountRequest adds the taxTypeAccountRequest to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithTaxTypeAccountRequest(taxTypeAccountRequest *regs_models.TaxTypeAccountRequest) *PostTaxTypeAccountsParams { + o.SetTaxTypeAccountRequest(taxTypeAccountRequest) + return o +} + +// SetTaxTypeAccountRequest adds the taxTypeAccountRequest to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetTaxTypeAccountRequest(taxTypeAccountRequest *regs_models.TaxTypeAccountRequest) { + o.TaxTypeAccountRequest = taxTypeAccountRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxTypeAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TaxTypeAccountRequest != nil { + if err := r.SetBodyParam(o.TaxTypeAccountRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/tax_type_account/post_tax_type_accounts_responses.go b/api/regs/regs_client/tax_type_account/post_tax_type_accounts_responses.go new file mode 100644 index 0000000..5b05dc1 --- /dev/null +++ b/api/regs/regs_client/tax_type_account/post_tax_type_accounts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostTaxTypeAccountsReader is a Reader for the PostTaxTypeAccounts structure. +type PostTaxTypeAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxTypeAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxTypeAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxTypeAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxTypeAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTaxTypeAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxTypeAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxTypeAccountsOK creates a PostTaxTypeAccountsOK with default headers values +func NewPostTaxTypeAccountsOK() *PostTaxTypeAccountsOK { + return &PostTaxTypeAccountsOK{} +} + +/*PostTaxTypeAccountsOK handles this case with default header values. + +Taxnexus Response with Tax Type Account objects +*/ +type PostTaxTypeAccountsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.TaxTypeAccountResponse +} + +func (o *PostTaxTypeAccountsOK) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsOK %+v", 200, o.Payload) +} + +func (o *PostTaxTypeAccountsOK) GetPayload() *regs_models.TaxTypeAccountResponse { + return o.Payload +} + +func (o *PostTaxTypeAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.TaxTypeAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsUnauthorized creates a PostTaxTypeAccountsUnauthorized with default headers values +func NewPostTaxTypeAccountsUnauthorized() *PostTaxTypeAccountsUnauthorized { + return &PostTaxTypeAccountsUnauthorized{} +} + +/*PostTaxTypeAccountsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostTaxTypeAccountsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTaxTypeAccountsUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxTypeAccountsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsForbidden creates a PostTaxTypeAccountsForbidden with default headers values +func NewPostTaxTypeAccountsForbidden() *PostTaxTypeAccountsForbidden { + return &PostTaxTypeAccountsForbidden{} +} + +/*PostTaxTypeAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxTypeAccountsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTaxTypeAccountsForbidden) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxTypeAccountsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsNotFound creates a PostTaxTypeAccountsNotFound with default headers values +func NewPostTaxTypeAccountsNotFound() *PostTaxTypeAccountsNotFound { + return &PostTaxTypeAccountsNotFound{} +} + +/*PostTaxTypeAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxTypeAccountsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTaxTypeAccountsNotFound) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxTypeAccountsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsUnprocessableEntity creates a PostTaxTypeAccountsUnprocessableEntity with default headers values +func NewPostTaxTypeAccountsUnprocessableEntity() *PostTaxTypeAccountsUnprocessableEntity { + return &PostTaxTypeAccountsUnprocessableEntity{} +} + +/*PostTaxTypeAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTaxTypeAccountsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTaxTypeAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTaxTypeAccountsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsInternalServerError creates a PostTaxTypeAccountsInternalServerError with default headers values +func NewPostTaxTypeAccountsInternalServerError() *PostTaxTypeAccountsInternalServerError { + return &PostTaxTypeAccountsInternalServerError{} +} + +/*PostTaxTypeAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxTypeAccountsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTaxTypeAccountsInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxTypeAccountsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/tax_type_account/put_tax_type_accounts_parameters.go b/api/regs/regs_client/tax_type_account/put_tax_type_accounts_parameters.go new file mode 100644 index 0000000..61b7e3d --- /dev/null +++ b/api/regs/regs_client/tax_type_account/put_tax_type_accounts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutTaxTypeAccountsParams creates a new PutTaxTypeAccountsParams object +// with the default values initialized. +func NewPutTaxTypeAccountsParams() *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutTaxTypeAccountsParamsWithTimeout creates a new PutTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutTaxTypeAccountsParamsWithTimeout(timeout time.Duration) *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + + timeout: timeout, + } +} + +// NewPutTaxTypeAccountsParamsWithContext creates a new PutTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutTaxTypeAccountsParamsWithContext(ctx context.Context) *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + + Context: ctx, + } +} + +// NewPutTaxTypeAccountsParamsWithHTTPClient creates a new PutTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutTaxTypeAccountsParamsWithHTTPClient(client *http.Client) *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + HTTPClient: client, + } +} + +/*PutTaxTypeAccountsParams contains all the parameters to send to the API endpoint +for the put tax type accounts operation typically these are written to a http.Request +*/ +type PutTaxTypeAccountsParams struct { + + /*TaxTypeAccountRequest + A request with an array of Tax Type Account Objects + + */ + TaxTypeAccountRequest *regs_models.TaxTypeAccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithTimeout(timeout time.Duration) *PutTaxTypeAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithContext(ctx context.Context) *PutTaxTypeAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithHTTPClient(client *http.Client) *PutTaxTypeAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaxTypeAccountRequest adds the taxTypeAccountRequest to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithTaxTypeAccountRequest(taxTypeAccountRequest *regs_models.TaxTypeAccountRequest) *PutTaxTypeAccountsParams { + o.SetTaxTypeAccountRequest(taxTypeAccountRequest) + return o +} + +// SetTaxTypeAccountRequest adds the taxTypeAccountRequest to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetTaxTypeAccountRequest(taxTypeAccountRequest *regs_models.TaxTypeAccountRequest) { + o.TaxTypeAccountRequest = taxTypeAccountRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutTaxTypeAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TaxTypeAccountRequest != nil { + if err := r.SetBodyParam(o.TaxTypeAccountRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/tax_type_account/put_tax_type_accounts_responses.go b/api/regs/regs_client/tax_type_account/put_tax_type_accounts_responses.go new file mode 100644 index 0000000..84865ba --- /dev/null +++ b/api/regs/regs_client/tax_type_account/put_tax_type_accounts_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutTaxTypeAccountsReader is a Reader for the PutTaxTypeAccounts structure. +type PutTaxTypeAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutTaxTypeAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutTaxTypeAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutTaxTypeAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutTaxTypeAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutTaxTypeAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutTaxTypeAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutTaxTypeAccountsOK creates a PutTaxTypeAccountsOK with default headers values +func NewPutTaxTypeAccountsOK() *PutTaxTypeAccountsOK { + return &PutTaxTypeAccountsOK{} +} + +/*PutTaxTypeAccountsOK handles this case with default header values. + +Taxnexus Response with Tax Type Account objects +*/ +type PutTaxTypeAccountsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.TaxTypeAccountResponse +} + +func (o *PutTaxTypeAccountsOK) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsOK %+v", 200, o.Payload) +} + +func (o *PutTaxTypeAccountsOK) GetPayload() *regs_models.TaxTypeAccountResponse { + return o.Payload +} + +func (o *PutTaxTypeAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.TaxTypeAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsUnauthorized creates a PutTaxTypeAccountsUnauthorized with default headers values +func NewPutTaxTypeAccountsUnauthorized() *PutTaxTypeAccountsUnauthorized { + return &PutTaxTypeAccountsUnauthorized{} +} + +/*PutTaxTypeAccountsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutTaxTypeAccountsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTaxTypeAccountsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutTaxTypeAccountsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsForbidden creates a PutTaxTypeAccountsForbidden with default headers values +func NewPutTaxTypeAccountsForbidden() *PutTaxTypeAccountsForbidden { + return &PutTaxTypeAccountsForbidden{} +} + +/*PutTaxTypeAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutTaxTypeAccountsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTaxTypeAccountsForbidden) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsForbidden %+v", 403, o.Payload) +} + +func (o *PutTaxTypeAccountsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsNotFound creates a PutTaxTypeAccountsNotFound with default headers values +func NewPutTaxTypeAccountsNotFound() *PutTaxTypeAccountsNotFound { + return &PutTaxTypeAccountsNotFound{} +} + +/*PutTaxTypeAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutTaxTypeAccountsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTaxTypeAccountsNotFound) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsNotFound %+v", 404, o.Payload) +} + +func (o *PutTaxTypeAccountsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsUnprocessableEntity creates a PutTaxTypeAccountsUnprocessableEntity with default headers values +func NewPutTaxTypeAccountsUnprocessableEntity() *PutTaxTypeAccountsUnprocessableEntity { + return &PutTaxTypeAccountsUnprocessableEntity{} +} + +/*PutTaxTypeAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutTaxTypeAccountsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTaxTypeAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutTaxTypeAccountsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsInternalServerError creates a PutTaxTypeAccountsInternalServerError with default headers values +func NewPutTaxTypeAccountsInternalServerError() *PutTaxTypeAccountsInternalServerError { + return &PutTaxTypeAccountsInternalServerError{} +} + +/*PutTaxTypeAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutTaxTypeAccountsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTaxTypeAccountsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutTaxTypeAccountsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/tax_type_account/tax_type_account_client.go b/api/regs/regs_client/tax_type_account/tax_type_account_client.go new file mode 100644 index 0000000..77300b8 --- /dev/null +++ b/api/regs/regs_client/tax_type_account/tax_type_account_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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 tax type account API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax type account API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteTypeAccounts(params *DeleteTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteTypeAccountsOK, error) + + GetTaxTypeAccounts(params *GetTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypeAccountsOK, error) + + PostTaxTypeAccounts(params *PostTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxTypeAccountsOK, error) + + PutTaxTypeAccounts(params *PutTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTaxTypeAccountsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteTypeAccounts deletes a tax type accounts + + Delete Taxnexus Tax Type Accounts +*/ +func (a *Client) DeleteTypeAccounts(params *DeleteTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteTypeAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTypeAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "deleteTypeAccounts", + Method: "DELETE", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteTypeAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteTypeAccountsOK) + 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 deleteTypeAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetTaxTypeAccounts gets a list of tax type accounts + + Return a list of Tax Type Accounts +*/ +func (a *Client) GetTaxTypeAccounts(params *GetTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypeAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxTypeAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxTypeAccounts", + Method: "GET", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxTypeAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxTypeAccountsOK) + 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 getTaxTypeAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTaxTypeAccounts adds new tax type accounts + + Tax Type Accounts to be added +*/ +func (a *Client) PostTaxTypeAccounts(params *PostTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxTypeAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxTypeAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxTypeAccounts", + Method: "POST", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxTypeAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxTypeAccountsOK) + 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 postTaxTypeAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutTaxTypeAccounts updates tax type accounts + + Update Tax Type Accounts records +*/ +func (a *Client) PutTaxTypeAccounts(params *PutTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTaxTypeAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutTaxTypeAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putTaxTypeAccounts", + Method: "PUT", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutTaxTypeAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutTaxTypeAccountsOK) + 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 putTaxTypeAccounts: 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/regs/regs_client/transaction/get_transactions_parameters.go b/api/regs/regs_client/transaction/get_transactions_parameters.go new file mode 100644 index 0000000..4c52880 --- /dev/null +++ b/api/regs/regs_client/transaction/get_transactions_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transaction + +// 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" +) + +// NewGetTransactionsParams creates a new GetTransactionsParams object +// with the default values initialized. +func NewGetTransactionsParams() *GetTransactionsParams { + var () + return &GetTransactionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTransactionsParamsWithTimeout creates a new GetTransactionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTransactionsParamsWithTimeout(timeout time.Duration) *GetTransactionsParams { + var () + return &GetTransactionsParams{ + + timeout: timeout, + } +} + +// NewGetTransactionsParamsWithContext creates a new GetTransactionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTransactionsParamsWithContext(ctx context.Context) *GetTransactionsParams { + var () + return &GetTransactionsParams{ + + Context: ctx, + } +} + +// NewGetTransactionsParamsWithHTTPClient creates a new GetTransactionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTransactionsParamsWithHTTPClient(client *http.Client) *GetTransactionsParams { + var () + return &GetTransactionsParams{ + HTTPClient: client, + } +} + +/*GetTransactionsParams contains all the parameters to send to the API endpoint +for the get transactions operation typically these are written to a http.Request +*/ +type GetTransactionsParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TransactionID + Template ID + + */ + TransactionID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get transactions params +func (o *GetTransactionsParams) WithTimeout(timeout time.Duration) *GetTransactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get transactions params +func (o *GetTransactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get transactions params +func (o *GetTransactionsParams) WithContext(ctx context.Context) *GetTransactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get transactions params +func (o *GetTransactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get transactions params +func (o *GetTransactionsParams) WithHTTPClient(client *http.Client) *GetTransactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get transactions params +func (o *GetTransactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get transactions params +func (o *GetTransactionsParams) WithLimit(limit *int64) *GetTransactionsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get transactions params +func (o *GetTransactionsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get transactions params +func (o *GetTransactionsParams) WithOffset(offset *int64) *GetTransactionsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get transactions params +func (o *GetTransactionsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithTransactionID adds the transactionID to the get transactions params +func (o *GetTransactionsParams) WithTransactionID(transactionID *string) *GetTransactionsParams { + o.SetTransactionID(transactionID) + return o +} + +// SetTransactionID adds the transactionId to the get transactions params +func (o *GetTransactionsParams) SetTransactionID(transactionID *string) { + o.TransactionID = transactionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTransactionsParams) 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.TransactionID != nil { + + // query param transactionId + var qrTransactionID string + if o.TransactionID != nil { + qrTransactionID = *o.TransactionID + } + qTransactionID := qrTransactionID + if qTransactionID != "" { + if err := r.SetQueryParam("transactionId", qTransactionID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/transaction/get_transactions_responses.go b/api/regs/regs_client/transaction/get_transactions_responses.go new file mode 100644 index 0000000..762e2e2 --- /dev/null +++ b/api/regs/regs_client/transaction/get_transactions_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transaction + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// GetTransactionsReader is a Reader for the GetTransactions structure. +type GetTransactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTransactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTransactionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTransactionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTransactionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTransactionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTransactionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTransactionsOK creates a GetTransactionsOK with default headers values +func NewGetTransactionsOK() *GetTransactionsOK { + return &GetTransactionsOK{} +} + +/*GetTransactionsOK handles this case with default header values. + +Taxnexus Response with Transaction objects +*/ +type GetTransactionsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.TransactionResponse +} + +func (o *GetTransactionsOK) Error() string { + return fmt.Sprintf("[GET /transactions][%d] getTransactionsOK %+v", 200, o.Payload) +} + +func (o *GetTransactionsOK) GetPayload() *regs_models.TransactionResponse { + return o.Payload +} + +func (o *GetTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.TransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsUnauthorized creates a GetTransactionsUnauthorized with default headers values +func NewGetTransactionsUnauthorized() *GetTransactionsUnauthorized { + return &GetTransactionsUnauthorized{} +} + +/*GetTransactionsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type GetTransactionsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTransactionsUnauthorized) Error() string { + return fmt.Sprintf("[GET /transactions][%d] getTransactionsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTransactionsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsForbidden creates a GetTransactionsForbidden with default headers values +func NewGetTransactionsForbidden() *GetTransactionsForbidden { + return &GetTransactionsForbidden{} +} + +/*GetTransactionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTransactionsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTransactionsForbidden) Error() string { + return fmt.Sprintf("[GET /transactions][%d] getTransactionsForbidden %+v", 403, o.Payload) +} + +func (o *GetTransactionsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsNotFound creates a GetTransactionsNotFound with default headers values +func NewGetTransactionsNotFound() *GetTransactionsNotFound { + return &GetTransactionsNotFound{} +} + +/*GetTransactionsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTransactionsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTransactionsNotFound) Error() string { + return fmt.Sprintf("[GET /transactions][%d] getTransactionsNotFound %+v", 404, o.Payload) +} + +func (o *GetTransactionsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsUnprocessableEntity creates a GetTransactionsUnprocessableEntity with default headers values +func NewGetTransactionsUnprocessableEntity() *GetTransactionsUnprocessableEntity { + return &GetTransactionsUnprocessableEntity{} +} + +/*GetTransactionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTransactionsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTransactionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /transactions][%d] getTransactionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTransactionsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTransactionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTransactionsInternalServerError creates a GetTransactionsInternalServerError with default headers values +func NewGetTransactionsInternalServerError() *GetTransactionsInternalServerError { + return &GetTransactionsInternalServerError{} +} + +/*GetTransactionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTransactionsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *GetTransactionsInternalServerError) Error() string { + return fmt.Sprintf("[GET /transactions][%d] getTransactionsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTransactionsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *GetTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/transaction/post_transactions_parameters.go b/api/regs/regs_client/transaction/post_transactions_parameters.go new file mode 100644 index 0000000..78049af --- /dev/null +++ b/api/regs/regs_client/transaction/post_transactions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transaction + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPostTransactionsParams creates a new PostTransactionsParams object +// with the default values initialized. +func NewPostTransactionsParams() *PostTransactionsParams { + var () + return &PostTransactionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTransactionsParamsWithTimeout creates a new PostTransactionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTransactionsParamsWithTimeout(timeout time.Duration) *PostTransactionsParams { + var () + return &PostTransactionsParams{ + + timeout: timeout, + } +} + +// NewPostTransactionsParamsWithContext creates a new PostTransactionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTransactionsParamsWithContext(ctx context.Context) *PostTransactionsParams { + var () + return &PostTransactionsParams{ + + Context: ctx, + } +} + +// NewPostTransactionsParamsWithHTTPClient creates a new PostTransactionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTransactionsParamsWithHTTPClient(client *http.Client) *PostTransactionsParams { + var () + return &PostTransactionsParams{ + HTTPClient: client, + } +} + +/*PostTransactionsParams contains all the parameters to send to the API endpoint +for the post transactions operation typically these are written to a http.Request +*/ +type PostTransactionsParams struct { + + /*TransactionRequest + An array of Transaction records + + */ + TransactionRequest *regs_models.TransactionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post transactions params +func (o *PostTransactionsParams) WithTimeout(timeout time.Duration) *PostTransactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post transactions params +func (o *PostTransactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post transactions params +func (o *PostTransactionsParams) WithContext(ctx context.Context) *PostTransactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post transactions params +func (o *PostTransactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post transactions params +func (o *PostTransactionsParams) WithHTTPClient(client *http.Client) *PostTransactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post transactions params +func (o *PostTransactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTransactionRequest adds the transactionRequest to the post transactions params +func (o *PostTransactionsParams) WithTransactionRequest(transactionRequest *regs_models.TransactionRequest) *PostTransactionsParams { + o.SetTransactionRequest(transactionRequest) + return o +} + +// SetTransactionRequest adds the transactionRequest to the post transactions params +func (o *PostTransactionsParams) SetTransactionRequest(transactionRequest *regs_models.TransactionRequest) { + o.TransactionRequest = transactionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TransactionRequest != nil { + if err := r.SetBodyParam(o.TransactionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/transaction/post_transactions_responses.go b/api/regs/regs_client/transaction/post_transactions_responses.go new file mode 100644 index 0000000..4abf3cc --- /dev/null +++ b/api/regs/regs_client/transaction/post_transactions_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transaction + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PostTransactionsReader is a Reader for the PostTransactions structure. +type PostTransactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTransactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTransactionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTransactionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTransactionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostTransactionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTransactionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTransactionsOK creates a PostTransactionsOK with default headers values +func NewPostTransactionsOK() *PostTransactionsOK { + return &PostTransactionsOK{} +} + +/*PostTransactionsOK handles this case with default header values. + +Taxnexus Response with Transaction objects +*/ +type PostTransactionsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.TransactionResponse +} + +func (o *PostTransactionsOK) Error() string { + return fmt.Sprintf("[POST /transactions][%d] postTransactionsOK %+v", 200, o.Payload) +} + +func (o *PostTransactionsOK) GetPayload() *regs_models.TransactionResponse { + return o.Payload +} + +func (o *PostTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.TransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTransactionsUnauthorized creates a PostTransactionsUnauthorized with default headers values +func NewPostTransactionsUnauthorized() *PostTransactionsUnauthorized { + return &PostTransactionsUnauthorized{} +} + +/*PostTransactionsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostTransactionsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTransactionsUnauthorized) Error() string { + return fmt.Sprintf("[POST /transactions][%d] postTransactionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTransactionsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTransactionsForbidden creates a PostTransactionsForbidden with default headers values +func NewPostTransactionsForbidden() *PostTransactionsForbidden { + return &PostTransactionsForbidden{} +} + +/*PostTransactionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTransactionsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTransactionsForbidden) Error() string { + return fmt.Sprintf("[POST /transactions][%d] postTransactionsForbidden %+v", 403, o.Payload) +} + +func (o *PostTransactionsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTransactionsNotFound creates a PostTransactionsNotFound with default headers values +func NewPostTransactionsNotFound() *PostTransactionsNotFound { + return &PostTransactionsNotFound{} +} + +/*PostTransactionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTransactionsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTransactionsNotFound) Error() string { + return fmt.Sprintf("[POST /transactions][%d] postTransactionsNotFound %+v", 404, o.Payload) +} + +func (o *PostTransactionsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTransactionsUnprocessableEntity creates a PostTransactionsUnprocessableEntity with default headers values +func NewPostTransactionsUnprocessableEntity() *PostTransactionsUnprocessableEntity { + return &PostTransactionsUnprocessableEntity{} +} + +/*PostTransactionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostTransactionsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTransactionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /transactions][%d] postTransactionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostTransactionsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTransactionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTransactionsInternalServerError creates a PostTransactionsInternalServerError with default headers values +func NewPostTransactionsInternalServerError() *PostTransactionsInternalServerError { + return &PostTransactionsInternalServerError{} +} + +/*PostTransactionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTransactionsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PostTransactionsInternalServerError) Error() string { + return fmt.Sprintf("[POST /transactions][%d] postTransactionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTransactionsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PostTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/transaction/put_transactions_parameters.go b/api/regs/regs_client/transaction/put_transactions_parameters.go new file mode 100644 index 0000000..17dd168 --- /dev/null +++ b/api/regs/regs_client/transaction/put_transactions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transaction + +// 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/taxnexus/go/lib/api/regs/regs_models" +) + +// NewPutTransactionsParams creates a new PutTransactionsParams object +// with the default values initialized. +func NewPutTransactionsParams() *PutTransactionsParams { + var () + return &PutTransactionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutTransactionsParamsWithTimeout creates a new PutTransactionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutTransactionsParamsWithTimeout(timeout time.Duration) *PutTransactionsParams { + var () + return &PutTransactionsParams{ + + timeout: timeout, + } +} + +// NewPutTransactionsParamsWithContext creates a new PutTransactionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutTransactionsParamsWithContext(ctx context.Context) *PutTransactionsParams { + var () + return &PutTransactionsParams{ + + Context: ctx, + } +} + +// NewPutTransactionsParamsWithHTTPClient creates a new PutTransactionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutTransactionsParamsWithHTTPClient(client *http.Client) *PutTransactionsParams { + var () + return &PutTransactionsParams{ + HTTPClient: client, + } +} + +/*PutTransactionsParams contains all the parameters to send to the API endpoint +for the put transactions operation typically these are written to a http.Request +*/ +type PutTransactionsParams struct { + + /*TransactionRequest + An array of Transaction records + + */ + TransactionRequest *regs_models.TransactionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put transactions params +func (o *PutTransactionsParams) WithTimeout(timeout time.Duration) *PutTransactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put transactions params +func (o *PutTransactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put transactions params +func (o *PutTransactionsParams) WithContext(ctx context.Context) *PutTransactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put transactions params +func (o *PutTransactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put transactions params +func (o *PutTransactionsParams) WithHTTPClient(client *http.Client) *PutTransactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put transactions params +func (o *PutTransactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTransactionRequest adds the transactionRequest to the put transactions params +func (o *PutTransactionsParams) WithTransactionRequest(transactionRequest *regs_models.TransactionRequest) *PutTransactionsParams { + o.SetTransactionRequest(transactionRequest) + return o +} + +// SetTransactionRequest adds the transactionRequest to the put transactions params +func (o *PutTransactionsParams) SetTransactionRequest(transactionRequest *regs_models.TransactionRequest) { + o.TransactionRequest = transactionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutTransactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TransactionRequest != nil { + if err := r.SetBodyParam(o.TransactionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/regs/regs_client/transaction/put_transactions_responses.go b/api/regs/regs_client/transaction/put_transactions_responses.go new file mode 100644 index 0000000..43c475e --- /dev/null +++ b/api/regs/regs_client/transaction/put_transactions_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transaction + +// 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" + + "github.com/taxnexus/go/lib/api/regs/regs_models" +) + +// PutTransactionsReader is a Reader for the PutTransactions structure. +type PutTransactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutTransactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutTransactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutTransactionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutTransactionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutTransactionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutTransactionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutTransactionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutTransactionsOK creates a PutTransactionsOK with default headers values +func NewPutTransactionsOK() *PutTransactionsOK { + return &PutTransactionsOK{} +} + +/*PutTransactionsOK handles this case with default header values. + +Taxnexus Response with Transaction objects +*/ +type PutTransactionsOK struct { + AccessControlAllowOrigin string + + CacheControl string + + Payload *regs_models.TransactionResponse +} + +func (o *PutTransactionsOK) Error() string { + return fmt.Sprintf("[PUT /transactions][%d] putTransactionsOK %+v", 200, o.Payload) +} + +func (o *PutTransactionsOK) GetPayload() *regs_models.TransactionResponse { + return o.Payload +} + +func (o *PutTransactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + o.Payload = new(regs_models.TransactionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTransactionsUnauthorized creates a PutTransactionsUnauthorized with default headers values +func NewPutTransactionsUnauthorized() *PutTransactionsUnauthorized { + return &PutTransactionsUnauthorized{} +} + +/*PutTransactionsUnauthorized handles this case with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PutTransactionsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTransactionsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /transactions][%d] putTransactionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutTransactionsUnauthorized) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTransactionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTransactionsForbidden creates a PutTransactionsForbidden with default headers values +func NewPutTransactionsForbidden() *PutTransactionsForbidden { + return &PutTransactionsForbidden{} +} + +/*PutTransactionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutTransactionsForbidden struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTransactionsForbidden) Error() string { + return fmt.Sprintf("[PUT /transactions][%d] putTransactionsForbidden %+v", 403, o.Payload) +} + +func (o *PutTransactionsForbidden) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTransactionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTransactionsNotFound creates a PutTransactionsNotFound with default headers values +func NewPutTransactionsNotFound() *PutTransactionsNotFound { + return &PutTransactionsNotFound{} +} + +/*PutTransactionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutTransactionsNotFound struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTransactionsNotFound) Error() string { + return fmt.Sprintf("[PUT /transactions][%d] putTransactionsNotFound %+v", 404, o.Payload) +} + +func (o *PutTransactionsNotFound) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTransactionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTransactionsUnprocessableEntity creates a PutTransactionsUnprocessableEntity with default headers values +func NewPutTransactionsUnprocessableEntity() *PutTransactionsUnprocessableEntity { + return &PutTransactionsUnprocessableEntity{} +} + +/*PutTransactionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutTransactionsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTransactionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /transactions][%d] putTransactionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutTransactionsUnprocessableEntity) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTransactionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTransactionsInternalServerError creates a PutTransactionsInternalServerError with default headers values +func NewPutTransactionsInternalServerError() *PutTransactionsInternalServerError { + return &PutTransactionsInternalServerError{} +} + +/*PutTransactionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutTransactionsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *regs_models.Error +} + +func (o *PutTransactionsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /transactions][%d] putTransactionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutTransactionsInternalServerError) GetPayload() *regs_models.Error { + return o.Payload +} + +func (o *PutTransactionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(regs_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/regs/regs_client/transaction/transaction_client.go b/api/regs/regs_client/transaction/transaction_client.go new file mode 100644 index 0000000..9d675ae --- /dev/null +++ b/api/regs/regs_client/transaction/transaction_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package transaction + +// 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 transaction API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for transaction API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error) + + PostTransactions(params *PostTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTransactionsOK, error) + + PutTransactions(params *PutTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTransactionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTransactions gets a list of transactions + + Return a list of Transaction records from the datastore +*/ +func (a *Client) GetTransactions(params *GetTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTransactionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTransactionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTransactions", + Method: "GET", + PathPattern: "/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTransactionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTransactionsOK) + 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 getTransactions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTransactions creates new transactiona + + Create Transactions in Taxnexus +*/ +func (a *Client) PostTransactions(params *PostTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTransactionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTransactionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTransactions", + Method: "POST", + PathPattern: "/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTransactionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTransactionsOK) + 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 postTransactions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutTransactions updates transactions + + Update Transactions in Taxnexus +*/ +func (a *Client) PutTransactions(params *PutTransactionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTransactionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutTransactionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putTransactions", + Method: "PUT", + PathPattern: "/transactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutTransactionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutTransactionsOK) + 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 putTransactions: 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/regs/regs_models/authority.go b/api/regs/regs_models/authority.go new file mode 100644 index 0000000..4a40ab3 --- /dev/null +++ b/api/regs/regs_models/authority.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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"` + + // Taxnexus 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 +} + +// 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/regs/regs_models/authority_request.go b/api/regs/regs_models/authority_request.go new file mode 100644 index 0000000..72cfdcc --- /dev/null +++ b/api/regs/regs_models/authority_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/regs/regs_models/authority_response.go b/api/regs/regs_models/authority_response.go new file mode 100644 index 0000000..b2a649e --- /dev/null +++ b/api/regs/regs_models/authority_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/regs/regs_models/backend.go b/api/regs/regs_models/backend.go new file mode 100644 index 0000000..33ebcfe --- /dev/null +++ b/api/regs/regs_models/backend.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Backend backend +// +// swagger:model Backend +type Backend struct { + + // apikey + APIKey string `json:"APIKey,omitempty"` + + // The Account that owns this Backend + AccountID string `json:"AccountID,omitempty"` + + // Active + Active bool `json:"Active,omitempty"` + + // Used to identify the State were required + ApplicationName string `json:"ApplicationName,omitempty"` + + // Authentication Type + AuthType string `json:"AuthType,omitempty"` + + // Backend Name + BackendName string `json:"BackendName,omitempty"` + + // base_url + BaseURL string `json:"BaseURL,omitempty"` + + // callback_url + CallbackURL string `json:"CallbackURL,omitempty"` + + // client_id + ClientID string `json:"ClientID,omitempty"` + + // client_secret + ClientSecret string `json:"ClientSecret,omitempty"` + + // Company + CompanyID string `json:"CompanyID,omitempty"` + + // Database object creation user + CreatedByID string `json:"CreatedByID,omitempty"` + + // Database object creation date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // Database object modification user + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Database object modification date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // login_url + LoginURL string `json:"LoginURL,omitempty"` + + // Management Password + ManagementPassword string `json:"ManagementPassword,omitempty"` + + // Management URL + ManagementURL string `json:"ManagementURL,omitempty"` + + // Management Username + ManagementUsername string `json:"ManagementUsername,omitempty"` + + // MetrcLicense + MetrcLicense string `json:"MetrcLicense,omitempty"` + + // MetrcState + MetrcState string `json:"MetrcState,omitempty"` + + // Ownerid + OwnerID string `json:"OwnerID,omitempty"` + + // password + Password string `json:"Password,omitempty"` + + // project_id + ProjectID string `json:"ProjectID,omitempty"` + + // Provider Credentials + ProviderCredentials string `json:"ProviderCredentials,omitempty"` + + // realm + Realm string `json:"Realm,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Resellerbackendid + ResellerBackendID string `json:"ResellerBackendID,omitempty"` + + // security_token + SecurityToken string `json:"SecurityToken,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Timeout + Timeout int64 `json:"Timeout,omitempty"` + + // token_uri + TokenURI string `json:"TokenURI,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // username + Username string `json:"Username,omitempty"` + + // Backend Vendor Name + Vendor string `json:"Vendor,omitempty"` +} + +// Validate validates this backend +func (m *Backend) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Backend) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Backend) UnmarshalBinary(b []byte) error { + var res Backend + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/backend_request.go b/api/regs/regs_models/backend_request.go new file mode 100644 index 0000000..41e834a --- /dev/null +++ b/api/regs/regs_models/backend_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackendRequest backend request +// +// swagger:model BackendRequest +type BackendRequest struct { + + // data + Data []*Backend `json:"Data"` +} + +// Validate validates this backend request +func (m *BackendRequest) 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 *BackendRequest) 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 +} + +// MarshalBinary interface implementation +func (m *BackendRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackendRequest) UnmarshalBinary(b []byte) error { + var res BackendRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/backend_response.go b/api/regs/regs_models/backend_response.go new file mode 100644 index 0000000..f075d4a --- /dev/null +++ b/api/regs/regs_models/backend_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackendResponse An array of Backend Objects +// +// swagger:model BackendResponse +type BackendResponse struct { + + // data + Data []*Backend `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this backend response +func (m *BackendResponse) 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 *BackendResponse) 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 *BackendResponse) 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 +} + +// MarshalBinary interface implementation +func (m *BackendResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackendResponse) UnmarshalBinary(b []byte) error { + var res BackendResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/delete_response.go b/api/regs/regs_models/delete_response.go new file mode 100644 index 0000000..93aa6d2 --- /dev/null +++ b/api/regs/regs_models/delete_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/regs/regs_models/error.go b/api/regs/regs_models/error.go new file mode 100644 index 0000000..c76205e --- /dev/null +++ b/api/regs/regs_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/regs/regs_models/filing.go b/api/regs/regs_models/filing.go new file mode 100644 index 0000000..3c9d534 --- /dev/null +++ b/api/regs/regs_models/filing.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Filing filing +// +// swagger:model Filing +type Filing struct { + + // Account Name on Filing + AccountName string `json:"AccountName,omitempty"` + + // The amount of tax to be paid with this filing + Amount float64 `json:"Amount,omitempty"` + + // Billing Contact + ContactID string `json:"ContactID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Filing Date + Date string `json:"Date,omitempty"` + + // Due Date + DueDate string `json:"DueDate,omitempty"` + + // Due Date + FilingNumber string `json:"FilingNumber,omitempty"` + + // The ID of the Filing Type for this Filing + FilingTypeID string `json:"FilingTypeID,omitempty"` + + // Due Date + Frequency string `json:"Frequency,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Interest + Interest float64 `json:"Interest,omitempty"` + + // Interest + InterestRate float64 `json:"InterestRate,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // The number of the Month of the filing + MonthNumber int64 `json:"MonthNumber,omitempty"` + + // Taxneuxs ID of the User who owns this record + OwnerID string `json:"OwnerID,omitempty"` + + // Penalty + Penalty float64 `json:"Penalty,omitempty"` + + // Penalty Days + PenaltyDays float64 `json:"PenaltyDays,omitempty"` + + // Penalty Days + PenaltyRate float64 `json:"PenaltyRate,omitempty"` + + // Period + PeriodID string `json:"PeriodID,omitempty"` + + // Taxnexus ID of the Contact who prepared this filing + PreparerID string `json:"PreparerID,omitempty"` + + // The number of the Month of the filing + QuarterNumber int64 `json:"QuarterNumber,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Reported Adjustments + ReportedAdjustments float64 `json:"ReportedAdjustments,omitempty"` + + // Reported Deductions + ReportedDeductions float64 `json:"ReportedDeductions,omitempty"` + + // Reported Net Revenue + ReportedNetRevenue float64 `json:"ReportedNetRevenue,omitempty"` + + // Reported Rate + ReportedRate float64 `json:"ReportedRate,omitempty"` + + // Reported Revenue + ReportedRevenue float64 `json:"ReportedRevenue,omitempty"` + + // Revenue Base + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // Revenue Net + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // Revenue Not Taxable + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + + // The number of the Month of the filing + SemiannualNumber int64 `json:"SemiannualNumber,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Taxnexus ID of the Submission that owns this Filing + SubmissionID string `json:"SubmissionID,omitempty"` + + // Reported Tax + Subtotal float64 `json:"Subtotal,omitempty"` + + // Tax On Tax + TaxOnTax float64 `json:"TaxOnTax,omitempty"` + + // The TaxType Account for which this Filing is paying remittance + TaxTypeAccountID string `json:"TaxTypeAccountID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Total Amount + TotalAmount float64 `json:"TotalAmount,omitempty"` + + // Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` + + // The number of the Month of the filing + YearNumber int64 `json:"YearNumber,omitempty"` +} + +// Validate validates this filing +func (m *Filing) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Filing) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Filing) UnmarshalBinary(b []byte) error { + var res Filing + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/filing_request.go b/api/regs/regs_models/filing_request.go new file mode 100644 index 0000000..738c1b7 --- /dev/null +++ b/api/regs/regs_models/filing_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingRequest filing request +// +// swagger:model FilingRequest +type FilingRequest struct { + + // data + Data []*Filing `json:"Data"` +} + +// Validate validates this filing request +func (m *FilingRequest) 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 *FilingRequest) 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 +} + +// MarshalBinary interface implementation +func (m *FilingRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingRequest) UnmarshalBinary(b []byte) error { + var res FilingRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/filing_response.go b/api/regs/regs_models/filing_response.go new file mode 100644 index 0000000..d064d96 --- /dev/null +++ b/api/regs/regs_models/filing_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingResponse An array of Filing Objects +// +// swagger:model FilingResponse +type FilingResponse struct { + + // data + Data []*Filing `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this filing response +func (m *FilingResponse) 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 *FilingResponse) 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 *FilingResponse) 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 +} + +// MarshalBinary interface implementation +func (m *FilingResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingResponse) UnmarshalBinary(b []byte) error { + var res FilingResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/filing_schedule_item.go b/api/regs/regs_models/filing_schedule_item.go new file mode 100644 index 0000000..d806813 --- /dev/null +++ b/api/regs/regs_models/filing_schedule_item.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingScheduleItem Dates when this FilingType is due for filing +// +// swagger:model FilingScheduleItem +type FilingScheduleItem struct { + + // description + Description string `json:"Description,omitempty"` + + // due date + DueDate string `json:"DueDate,omitempty"` +} + +// Validate validates this filing schedule item +func (m *FilingScheduleItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FilingScheduleItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingScheduleItem) UnmarshalBinary(b []byte) error { + var res FilingScheduleItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/filing_type.go b/api/regs/regs_models/filing_type.go new file mode 100644 index 0000000..05b0ce2 --- /dev/null +++ b/api/regs/regs_models/filing_type.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingType An array of FilingType Objects +// +// swagger:model FilingType +type FilingType struct { + + // Tax Authority + 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"` + + // due dates + DueDates []*FilingScheduleItem `json:"DueDates"` + + // Filing City + FilingCity string `json:"FilingCity,omitempty"` + + // Filing Country + FilingCountry string `json:"FilingCountry,omitempty"` + + // Filing Postal Code + FilingPostalCode string `json:"FilingPostalCode,omitempty"` + + // Filing State + FilingState string `json:"FilingState,omitempty"` + + // Filing Street + FilingStreet string `json:"FilingStreet,omitempty"` + + // Form Name + FormName string `json:"FormName,omitempty"` + + // Form Version + FormVersion string `json:"FormVersion,omitempty"` + + // Frequency + Frequency string `json:"Frequency,omitempty"` + + // Filing Full Name + FullName string `json:"FullName,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // instances + Instances []*FilingTypeInstance `json:"Instances"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedById,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Jurisdictional Level + Level string `json:"Level,omitempty"` + + // Name + Name string `json:"Name,omitempty"` + + // Owner + OwnerID string `json:"OwnerID,omitempty"` + + // Saga Type + SagaType string `json:"SagaType,omitempty"` + + // Submission Method + SubmissionMethod string `json:"SubmissionMethod,omitempty"` + + // Instructions Template + TemplateInstructionsID string `json:"TemplateInstructionsID,omitempty"` + + // Return Template + TemplateReturnID string `json:"TemplateReturnID,omitempty"` +} + +// Validate validates this filing type +func (m *FilingType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDueDates(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FilingType) validateDueDates(formats strfmt.Registry) error { + + if swag.IsZero(m.DueDates) { // not required + return nil + } + + for i := 0; i < len(m.DueDates); i++ { + if swag.IsZero(m.DueDates[i]) { // not required + continue + } + + if m.DueDates[i] != nil { + if err := m.DueDates[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DueDates" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FilingType) validateInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.Instances) { // not required + return nil + } + + for i := 0; i < len(m.Instances); i++ { + if swag.IsZero(m.Instances[i]) { // not required + continue + } + + if m.Instances[i] != nil { + if err := m.Instances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Instances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FilingType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingType) UnmarshalBinary(b []byte) error { + var res FilingType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/filing_type_instance.go b/api/regs/regs_models/filing_type_instance.go new file mode 100644 index 0000000..73f451d --- /dev/null +++ b/api/regs/regs_models/filing_type_instance.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingTypeInstance A list of jurisdictions that use this Filing Type +// +// swagger:model FilingTypeInstance +type FilingTypeInstance struct { + + // Country Id + CountryID string `json:"CountryID,omitempty"` + + // County ID + CountyID string `json:"CountyID,omitempty"` + + // The ID of the Filing Type for this Filing + FilingTypeID string `json:"FilingTypeID,omitempty"` + + // The type of object that owns this FilingType instance + ObjectType string `json:"ObjectType,omitempty"` + + // Place ID + PlaceID string `json:"PlaceID,omitempty"` + + // StateID + StateID string `json:"StateID,omitempty"` +} + +// Validate validates this filing type instance +func (m *FilingTypeInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FilingTypeInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingTypeInstance) UnmarshalBinary(b []byte) error { + var res FilingTypeInstance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/filing_type_request.go b/api/regs/regs_models/filing_type_request.go new file mode 100644 index 0000000..fd55d54 --- /dev/null +++ b/api/regs/regs_models/filing_type_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingTypeRequest filing type request +// +// swagger:model FilingTypeRequest +type FilingTypeRequest struct { + + // data + Data []*FilingType `json:"Data"` +} + +// Validate validates this filing type request +func (m *FilingTypeRequest) 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 *FilingTypeRequest) 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 +} + +// MarshalBinary interface implementation +func (m *FilingTypeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingTypeRequest) UnmarshalBinary(b []byte) error { + var res FilingTypeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/filing_type_response.go b/api/regs/regs_models/filing_type_response.go new file mode 100644 index 0000000..1454253 --- /dev/null +++ b/api/regs/regs_models/filing_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingTypeResponse An array of Filing Objects +// +// swagger:model FilingTypeResponse +type FilingTypeResponse struct { + + // data + Data []*FilingType `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this filing type response +func (m *FilingTypeResponse) 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 *FilingTypeResponse) 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 *FilingTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *FilingTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingTypeResponse) UnmarshalBinary(b []byte) error { + var res FilingTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/geo_license_type_instance.go b/api/regs/regs_models/geo_license_type_instance.go new file mode 100644 index 0000000..cd04e37 --- /dev/null +++ b/api/regs/regs_models/geo_license_type_instance.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GeoLicenseTypeInstance Links a license type to a geography +// +// swagger:model GeoLicenseTypeInstance +type GeoLicenseTypeInstance struct { + + // country ID + CountryID string `json:"CountryID,omitempty"` + + // county ID + CountyID string `json:"CountyID,omitempty"` + + // object type + ObjectType string `json:"ObjectType,omitempty"` + + // place ID + PlaceID string `json:"PlaceID,omitempty"` + + // state ID + StateID string `json:"StateID,omitempty"` +} + +// Validate validates this geo license type instance +func (m *GeoLicenseTypeInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GeoLicenseTypeInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GeoLicenseTypeInstance) UnmarshalBinary(b []byte) error { + var res GeoLicenseTypeInstance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/invalid_error.go b/api/regs/regs_models/invalid_error.go new file mode 100644 index 0000000..033d96a --- /dev/null +++ b/api/regs/regs_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/regs/regs_models/license.go b/api/regs/regs_models/license.go new file mode 100644 index 0000000..5bfa00d --- /dev/null +++ b/api/regs/regs_models/license.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// License license +// +// swagger:model License +type License struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Backend ID for external access + BackendID string `json:"BackendID,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Date + DateIssued string `json:"DateIssued,omitempty"` + + // The designation + Designation string `json:"Designation,omitempty"` + + // Expiration Date + ExpirationDate string `json:"ExpirationDate,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // Is Canceled? + IsCanceled bool `json:"IsCanceled,omitempty"` + + // Is Revoked? + IsRevoked bool `json:"IsRevoked,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // License Type ID + LicenseTypeID string `json:"LicenseTypeID,omitempty"` + + // License Number + Name string `json:"Name,omitempty"` + + // Owner of the object instance + OwnerID string `json:"OwnerID,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` +} + +// Validate validates this license +func (m *License) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *License) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *License) UnmarshalBinary(b []byte) error { + var res License + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/license_request.go b/api/regs/regs_models/license_request.go new file mode 100644 index 0000000..befe9cd --- /dev/null +++ b/api/regs/regs_models/license_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseRequest license request +// +// swagger:model LicenseRequest +type LicenseRequest struct { + + // data + Data []*License `json:"Data"` +} + +// Validate validates this license request +func (m *LicenseRequest) 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 *LicenseRequest) 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 +} + +// MarshalBinary interface implementation +func (m *LicenseRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseRequest) UnmarshalBinary(b []byte) error { + var res LicenseRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/license_response.go b/api/regs/regs_models/license_response.go new file mode 100644 index 0000000..da9fff2 --- /dev/null +++ b/api/regs/regs_models/license_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseResponse An array of License Objects +// +// swagger:model LicenseResponse +type LicenseResponse struct { + + // data + Data []*License `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this license response +func (m *LicenseResponse) 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 *LicenseResponse) 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 *LicenseResponse) 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 +} + +// MarshalBinary interface implementation +func (m *LicenseResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseResponse) UnmarshalBinary(b []byte) error { + var res LicenseResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/license_type.go b/api/regs/regs_models/license_type.go new file mode 100644 index 0000000..95a5fa9 --- /dev/null +++ b/api/regs/regs_models/license_type.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseType license type +// +// swagger:model LicenseType +type LicenseType struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Agent ID + AgentID string `json:"AgentID,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Cost + Cost float64 `json:"Cost,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Domain + DomainID string `json:"DomainID,omitempty"` + + // domains + Domains []string `json:"Domains"` + + // Frequency + Frequency string `json:"Frequency,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // jurisdictions + Jurisdictions []*GeoLicenseTypeInstance `json:"Jurisdictions"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Level + Level string `json:"Level,omitempty"` + + // License Type Metrc Name + MetrcName string `json:"MetrcName,omitempty"` + + // License Type Name + Name string `json:"Name,omitempty"` + + // License Type Picklist Value + PicklistValue string `json:"PicklistValue,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Restriction + Restriction string `json:"Restriction,omitempty"` + + // Tier + Tier string `json:"Tier,omitempty"` +} + +// Validate validates this license type +func (m *LicenseType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateJurisdictions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LicenseType) validateJurisdictions(formats strfmt.Registry) error { + + if swag.IsZero(m.Jurisdictions) { // not required + return nil + } + + for i := 0; i < len(m.Jurisdictions); i++ { + if swag.IsZero(m.Jurisdictions[i]) { // not required + continue + } + + if m.Jurisdictions[i] != nil { + if err := m.Jurisdictions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Jurisdictions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LicenseType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseType) UnmarshalBinary(b []byte) error { + var res LicenseType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/license_type_request.go b/api/regs/regs_models/license_type_request.go new file mode 100644 index 0000000..53d9c79 --- /dev/null +++ b/api/regs/regs_models/license_type_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseTypeRequest An array of License Type Objects +// +// swagger:model LicenseTypeRequest +type LicenseTypeRequest struct { + + // data + Data []*LicenseType `json:"Data"` +} + +// Validate validates this license type request +func (m *LicenseTypeRequest) 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 *LicenseTypeRequest) 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 +} + +// MarshalBinary interface implementation +func (m *LicenseTypeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseTypeRequest) UnmarshalBinary(b []byte) error { + var res LicenseTypeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/license_type_response.go b/api/regs/regs_models/license_type_response.go new file mode 100644 index 0000000..716c551 --- /dev/null +++ b/api/regs/regs_models/license_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseTypeResponse An array of License Type Objects +// +// swagger:model LicenseTypeResponse +type LicenseTypeResponse struct { + + // data + Data []*LicenseType `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this license type response +func (m *LicenseTypeResponse) 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 *LicenseTypeResponse) 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 *LicenseTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *LicenseTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseTypeResponse) UnmarshalBinary(b []byte) error { + var res LicenseTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/message.go b/api/regs/regs_models/message.go new file mode 100644 index 0000000..e26bd23 --- /dev/null +++ b/api/regs/regs_models/message.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/regs/regs_models/notebook.go b/api/regs/regs_models/notebook.go new file mode 100644 index 0000000..55039f0 --- /dev/null +++ b/api/regs/regs_models/notebook.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Notebook Defines a Taxnexus Notebook +// +// swagger:model Notebook +type Notebook 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"` + + // Analysis Date + Date string `json:"Date,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"` + + // items + Items []*NotebookItem `json:"Items"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedById,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Ending Period + PeriodEndID string `json:"PeriodEndID,omitempty"` + + // Starting Period + PeriodStartID string `json:"PeriodStartID,omitempty"` + + // Preparer + PreparerID string `json:"PreparerID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Title + Title string `json:"Title,omitempty"` +} + +// Validate validates this notebook +func (m *Notebook) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Notebook) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Notebook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Notebook) UnmarshalBinary(b []byte) error { + var res Notebook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/notebook_item.go b/api/regs/regs_models/notebook_item.go new file mode 100644 index 0000000..78ab97f --- /dev/null +++ b/api/regs/regs_models/notebook_item.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NotebookItem An analysis item associated with a Notebook +// +// swagger:model NotebookItem +type NotebookItem struct { + + // Record Id + ID string `json:"ID,omitempty"` + + // Developer name of component + ItemName string `json:"ItemName,omitempty"` + + // The notebook that owns this Item + NotebookID string `json:"NotebookID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Display title + Title string `json:"Title,omitempty"` +} + +// Validate validates this notebook item +func (m *NotebookItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NotebookItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NotebookItem) UnmarshalBinary(b []byte) error { + var res NotebookItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/notebook_request.go b/api/regs/regs_models/notebook_request.go new file mode 100644 index 0000000..faa503c --- /dev/null +++ b/api/regs/regs_models/notebook_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NotebookRequest An array of Notebook objects +// +// swagger:model NotebookRequest +type NotebookRequest struct { + + // data + Data []*Notebook `json:"Data"` +} + +// Validate validates this notebook request +func (m *NotebookRequest) 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 *NotebookRequest) 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 +} + +// MarshalBinary interface implementation +func (m *NotebookRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NotebookRequest) UnmarshalBinary(b []byte) error { + var res NotebookRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/notebook_response.go b/api/regs/regs_models/notebook_response.go new file mode 100644 index 0000000..f69d55c --- /dev/null +++ b/api/regs/regs_models/notebook_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NotebookResponse An array of Notebook objects +// +// swagger:model NotebookResponse +type NotebookResponse struct { + + // data + Data []*Notebook `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this notebook response +func (m *NotebookResponse) 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 *NotebookResponse) 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 *NotebookResponse) 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 +} + +// MarshalBinary interface implementation +func (m *NotebookResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NotebookResponse) UnmarshalBinary(b []byte) error { + var res NotebookResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/pagination.go b/api/regs/regs_models/pagination.go new file mode 100644 index 0000000..bf1aab5 --- /dev/null +++ b/api/regs/regs_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/regs/regs_models/rating_engine.go b/api/regs/regs_models/rating_engine.go new file mode 100644 index 0000000..2193b0f --- /dev/null +++ b/api/regs/regs_models/rating_engine.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RatingEngine rating engine +// +// swagger:model RatingEngine +type RatingEngine struct { + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // Taxnexus Rating Engine Record Id + ID string `json:"ID,omitempty"` + + // Ingest Method + IngestMethod string `json:"IngestMethod,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Rating Engine Name + Name string `json:"Name,omitempty"` + + // rules + Rules []*RatingEngineItem `json:"Rules"` +} + +// Validate validates this rating engine +func (m *RatingEngine) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRules(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RatingEngine) validateRules(formats strfmt.Registry) error { + + if swag.IsZero(m.Rules) { // not required + return nil + } + + for i := 0; i < len(m.Rules); i++ { + if swag.IsZero(m.Rules[i]) { // not required + continue + } + + if m.Rules[i] != nil { + if err := m.Rules[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Rules" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RatingEngine) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RatingEngine) UnmarshalBinary(b []byte) error { + var res RatingEngine + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/rating_engine_item.go b/api/regs/regs_models/rating_engine_item.go new file mode 100644 index 0000000..750ef02 --- /dev/null +++ b/api/regs/regs_models/rating_engine_item.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RatingEngineItem rating engine item +// +// swagger:model RatingEngineItem +type RatingEngineItem struct { + + // Created By + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Taxnexus Rating Engine Name + Name string `json:"Name,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Rating Engine + RatingEngineID string `json:"RatingEngineID,omitempty"` + + // External Reference + Ref string `json:"Ref,omitempty"` + + // Taxnexus Code + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` +} + +// Validate validates this rating engine item +func (m *RatingEngineItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RatingEngineItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RatingEngineItem) UnmarshalBinary(b []byte) error { + var res RatingEngineItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/rating_engine_request.go b/api/regs/regs_models/rating_engine_request.go new file mode 100644 index 0000000..d4cc4b8 --- /dev/null +++ b/api/regs/regs_models/rating_engine_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RatingEngineRequest rating engine request +// +// swagger:model RatingEngineRequest +type RatingEngineRequest struct { + + // data + Data []*RatingEngine `json:"Data"` +} + +// Validate validates this rating engine request +func (m *RatingEngineRequest) 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 *RatingEngineRequest) 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 +} + +// MarshalBinary interface implementation +func (m *RatingEngineRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RatingEngineRequest) UnmarshalBinary(b []byte) error { + var res RatingEngineRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/rating_engine_response.go b/api/regs/regs_models/rating_engine_response.go new file mode 100644 index 0000000..ff85609 --- /dev/null +++ b/api/regs/regs_models/rating_engine_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RatingEngineResponse An array of License Objects +// +// swagger:model RatingEngineResponse +type RatingEngineResponse struct { + + // data + Data []*RatingEngine `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this rating engine response +func (m *RatingEngineResponse) 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 *RatingEngineResponse) 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 *RatingEngineResponse) 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 +} + +// MarshalBinary interface implementation +func (m *RatingEngineResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RatingEngineResponse) UnmarshalBinary(b []byte) error { + var res RatingEngineResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/request_meta.go b/api/regs/regs_models/request_meta.go new file mode 100644 index 0000000..7b44ba1 --- /dev/null +++ b/api/regs/regs_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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/regs/regs_models/response_meta.go b/api/regs/regs_models/response_meta.go new file mode 100644 index 0000000..a5b92cc --- /dev/null +++ b/api/regs/regs_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/regs/regs_models/submission.go b/api/regs/regs_models/submission.go new file mode 100644 index 0000000..e9015af --- /dev/null +++ b/api/regs/regs_models/submission.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Submission submission +// +// swagger:model Submission +type Submission struct { + + // The Company that did the submission (Taxnexus) + CompanyID string `json:"CompanyID,omitempty"` + + // Submission Contact + ContactID string `json:"ContactID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // Last Modified By User ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Cover Letter + Notes string `json:"Notes,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Penalty paid + Penalty float64 `json:"Penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Reported Adjustments + ReportedAdjustments float64 `json:"ReportedAdjustments,omitempty"` + + // Reported Deductions + ReportedDeductions float64 `json:"ReportedDeductions,omitempty"` + + // Reported Net Revenue + ReportedNetRevenue float64 `json:"ReportedNetRevenue,omitempty"` + + // Reported Rate + ReportedRate float64 `json:"ReportedRate,omitempty"` + + // Reported Revenue + ReportedRevenue float64 `json:"ReportedRevenue,omitempty"` + + // Revenue Base + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // Revenue Net + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // Revenue Not Taxable + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Submission Date + SubmissionDate string `json:"SubmissionDate,omitempty"` + + // Submission Number + SubmissionNumber string `json:"SubmissionNumber,omitempty"` + + // Amount of remittance before penalty + Subtotal float64 `json:"Subtotal,omitempty"` + + // Taxnexus ID of the TaxType for which this submssion is being made + TaxTypeID string `json:"TaxTypeID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Total Amount of remittance + TotalAmount float64 `json:"TotalAmount,omitempty"` +} + +// Validate validates this submission +func (m *Submission) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Submission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Submission) UnmarshalBinary(b []byte) error { + var res Submission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/submission_request.go b/api/regs/regs_models/submission_request.go new file mode 100644 index 0000000..c45f134 --- /dev/null +++ b/api/regs/regs_models/submission_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubmissionRequest submission request +// +// swagger:model SubmissionRequest +type SubmissionRequest struct { + + // data + Data []*Submission `json:"Data"` +} + +// Validate validates this submission request +func (m *SubmissionRequest) 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 *SubmissionRequest) 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 +} + +// MarshalBinary interface implementation +func (m *SubmissionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubmissionRequest) UnmarshalBinary(b []byte) error { + var res SubmissionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/submission_response.go b/api/regs/regs_models/submission_response.go new file mode 100644 index 0000000..f8bb3fd --- /dev/null +++ b/api/regs/regs_models/submission_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubmissionResponse An array of Submission objects +// +// swagger:model SubmissionResponse +type SubmissionResponse struct { + + // data + Data []*Submission `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this submission response +func (m *SubmissionResponse) 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 *SubmissionResponse) 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 *SubmissionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SubmissionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubmissionResponse) UnmarshalBinary(b []byte) error { + var res SubmissionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/tax_type_account.go b/api/regs/regs_models/tax_type_account.go new file mode 100644 index 0000000..d097515 --- /dev/null +++ b/api/regs/regs_models/tax_type_account.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeAccount tax type account +// +// swagger:model TaxTypeAccount +type TaxTypeAccount struct { + + // Account + AccountID string `json:"AccountID,omitempty"` + + // Account Number + AccountNumber string `json:"AccountNumber,omitempty"` + + // Active + Active bool `json:"Active,omitempty"` + + // Rollup Amount + Amount float64 `json:"Amount,omitempty"` + + // Contact ID + ContactID string `json:"ContactID,omitempty"` + + // Created By User ID + CreatedByID string `json:"CreatedByID,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Description + Description string `json:"Description,omitempty"` + + // End Date + EndDate string `json:"EndDate,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Interest + Interest float64 `json:"Interest,omitempty"` + + // Last Modified By User ID + LastModfiedByID string `json:"LastModfiedByID,omitempty"` + + // Last Modified Date + LastModfiedDate string `json:"LastModfiedDate,omitempty"` + + // Notes + Notes string `json:"Notes,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Penalty + Penalty float64 `json:"Penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Reported Adjustments + ReportedAdjustments float64 `json:"ReportedAdjustments,omitempty"` + + // Reported Deductions + ReportedDeductions float64 `json:"ReportedDeductions,omitempty"` + + // Reported Net Revenue + ReportedNetRevenue float64 `json:"ReportedNetRevenue,omitempty"` + + // Reported Rate + ReportedRate float64 `json:"ReportedRate,omitempty"` + + // Reported Revenue + ReportedRevenue float64 `json:"ReportedRevenue,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"` + + // Start Date + StartDate string `json:"StartDate,omitempty"` + + // Reported Tax + Subtotal float64 `json:"Subtotal,omitempty"` + + // Rollup Tax + Tax float64 `json:"Tax,omitempty"` + + // Rollup Tax On Tax + TaxOnTax float64 `json:"TaxOnTax,omitempty"` + + // Tax Type + TaxTypeID string `json:"TaxTypeID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Total Amount + TotalAmount float64 `json:"TotalAmount,omitempty"` + + // Rollup Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` +} + +// Validate validates this tax type account +func (m *TaxTypeAccount) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxTypeAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeAccount) UnmarshalBinary(b []byte) error { + var res TaxTypeAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/tax_type_account_request.go b/api/regs/regs_models/tax_type_account_request.go new file mode 100644 index 0000000..c3488c0 --- /dev/null +++ b/api/regs/regs_models/tax_type_account_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeAccountRequest tax type account request +// +// swagger:model TaxTypeAccountRequest +type TaxTypeAccountRequest struct { + + // data + Data []*TaxTypeAccount `json:"Data"` +} + +// Validate validates this tax type account request +func (m *TaxTypeAccountRequest) 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 *TaxTypeAccountRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTypeAccountRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeAccountRequest) UnmarshalBinary(b []byte) error { + var res TaxTypeAccountRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/tax_type_account_response.go b/api/regs/regs_models/tax_type_account_response.go new file mode 100644 index 0000000..12b4e36 --- /dev/null +++ b/api/regs/regs_models/tax_type_account_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeAccountResponse An array of Tax Type Account objects +// +// swagger:model TaxTypeAccountResponse +type TaxTypeAccountResponse struct { + + // data + Data []*TaxTypeAccount `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this tax type account response +func (m *TaxTypeAccountResponse) 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 *TaxTypeAccountResponse) 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 *TaxTypeAccountResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTypeAccountResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeAccountResponse) UnmarshalBinary(b []byte) error { + var res TaxTypeAccountResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/transaction.go b/api/regs/regs_models/transaction.go new file mode 100644 index 0000000..546d190 --- /dev/null +++ b/api/regs/regs_models/transaction.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Transaction A regulatory tax transaction +// +// swagger:model Transaction +type Transaction struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Created By + CreatedByID string `json:"CreatedById,omitempty"` + + // Created Date + CreatedDate string `json:"CreatedDate,omitempty"` + + // Record Id + ID string `json:"ID,omitempty"` + + // Last Modified By + LastModifiedByID string `json:"LastModifiedById,omitempty"` + + // Last Modifed Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + + // Tax Transaction ID + TaxTransactionID string `json:"TaxTransactionID,omitempty"` + + // Tax Type ID + TaxTypeID string `json:"TaxTypeID,omitempty"` + + // Tenant that owns this object instance + TenantID string `json:"TenantID,omitempty"` + + // Is this Transaction valid? + Valid bool `json:"Valid,omitempty"` +} + +// Validate validates this transaction +func (m *Transaction) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Transaction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Transaction) UnmarshalBinary(b []byte) error { + var res Transaction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/transaction_request.go b/api/regs/regs_models/transaction_request.go new file mode 100644 index 0000000..62f51ce --- /dev/null +++ b/api/regs/regs_models/transaction_request.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransactionRequest transaction request +// +// swagger:model TransactionRequest +type TransactionRequest struct { + + // data + Data []*Transaction `json:"Data"` +} + +// Validate validates this transaction request +func (m *TransactionRequest) 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 *TransactionRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TransactionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionRequest) UnmarshalBinary(b []byte) error { + var res TransactionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/regs/regs_models/transaction_response.go b/api/regs/regs_models/transaction_response.go new file mode 100644 index 0000000..0187403 --- /dev/null +++ b/api/regs/regs_models/transaction_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package regs_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransactionResponse An array of Transaction objects +// +// swagger:model TransactionResponse +type TransactionResponse struct { + + // data + Data []*Transaction `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this transaction response +func (m *TransactionResponse) 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 *TransactionResponse) 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 *TransactionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TransactionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransactionResponse) UnmarshalBinary(b []byte) error { + var res TransactionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/render/render_client/account/account_client.go b/api/render/render_client/account/account_client.go new file mode 100644 index 0000000..dc34806 --- /dev/null +++ b/api/render/render_client/account/account_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRenderAccount(params *GetRenderAccountParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderAccountOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRenderAccount generates p d f from an account ID + + Generate PDF from an Account ID +*/ +func (a *Client) GetRenderAccount(params *GetRenderAccountParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderAccountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRenderAccountParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRenderAccount", + Method: "GET", + PathPattern: "/accounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRenderAccountReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRenderAccountOK) + 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 getRenderAccount: 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/render/render_client/account/get_render_account_parameters.go b/api/render/render_client/account/get_render_account_parameters.go new file mode 100644 index 0000000..cd633ea --- /dev/null +++ b/api/render/render_client/account/get_render_account_parameters.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetRenderAccountParams creates a new GetRenderAccountParams object +// with the default values initialized. +func NewGetRenderAccountParams() *GetRenderAccountParams { + var () + return &GetRenderAccountParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRenderAccountParamsWithTimeout creates a new GetRenderAccountParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRenderAccountParamsWithTimeout(timeout time.Duration) *GetRenderAccountParams { + var () + return &GetRenderAccountParams{ + + timeout: timeout, + } +} + +// NewGetRenderAccountParamsWithContext creates a new GetRenderAccountParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRenderAccountParamsWithContext(ctx context.Context) *GetRenderAccountParams { + var () + return &GetRenderAccountParams{ + + Context: ctx, + } +} + +// NewGetRenderAccountParamsWithHTTPClient creates a new GetRenderAccountParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRenderAccountParamsWithHTTPClient(client *http.Client) *GetRenderAccountParams { + var () + return &GetRenderAccountParams{ + HTTPClient: client, + } +} + +/*GetRenderAccountParams contains all the parameters to send to the API endpoint +for the get render account operation typically these are written to a http.Request +*/ +type GetRenderAccountParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get render account params +func (o *GetRenderAccountParams) WithTimeout(timeout time.Duration) *GetRenderAccountParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get render account params +func (o *GetRenderAccountParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get render account params +func (o *GetRenderAccountParams) WithContext(ctx context.Context) *GetRenderAccountParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get render account params +func (o *GetRenderAccountParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get render account params +func (o *GetRenderAccountParams) WithHTTPClient(client *http.Client) *GetRenderAccountParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get render account params +func (o *GetRenderAccountParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get render account params +func (o *GetRenderAccountParams) WithAccountID(accountID string) *GetRenderAccountParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get render account params +func (o *GetRenderAccountParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRenderAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param accountId + 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/render/render_client/account/get_render_account_responses.go b/api/render/render_client/account/get_render_account_responses.go new file mode 100644 index 0000000..dffe2d9 --- /dev/null +++ b/api/render/render_client/account/get_render_account_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/render/render_models" +) + +// GetRenderAccountReader is a Reader for the GetRenderAccount structure. +type GetRenderAccountReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRenderAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRenderAccountOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRenderAccountUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRenderAccountForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRenderAccountNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRenderAccountUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRenderAccountInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRenderAccountOK creates a GetRenderAccountOK with default headers values +func NewGetRenderAccountOK() *GetRenderAccountOK { + return &GetRenderAccountOK{} +} + +/*GetRenderAccountOK handles this case with default header values. + +Rendered documents response +*/ +type GetRenderAccountOK struct { + AccessControlAllowOrigin string + + Payload *render_models.DocumentResponse +} + +func (o *GetRenderAccountOK) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getRenderAccountOK %+v", 200, o.Payload) +} + +func (o *GetRenderAccountOK) GetPayload() *render_models.DocumentResponse { + return o.Payload +} + +func (o *GetRenderAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderAccountUnauthorized creates a GetRenderAccountUnauthorized with default headers values +func NewGetRenderAccountUnauthorized() *GetRenderAccountUnauthorized { + return &GetRenderAccountUnauthorized{} +} + +/*GetRenderAccountUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRenderAccountUnauthorized struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderAccountUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getRenderAccountUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRenderAccountUnauthorized) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderAccountForbidden creates a GetRenderAccountForbidden with default headers values +func NewGetRenderAccountForbidden() *GetRenderAccountForbidden { + return &GetRenderAccountForbidden{} +} + +/*GetRenderAccountForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRenderAccountForbidden struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderAccountForbidden) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getRenderAccountForbidden %+v", 403, o.Payload) +} + +func (o *GetRenderAccountForbidden) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderAccountNotFound creates a GetRenderAccountNotFound with default headers values +func NewGetRenderAccountNotFound() *GetRenderAccountNotFound { + return &GetRenderAccountNotFound{} +} + +/*GetRenderAccountNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRenderAccountNotFound struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderAccountNotFound) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getRenderAccountNotFound %+v", 404, o.Payload) +} + +func (o *GetRenderAccountNotFound) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderAccountUnprocessableEntity creates a GetRenderAccountUnprocessableEntity with default headers values +func NewGetRenderAccountUnprocessableEntity() *GetRenderAccountUnprocessableEntity { + return &GetRenderAccountUnprocessableEntity{} +} + +/*GetRenderAccountUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRenderAccountUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderAccountUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getRenderAccountUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRenderAccountUnprocessableEntity) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderAccountUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderAccountInternalServerError creates a GetRenderAccountInternalServerError with default headers values +func NewGetRenderAccountInternalServerError() *GetRenderAccountInternalServerError { + return &GetRenderAccountInternalServerError{} +} + +/*GetRenderAccountInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRenderAccountInternalServerError struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderAccountInternalServerError) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getRenderAccountInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRenderAccountInternalServerError) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_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/render/render_client/cors/account_options_parameters.go b/api/render/render_client/cors/account_options_parameters.go new file mode 100644 index 0000000..6f6c9df --- /dev/null +++ b/api/render/render_client/cors/account_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewAccountOptionsParams() *AccountOptionsParams { + + return &AccountOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAccountOptionsParamsWithTimeout creates a new AccountOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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/render/render_client/cors/account_options_responses.go b/api/render/render_client/cors/account_options_responses.go new file mode 100644 index 0000000..8bfabd3 --- /dev/null +++ b/api/render/render_client/cors/account_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewAccountOptionsOK creates a AccountOptionsOK with default headers values +func NewAccountOptionsOK() *AccountOptionsOK { + return &AccountOptionsOK{} +} + +/*AccountOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/render/render_client/cors/cors_client.go b/api/render/render_client/cors/cors_client.go new file mode 100644 index 0000000..f737a19 --- /dev/null +++ b/api/render/render_client/cors/cors_client.go @@ -0,0 +1,256 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error) + + CountyOptions(params *CountyOptionsParams) (*CountyOptionsOK, error) + + IngestOptions(params *IngestOptionsParams) (*IngestOptionsOK, error) + + InvoiceOptions(params *InvoiceOptionsParams) (*InvoiceOptionsOK, error) + + ReportOptions(params *ReportOptionsParams) (*ReportOptionsOK, error) + + TaxOptions(params *TaxOptionsParams) (*TaxOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AccountOptions CORS support +*/ +func (a *Client) AccountOptions(params *AccountOptionsParams) (*AccountOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAccountOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + CountyOptions CORS support +*/ +func (a *Client) CountyOptions(params *CountyOptionsParams) (*CountyOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCountyOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "countyOptions", + Method: "OPTIONS", + PathPattern: "/counties", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CountyOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CountyOptionsOK) + 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 countyOptions: 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) (*IngestOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ingestOptions", + Method: "OPTIONS", + PathPattern: "/ingests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IngestOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + 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) +} + +/* + InvoiceOptions CORS support +*/ +func (a *Client) InvoiceOptions(params *InvoiceOptionsParams) (*InvoiceOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewInvoiceOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "invoiceOptions", + Method: "OPTIONS", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &InvoiceOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*InvoiceOptionsOK) + 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 invoiceOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ReportOptions CORS support +*/ +func (a *Client) ReportOptions(params *ReportOptionsParams) (*ReportOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReportOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "reportOptions", + Method: "OPTIONS", + PathPattern: "/reports", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ReportOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ReportOptionsOK) + 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 reportOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TaxOptions CORS support +*/ +func (a *Client) TaxOptions(params *TaxOptionsParams) (*TaxOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaxOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "taxOptions", + Method: "OPTIONS", + PathPattern: "/taxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaxOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaxOptionsOK) + 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 taxOptions: 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/render/render_client/cors/county_options_parameters.go b/api/render/render_client/cors/county_options_parameters.go new file mode 100644 index 0000000..13bbbe1 --- /dev/null +++ b/api/render/render_client/cors/county_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewCountyOptionsParams creates a new CountyOptionsParams object +// with the default values initialized. +func NewCountyOptionsParams() *CountyOptionsParams { + + return &CountyOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCountyOptionsParamsWithTimeout creates a new CountyOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCountyOptionsParamsWithTimeout(timeout time.Duration) *CountyOptionsParams { + + return &CountyOptionsParams{ + + timeout: timeout, + } +} + +// NewCountyOptionsParamsWithContext creates a new CountyOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewCountyOptionsParamsWithContext(ctx context.Context) *CountyOptionsParams { + + return &CountyOptionsParams{ + + Context: ctx, + } +} + +// NewCountyOptionsParamsWithHTTPClient creates a new CountyOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCountyOptionsParamsWithHTTPClient(client *http.Client) *CountyOptionsParams { + + return &CountyOptionsParams{ + HTTPClient: client, + } +} + +/*CountyOptionsParams contains all the parameters to send to the API endpoint +for the county options operation typically these are written to a http.Request +*/ +type CountyOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the county options params +func (o *CountyOptionsParams) WithTimeout(timeout time.Duration) *CountyOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the county options params +func (o *CountyOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the county options params +func (o *CountyOptionsParams) WithContext(ctx context.Context) *CountyOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the county options params +func (o *CountyOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the county options params +func (o *CountyOptionsParams) WithHTTPClient(client *http.Client) *CountyOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the county options params +func (o *CountyOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CountyOptionsParams) 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/render/render_client/cors/county_options_responses.go b/api/render/render_client/cors/county_options_responses.go new file mode 100644 index 0000000..05e240b --- /dev/null +++ b/api/render/render_client/cors/county_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// CountyOptionsReader is a Reader for the CountyOptions structure. +type CountyOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CountyOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCountyOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewCountyOptionsOK creates a CountyOptionsOK with default headers values +func NewCountyOptionsOK() *CountyOptionsOK { + return &CountyOptionsOK{} +} + +/*CountyOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type CountyOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *CountyOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /counties][%d] countyOptionsOK ", 200) +} + +func (o *CountyOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/render/render_client/cors/ingest_options_parameters.go b/api/render/render_client/cors/ingest_options_parameters.go new file mode 100644 index 0000000..9052205 --- /dev/null +++ b/api/render/render_client/cors/ingest_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewIngestOptionsParams() *IngestOptionsParams { + + return &IngestOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIngestOptionsParamsWithTimeout creates a new IngestOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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/render/render_client/cors/ingest_options_responses.go b/api/render/render_client/cors/ingest_options_responses.go new file mode 100644 index 0000000..4f273a1 --- /dev/null +++ b/api/render/render_client/cors/ingest_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewIngestOptionsOK creates a IngestOptionsOK with default headers values +func NewIngestOptionsOK() *IngestOptionsOK { + return &IngestOptionsOK{} +} + +/*IngestOptionsOK handles this case 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][%d] ingestOptionsOK ", 200) +} + +func (o *IngestOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/render/render_client/cors/invoice_options_parameters.go b/api/render/render_client/cors/invoice_options_parameters.go new file mode 100644 index 0000000..072dfad --- /dev/null +++ b/api/render/render_client/cors/invoice_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewInvoiceOptionsParams creates a new InvoiceOptionsParams object +// with the default values initialized. +func NewInvoiceOptionsParams() *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewInvoiceOptionsParamsWithTimeout creates a new InvoiceOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewInvoiceOptionsParamsWithTimeout(timeout time.Duration) *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + + timeout: timeout, + } +} + +// NewInvoiceOptionsParamsWithContext creates a new InvoiceOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewInvoiceOptionsParamsWithContext(ctx context.Context) *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + + Context: ctx, + } +} + +// NewInvoiceOptionsParamsWithHTTPClient creates a new InvoiceOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewInvoiceOptionsParamsWithHTTPClient(client *http.Client) *InvoiceOptionsParams { + + return &InvoiceOptionsParams{ + HTTPClient: client, + } +} + +/*InvoiceOptionsParams contains all the parameters to send to the API endpoint +for the invoice options operation typically these are written to a http.Request +*/ +type InvoiceOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the invoice options params +func (o *InvoiceOptionsParams) WithTimeout(timeout time.Duration) *InvoiceOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the invoice options params +func (o *InvoiceOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the invoice options params +func (o *InvoiceOptionsParams) WithContext(ctx context.Context) *InvoiceOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the invoice options params +func (o *InvoiceOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the invoice options params +func (o *InvoiceOptionsParams) WithHTTPClient(client *http.Client) *InvoiceOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the invoice options params +func (o *InvoiceOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *InvoiceOptionsParams) 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/render/render_client/cors/invoice_options_responses.go b/api/render/render_client/cors/invoice_options_responses.go new file mode 100644 index 0000000..42563f1 --- /dev/null +++ b/api/render/render_client/cors/invoice_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// InvoiceOptionsReader is a Reader for the InvoiceOptions structure. +type InvoiceOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InvoiceOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewInvoiceOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewInvoiceOptionsOK creates a InvoiceOptionsOK with default headers values +func NewInvoiceOptionsOK() *InvoiceOptionsOK { + return &InvoiceOptionsOK{} +} + +/*InvoiceOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type InvoiceOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *InvoiceOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /invoices][%d] invoiceOptionsOK ", 200) +} + +func (o *InvoiceOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/render/render_client/cors/report_options_parameters.go b/api/render/render_client/cors/report_options_parameters.go new file mode 100644 index 0000000..e27ba10 --- /dev/null +++ b/api/render/render_client/cors/report_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewReportOptionsParams creates a new ReportOptionsParams object +// with the default values initialized. +func NewReportOptionsParams() *ReportOptionsParams { + + return &ReportOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewReportOptionsParamsWithTimeout creates a new ReportOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewReportOptionsParamsWithTimeout(timeout time.Duration) *ReportOptionsParams { + + return &ReportOptionsParams{ + + timeout: timeout, + } +} + +// NewReportOptionsParamsWithContext creates a new ReportOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewReportOptionsParamsWithContext(ctx context.Context) *ReportOptionsParams { + + return &ReportOptionsParams{ + + Context: ctx, + } +} + +// NewReportOptionsParamsWithHTTPClient creates a new ReportOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewReportOptionsParamsWithHTTPClient(client *http.Client) *ReportOptionsParams { + + return &ReportOptionsParams{ + HTTPClient: client, + } +} + +/*ReportOptionsParams contains all the parameters to send to the API endpoint +for the report options operation typically these are written to a http.Request +*/ +type ReportOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the report options params +func (o *ReportOptionsParams) WithTimeout(timeout time.Duration) *ReportOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the report options params +func (o *ReportOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the report options params +func (o *ReportOptionsParams) WithContext(ctx context.Context) *ReportOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the report options params +func (o *ReportOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the report options params +func (o *ReportOptionsParams) WithHTTPClient(client *http.Client) *ReportOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the report options params +func (o *ReportOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ReportOptionsParams) 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/render/render_client/cors/report_options_responses.go b/api/render/render_client/cors/report_options_responses.go new file mode 100644 index 0000000..d2114a8 --- /dev/null +++ b/api/render/render_client/cors/report_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// ReportOptionsReader is a Reader for the ReportOptions structure. +type ReportOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReportOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReportOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewReportOptionsOK creates a ReportOptionsOK with default headers values +func NewReportOptionsOK() *ReportOptionsOK { + return &ReportOptionsOK{} +} + +/*ReportOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type ReportOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *ReportOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /reports][%d] reportOptionsOK ", 200) +} + +func (o *ReportOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/render/render_client/cors/tax_options_parameters.go b/api/render/render_client/cors/tax_options_parameters.go new file mode 100644 index 0000000..c20cb4b --- /dev/null +++ b/api/render/render_client/cors/tax_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewTaxOptionsParams creates a new TaxOptionsParams object +// with the default values initialized. +func NewTaxOptionsParams() *TaxOptionsParams { + + return &TaxOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaxOptionsParamsWithTimeout creates a new TaxOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaxOptionsParamsWithTimeout(timeout time.Duration) *TaxOptionsParams { + + return &TaxOptionsParams{ + + timeout: timeout, + } +} + +// NewTaxOptionsParamsWithContext creates a new TaxOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaxOptionsParamsWithContext(ctx context.Context) *TaxOptionsParams { + + return &TaxOptionsParams{ + + Context: ctx, + } +} + +// NewTaxOptionsParamsWithHTTPClient creates a new TaxOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaxOptionsParamsWithHTTPClient(client *http.Client) *TaxOptionsParams { + + return &TaxOptionsParams{ + HTTPClient: client, + } +} + +/*TaxOptionsParams contains all the parameters to send to the API endpoint +for the tax options operation typically these are written to a http.Request +*/ +type TaxOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tax options params +func (o *TaxOptionsParams) WithTimeout(timeout time.Duration) *TaxOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tax options params +func (o *TaxOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tax options params +func (o *TaxOptionsParams) WithContext(ctx context.Context) *TaxOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tax options params +func (o *TaxOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tax options params +func (o *TaxOptionsParams) WithHTTPClient(client *http.Client) *TaxOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tax options params +func (o *TaxOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaxOptionsParams) 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/render/render_client/cors/tax_options_responses.go b/api/render/render_client/cors/tax_options_responses.go new file mode 100644 index 0000000..3d06450 --- /dev/null +++ b/api/render/render_client/cors/tax_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// TaxOptionsReader is a Reader for the TaxOptions structure. +type TaxOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaxOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaxOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTaxOptionsOK creates a TaxOptionsOK with default headers values +func NewTaxOptionsOK() *TaxOptionsOK { + return &TaxOptionsOK{} +} + +/*TaxOptionsOK handles this case with default header values. + +CORS OPTIONS response +*/ +type TaxOptionsOK struct { + AccessControlAllowCredentials string + + AccessControlAllowHeaders string + + AccessControlAllowMethods string + + AccessControlAllowOrigin string + + AccessControlExposeHeaders string + + AccessControlMaxAge string + + CacheControl string +} + +func (o *TaxOptionsOK) Error() string { + return fmt.Sprintf("[OPTIONS /taxes][%d] taxOptionsOK ", 200) +} + +func (o *TaxOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + return nil +} diff --git a/api/render/render_client/county/county_client.go b/api/render/render_client/county/county_client.go new file mode 100644 index 0000000..65549d0 --- /dev/null +++ b/api/render/render_client/county/county_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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 county API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for county API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRenderCounty(params *GetRenderCountyParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderCountyOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRenderCounty generates p d f from a county ID + + Generate a County Report PDF +*/ +func (a *Client) GetRenderCounty(params *GetRenderCountyParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderCountyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRenderCountyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRenderCounty", + Method: "GET", + PathPattern: "/counties", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRenderCountyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRenderCountyOK) + 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 getRenderCounty: 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/render/render_client/county/get_render_county_parameters.go b/api/render/render_client/county/get_render_county_parameters.go new file mode 100644 index 0000000..d0fabff --- /dev/null +++ b/api/render/render_client/county/get_render_county_parameters.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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" +) + +// NewGetRenderCountyParams creates a new GetRenderCountyParams object +// with the default values initialized. +func NewGetRenderCountyParams() *GetRenderCountyParams { + var () + return &GetRenderCountyParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRenderCountyParamsWithTimeout creates a new GetRenderCountyParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRenderCountyParamsWithTimeout(timeout time.Duration) *GetRenderCountyParams { + var () + return &GetRenderCountyParams{ + + timeout: timeout, + } +} + +// NewGetRenderCountyParamsWithContext creates a new GetRenderCountyParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRenderCountyParamsWithContext(ctx context.Context) *GetRenderCountyParams { + var () + return &GetRenderCountyParams{ + + Context: ctx, + } +} + +// NewGetRenderCountyParamsWithHTTPClient creates a new GetRenderCountyParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRenderCountyParamsWithHTTPClient(client *http.Client) *GetRenderCountyParams { + var () + return &GetRenderCountyParams{ + HTTPClient: client, + } +} + +/*GetRenderCountyParams contains all the parameters to send to the API endpoint +for the get render county operation typically these are written to a http.Request +*/ +type GetRenderCountyParams struct { + + /*CountyID + The County ID + + */ + CountyID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get render county params +func (o *GetRenderCountyParams) WithTimeout(timeout time.Duration) *GetRenderCountyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get render county params +func (o *GetRenderCountyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get render county params +func (o *GetRenderCountyParams) WithContext(ctx context.Context) *GetRenderCountyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get render county params +func (o *GetRenderCountyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get render county params +func (o *GetRenderCountyParams) WithHTTPClient(client *http.Client) *GetRenderCountyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get render county params +func (o *GetRenderCountyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountyID adds the countyID to the get render county params +func (o *GetRenderCountyParams) WithCountyID(countyID string) *GetRenderCountyParams { + o.SetCountyID(countyID) + return o +} + +// SetCountyID adds the countyId to the get render county params +func (o *GetRenderCountyParams) SetCountyID(countyID string) { + o.CountyID = countyID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRenderCountyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param countyId + qrCountyID := o.CountyID + qCountyID := qrCountyID + if qCountyID != "" { + if err := r.SetQueryParam("countyId", qCountyID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/render/render_client/county/get_render_county_responses.go b/api/render/render_client/county/get_render_county_responses.go new file mode 100644 index 0000000..7ef7eed --- /dev/null +++ b/api/render/render_client/county/get_render_county_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package county + +// 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" + + "github.com/taxnexus/go/lib/api/render/render_models" +) + +// GetRenderCountyReader is a Reader for the GetRenderCounty structure. +type GetRenderCountyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRenderCountyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRenderCountyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRenderCountyUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRenderCountyForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRenderCountyNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRenderCountyUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRenderCountyInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRenderCountyOK creates a GetRenderCountyOK with default headers values +func NewGetRenderCountyOK() *GetRenderCountyOK { + return &GetRenderCountyOK{} +} + +/*GetRenderCountyOK handles this case with default header values. + +Rendered documents response +*/ +type GetRenderCountyOK struct { + AccessControlAllowOrigin string + + Payload *render_models.DocumentResponse +} + +func (o *GetRenderCountyOK) Error() string { + return fmt.Sprintf("[GET /counties][%d] getRenderCountyOK %+v", 200, o.Payload) +} + +func (o *GetRenderCountyOK) GetPayload() *render_models.DocumentResponse { + return o.Payload +} + +func (o *GetRenderCountyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderCountyUnauthorized creates a GetRenderCountyUnauthorized with default headers values +func NewGetRenderCountyUnauthorized() *GetRenderCountyUnauthorized { + return &GetRenderCountyUnauthorized{} +} + +/*GetRenderCountyUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRenderCountyUnauthorized struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderCountyUnauthorized) Error() string { + return fmt.Sprintf("[GET /counties][%d] getRenderCountyUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRenderCountyUnauthorized) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderCountyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderCountyForbidden creates a GetRenderCountyForbidden with default headers values +func NewGetRenderCountyForbidden() *GetRenderCountyForbidden { + return &GetRenderCountyForbidden{} +} + +/*GetRenderCountyForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRenderCountyForbidden struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderCountyForbidden) Error() string { + return fmt.Sprintf("[GET /counties][%d] getRenderCountyForbidden %+v", 403, o.Payload) +} + +func (o *GetRenderCountyForbidden) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderCountyForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderCountyNotFound creates a GetRenderCountyNotFound with default headers values +func NewGetRenderCountyNotFound() *GetRenderCountyNotFound { + return &GetRenderCountyNotFound{} +} + +/*GetRenderCountyNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRenderCountyNotFound struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderCountyNotFound) Error() string { + return fmt.Sprintf("[GET /counties][%d] getRenderCountyNotFound %+v", 404, o.Payload) +} + +func (o *GetRenderCountyNotFound) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderCountyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderCountyUnprocessableEntity creates a GetRenderCountyUnprocessableEntity with default headers values +func NewGetRenderCountyUnprocessableEntity() *GetRenderCountyUnprocessableEntity { + return &GetRenderCountyUnprocessableEntity{} +} + +/*GetRenderCountyUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRenderCountyUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderCountyUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /counties][%d] getRenderCountyUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRenderCountyUnprocessableEntity) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderCountyUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderCountyInternalServerError creates a GetRenderCountyInternalServerError with default headers values +func NewGetRenderCountyInternalServerError() *GetRenderCountyInternalServerError { + return &GetRenderCountyInternalServerError{} +} + +/*GetRenderCountyInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRenderCountyInternalServerError struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderCountyInternalServerError) Error() string { + return fmt.Sprintf("[GET /counties][%d] getRenderCountyInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRenderCountyInternalServerError) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderCountyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_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/render/render_client/ingest/get_render_ingests_parameters.go b/api/render/render_client/ingest/get_render_ingests_parameters.go new file mode 100644 index 0000000..5930276 --- /dev/null +++ b/api/render/render_client/ingest/get_render_ingests_parameters.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetRenderIngestsParams creates a new GetRenderIngestsParams object +// with the default values initialized. +func NewGetRenderIngestsParams() *GetRenderIngestsParams { + var () + return &GetRenderIngestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRenderIngestsParamsWithTimeout creates a new GetRenderIngestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRenderIngestsParamsWithTimeout(timeout time.Duration) *GetRenderIngestsParams { + var () + return &GetRenderIngestsParams{ + + timeout: timeout, + } +} + +// NewGetRenderIngestsParamsWithContext creates a new GetRenderIngestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRenderIngestsParamsWithContext(ctx context.Context) *GetRenderIngestsParams { + var () + return &GetRenderIngestsParams{ + + Context: ctx, + } +} + +// NewGetRenderIngestsParamsWithHTTPClient creates a new GetRenderIngestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRenderIngestsParamsWithHTTPClient(client *http.Client) *GetRenderIngestsParams { + var () + return &GetRenderIngestsParams{ + HTTPClient: client, + } +} + +/*GetRenderIngestsParams contains all the parameters to send to the API endpoint +for the get render ingests operation typically these are written to a http.Request +*/ +type GetRenderIngestsParams struct { + + /*IngestID + Taxnexus Id of the Invoice to be retrieved + + */ + IngestID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get render ingests params +func (o *GetRenderIngestsParams) WithTimeout(timeout time.Duration) *GetRenderIngestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get render ingests params +func (o *GetRenderIngestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get render ingests params +func (o *GetRenderIngestsParams) WithContext(ctx context.Context) *GetRenderIngestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get render ingests params +func (o *GetRenderIngestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get render ingests params +func (o *GetRenderIngestsParams) WithHTTPClient(client *http.Client) *GetRenderIngestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get render ingests params +func (o *GetRenderIngestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIngestID adds the ingestID to the get render ingests params +func (o *GetRenderIngestsParams) WithIngestID(ingestID string) *GetRenderIngestsParams { + o.SetIngestID(ingestID) + return o +} + +// SetIngestID adds the ingestId to the get render ingests params +func (o *GetRenderIngestsParams) SetIngestID(ingestID string) { + o.IngestID = ingestID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRenderIngestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param ingestId + qrIngestID := o.IngestID + qIngestID := qrIngestID + if qIngestID != "" { + if err := r.SetQueryParam("ingestId", qIngestID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/render/render_client/ingest/get_render_ingests_responses.go b/api/render/render_client/ingest/get_render_ingests_responses.go new file mode 100644 index 0000000..0eedf47 --- /dev/null +++ b/api/render/render_client/ingest/get_render_ingests_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/render/render_models" +) + +// GetRenderIngestsReader is a Reader for the GetRenderIngests structure. +type GetRenderIngestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRenderIngestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRenderIngestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRenderIngestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRenderIngestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRenderIngestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRenderIngestsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRenderIngestsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRenderIngestsOK creates a GetRenderIngestsOK with default headers values +func NewGetRenderIngestsOK() *GetRenderIngestsOK { + return &GetRenderIngestsOK{} +} + +/*GetRenderIngestsOK handles this case with default header values. + +Rendered documents response +*/ +type GetRenderIngestsOK struct { + AccessControlAllowOrigin string + + Payload *render_models.DocumentResponse +} + +func (o *GetRenderIngestsOK) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getRenderIngestsOK %+v", 200, o.Payload) +} + +func (o *GetRenderIngestsOK) GetPayload() *render_models.DocumentResponse { + return o.Payload +} + +func (o *GetRenderIngestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderIngestsUnauthorized creates a GetRenderIngestsUnauthorized with default headers values +func NewGetRenderIngestsUnauthorized() *GetRenderIngestsUnauthorized { + return &GetRenderIngestsUnauthorized{} +} + +/*GetRenderIngestsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRenderIngestsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderIngestsUnauthorized) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getRenderIngestsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRenderIngestsUnauthorized) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderIngestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderIngestsForbidden creates a GetRenderIngestsForbidden with default headers values +func NewGetRenderIngestsForbidden() *GetRenderIngestsForbidden { + return &GetRenderIngestsForbidden{} +} + +/*GetRenderIngestsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRenderIngestsForbidden struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderIngestsForbidden) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getRenderIngestsForbidden %+v", 403, o.Payload) +} + +func (o *GetRenderIngestsForbidden) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderIngestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderIngestsNotFound creates a GetRenderIngestsNotFound with default headers values +func NewGetRenderIngestsNotFound() *GetRenderIngestsNotFound { + return &GetRenderIngestsNotFound{} +} + +/*GetRenderIngestsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRenderIngestsNotFound struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderIngestsNotFound) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getRenderIngestsNotFound %+v", 404, o.Payload) +} + +func (o *GetRenderIngestsNotFound) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderIngestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderIngestsUnprocessableEntity creates a GetRenderIngestsUnprocessableEntity with default headers values +func NewGetRenderIngestsUnprocessableEntity() *GetRenderIngestsUnprocessableEntity { + return &GetRenderIngestsUnprocessableEntity{} +} + +/*GetRenderIngestsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRenderIngestsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderIngestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getRenderIngestsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRenderIngestsUnprocessableEntity) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderIngestsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderIngestsInternalServerError creates a GetRenderIngestsInternalServerError with default headers values +func NewGetRenderIngestsInternalServerError() *GetRenderIngestsInternalServerError { + return &GetRenderIngestsInternalServerError{} +} + +/*GetRenderIngestsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRenderIngestsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderIngestsInternalServerError) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getRenderIngestsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRenderIngestsInternalServerError) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderIngestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_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/render/render_client/ingest/ingest_client.go b/api/render/render_client/ingest/ingest_client.go new file mode 100644 index 0000000..0553690 --- /dev/null +++ b/api/render/render_client/ingest/ingest_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRenderIngests(params *GetRenderIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderIngestsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRenderIngests generates p d f from an ingest ID + + Generate PDF from a Ingest ID +*/ +func (a *Client) GetRenderIngests(params *GetRenderIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRenderIngestsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRenderIngests", + Method: "GET", + PathPattern: "/ingests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRenderIngestsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRenderIngestsOK) + 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 getRenderIngests: 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/render/render_client/invoice/get_render_invoice_parameters.go b/api/render/render_client/invoice/get_render_invoice_parameters.go new file mode 100644 index 0000000..5cdffd8 --- /dev/null +++ b/api/render/render_client/invoice/get_render_invoice_parameters.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" +) + +// NewGetRenderInvoiceParams creates a new GetRenderInvoiceParams object +// with the default values initialized. +func NewGetRenderInvoiceParams() *GetRenderInvoiceParams { + var () + return &GetRenderInvoiceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRenderInvoiceParamsWithTimeout creates a new GetRenderInvoiceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRenderInvoiceParamsWithTimeout(timeout time.Duration) *GetRenderInvoiceParams { + var () + return &GetRenderInvoiceParams{ + + timeout: timeout, + } +} + +// NewGetRenderInvoiceParamsWithContext creates a new GetRenderInvoiceParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRenderInvoiceParamsWithContext(ctx context.Context) *GetRenderInvoiceParams { + var () + return &GetRenderInvoiceParams{ + + Context: ctx, + } +} + +// NewGetRenderInvoiceParamsWithHTTPClient creates a new GetRenderInvoiceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRenderInvoiceParamsWithHTTPClient(client *http.Client) *GetRenderInvoiceParams { + var () + return &GetRenderInvoiceParams{ + HTTPClient: client, + } +} + +/*GetRenderInvoiceParams contains all the parameters to send to the API endpoint +for the get render invoice operation typically these are written to a http.Request +*/ +type GetRenderInvoiceParams struct { + + /*InvoiceID + Taxnexus Id of the Invoice to be retrieved + + */ + InvoiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get render invoice params +func (o *GetRenderInvoiceParams) WithTimeout(timeout time.Duration) *GetRenderInvoiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get render invoice params +func (o *GetRenderInvoiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get render invoice params +func (o *GetRenderInvoiceParams) WithContext(ctx context.Context) *GetRenderInvoiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get render invoice params +func (o *GetRenderInvoiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get render invoice params +func (o *GetRenderInvoiceParams) WithHTTPClient(client *http.Client) *GetRenderInvoiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get render invoice params +func (o *GetRenderInvoiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceID adds the invoiceID to the get render invoice params +func (o *GetRenderInvoiceParams) WithInvoiceID(invoiceID string) *GetRenderInvoiceParams { + o.SetInvoiceID(invoiceID) + return o +} + +// SetInvoiceID adds the invoiceId to the get render invoice params +func (o *GetRenderInvoiceParams) SetInvoiceID(invoiceID string) { + o.InvoiceID = invoiceID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRenderInvoiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param invoiceId + qrInvoiceID := o.InvoiceID + qInvoiceID := qrInvoiceID + if qInvoiceID != "" { + if err := r.SetQueryParam("invoiceId", qInvoiceID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/render/render_client/invoice/get_render_invoice_responses.go b/api/render/render_client/invoice/get_render_invoice_responses.go new file mode 100644 index 0000000..fb277fc --- /dev/null +++ b/api/render/render_client/invoice/get_render_invoice_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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" + + "github.com/taxnexus/go/lib/api/render/render_models" +) + +// GetRenderInvoiceReader is a Reader for the GetRenderInvoice structure. +type GetRenderInvoiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRenderInvoiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRenderInvoiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRenderInvoiceUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRenderInvoiceForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRenderInvoiceNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRenderInvoiceUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRenderInvoiceInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRenderInvoiceOK creates a GetRenderInvoiceOK with default headers values +func NewGetRenderInvoiceOK() *GetRenderInvoiceOK { + return &GetRenderInvoiceOK{} +} + +/*GetRenderInvoiceOK handles this case with default header values. + +Rendered documents response +*/ +type GetRenderInvoiceOK struct { + AccessControlAllowOrigin string + + Payload *render_models.DocumentResponse +} + +func (o *GetRenderInvoiceOK) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getRenderInvoiceOK %+v", 200, o.Payload) +} + +func (o *GetRenderInvoiceOK) GetPayload() *render_models.DocumentResponse { + return o.Payload +} + +func (o *GetRenderInvoiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderInvoiceUnauthorized creates a GetRenderInvoiceUnauthorized with default headers values +func NewGetRenderInvoiceUnauthorized() *GetRenderInvoiceUnauthorized { + return &GetRenderInvoiceUnauthorized{} +} + +/*GetRenderInvoiceUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRenderInvoiceUnauthorized struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderInvoiceUnauthorized) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getRenderInvoiceUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRenderInvoiceUnauthorized) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderInvoiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderInvoiceForbidden creates a GetRenderInvoiceForbidden with default headers values +func NewGetRenderInvoiceForbidden() *GetRenderInvoiceForbidden { + return &GetRenderInvoiceForbidden{} +} + +/*GetRenderInvoiceForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRenderInvoiceForbidden struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderInvoiceForbidden) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getRenderInvoiceForbidden %+v", 403, o.Payload) +} + +func (o *GetRenderInvoiceForbidden) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderInvoiceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderInvoiceNotFound creates a GetRenderInvoiceNotFound with default headers values +func NewGetRenderInvoiceNotFound() *GetRenderInvoiceNotFound { + return &GetRenderInvoiceNotFound{} +} + +/*GetRenderInvoiceNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRenderInvoiceNotFound struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderInvoiceNotFound) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getRenderInvoiceNotFound %+v", 404, o.Payload) +} + +func (o *GetRenderInvoiceNotFound) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderInvoiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderInvoiceUnprocessableEntity creates a GetRenderInvoiceUnprocessableEntity with default headers values +func NewGetRenderInvoiceUnprocessableEntity() *GetRenderInvoiceUnprocessableEntity { + return &GetRenderInvoiceUnprocessableEntity{} +} + +/*GetRenderInvoiceUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRenderInvoiceUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderInvoiceUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getRenderInvoiceUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRenderInvoiceUnprocessableEntity) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderInvoiceUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderInvoiceInternalServerError creates a GetRenderInvoiceInternalServerError with default headers values +func NewGetRenderInvoiceInternalServerError() *GetRenderInvoiceInternalServerError { + return &GetRenderInvoiceInternalServerError{} +} + +/*GetRenderInvoiceInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRenderInvoiceInternalServerError struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderInvoiceInternalServerError) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getRenderInvoiceInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRenderInvoiceInternalServerError) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderInvoiceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_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/render/render_client/invoice/invoice_client.go b/api/render/render_client/invoice/invoice_client.go new file mode 100644 index 0000000..ccc9b71 --- /dev/null +++ b/api/render/render_client/invoice/invoice_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoice + +// 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 invoice API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for invoice API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRenderInvoice(params *GetRenderInvoiceParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderInvoiceOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRenderInvoice generates p d f from an invoice ID + + Generate PDF from an Invoice ID +*/ +func (a *Client) GetRenderInvoice(params *GetRenderInvoiceParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderInvoiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRenderInvoiceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRenderInvoice", + Method: "GET", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRenderInvoiceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRenderInvoiceOK) + 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 getRenderInvoice: 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/render/render_client/render_client.go b/api/render/render_client/render_client.go new file mode 100644 index 0000000..d198afe --- /dev/null +++ b/api/render/render_client/render_client.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package render_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" + + "github.com/taxnexus/go/lib/api/render/render_client/account" + "github.com/taxnexus/go/lib/api/render/render_client/cors" + "github.com/taxnexus/go/lib/api/render/render_client/county" + "github.com/taxnexus/go/lib/api/render/render_client/ingest" + "github.com/taxnexus/go/lib/api/render/render_client/invoice" + "github.com/taxnexus/go/lib/api/render/render_client/report" + "github.com/taxnexus/go/lib/api/render/render_client/tax" +) + +// Default render HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "render.fabric.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 render HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Render { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new render HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Render { + // 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 render client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Render { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Render) + cli.Transport = transport + cli.Account = account.New(transport, formats) + cli.Cors = cors.New(transport, formats) + cli.County = county.New(transport, formats) + cli.Ingest = ingest.New(transport, formats) + cli.Invoice = invoice.New(transport, formats) + cli.Report = report.New(transport, formats) + cli.Tax = tax.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 +} + +// Render is a client for render +type Render struct { + Account account.ClientService + + Cors cors.ClientService + + County county.ClientService + + Ingest ingest.ClientService + + Invoice invoice.ClientService + + Report report.ClientService + + Tax tax.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Render) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Account.SetTransport(transport) + c.Cors.SetTransport(transport) + c.County.SetTransport(transport) + c.Ingest.SetTransport(transport) + c.Invoice.SetTransport(transport) + c.Report.SetTransport(transport) + c.Tax.SetTransport(transport) +} diff --git a/api/render/render_client/report/get_render_reports_parameters.go b/api/render/render_client/report/get_render_reports_parameters.go new file mode 100644 index 0000000..3626a6c --- /dev/null +++ b/api/render/render_client/report/get_render_reports_parameters.go @@ -0,0 +1,240 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package report + +// 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" +) + +// NewGetRenderReportsParams creates a new GetRenderReportsParams object +// with the default values initialized. +func NewGetRenderReportsParams() *GetRenderReportsParams { + var () + return &GetRenderReportsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRenderReportsParamsWithTimeout creates a new GetRenderReportsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRenderReportsParamsWithTimeout(timeout time.Duration) *GetRenderReportsParams { + var () + return &GetRenderReportsParams{ + + timeout: timeout, + } +} + +// NewGetRenderReportsParamsWithContext creates a new GetRenderReportsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRenderReportsParamsWithContext(ctx context.Context) *GetRenderReportsParams { + var () + return &GetRenderReportsParams{ + + Context: ctx, + } +} + +// NewGetRenderReportsParamsWithHTTPClient creates a new GetRenderReportsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRenderReportsParamsWithHTTPClient(client *http.Client) *GetRenderReportsParams { + var () + return &GetRenderReportsParams{ + HTTPClient: client, + } +} + +/*GetRenderReportsParams contains all the parameters to send to the API endpoint +for the get render reports operation typically these are written to a http.Request +*/ +type GetRenderReportsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get render reports params +func (o *GetRenderReportsParams) WithTimeout(timeout time.Duration) *GetRenderReportsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get render reports params +func (o *GetRenderReportsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get render reports params +func (o *GetRenderReportsParams) WithContext(ctx context.Context) *GetRenderReportsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get render reports params +func (o *GetRenderReportsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get render reports params +func (o *GetRenderReportsParams) WithHTTPClient(client *http.Client) *GetRenderReportsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get render reports params +func (o *GetRenderReportsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get render reports params +func (o *GetRenderReportsParams) WithAccountID(accountID string) *GetRenderReportsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get render reports params +func (o *GetRenderReportsParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get render reports params +func (o *GetRenderReportsParams) WithMonth(month *int64) *GetRenderReportsParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get render reports params +func (o *GetRenderReportsParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get render reports params +func (o *GetRenderReportsParams) WithQuarter(quarter *int64) *GetRenderReportsParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get render reports params +func (o *GetRenderReportsParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithYear adds the year to the get render reports params +func (o *GetRenderReportsParams) WithYear(year *int64) *GetRenderReportsParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get render reports params +func (o *GetRenderReportsParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRenderReportsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param accountId + qrAccountID := o.AccountID + qAccountID := qrAccountID + if qAccountID != "" { + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + + if o.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/render/render_client/report/get_render_reports_responses.go b/api/render/render_client/report/get_render_reports_responses.go new file mode 100644 index 0000000..f922b09 --- /dev/null +++ b/api/render/render_client/report/get_render_reports_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package report + +// 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" + + "github.com/taxnexus/go/lib/api/render/render_models" +) + +// GetRenderReportsReader is a Reader for the GetRenderReports structure. +type GetRenderReportsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRenderReportsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRenderReportsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRenderReportsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRenderReportsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRenderReportsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRenderReportsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRenderReportsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRenderReportsOK creates a GetRenderReportsOK with default headers values +func NewGetRenderReportsOK() *GetRenderReportsOK { + return &GetRenderReportsOK{} +} + +/*GetRenderReportsOK handles this case with default header values. + +Rendered documents response +*/ +type GetRenderReportsOK struct { + AccessControlAllowOrigin string + + Payload *render_models.DocumentResponse +} + +func (o *GetRenderReportsOK) Error() string { + return fmt.Sprintf("[GET /reports][%d] getRenderReportsOK %+v", 200, o.Payload) +} + +func (o *GetRenderReportsOK) GetPayload() *render_models.DocumentResponse { + return o.Payload +} + +func (o *GetRenderReportsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderReportsUnauthorized creates a GetRenderReportsUnauthorized with default headers values +func NewGetRenderReportsUnauthorized() *GetRenderReportsUnauthorized { + return &GetRenderReportsUnauthorized{} +} + +/*GetRenderReportsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRenderReportsUnauthorized struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderReportsUnauthorized) Error() string { + return fmt.Sprintf("[GET /reports][%d] getRenderReportsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRenderReportsUnauthorized) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderReportsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderReportsForbidden creates a GetRenderReportsForbidden with default headers values +func NewGetRenderReportsForbidden() *GetRenderReportsForbidden { + return &GetRenderReportsForbidden{} +} + +/*GetRenderReportsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRenderReportsForbidden struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderReportsForbidden) Error() string { + return fmt.Sprintf("[GET /reports][%d] getRenderReportsForbidden %+v", 403, o.Payload) +} + +func (o *GetRenderReportsForbidden) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderReportsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderReportsNotFound creates a GetRenderReportsNotFound with default headers values +func NewGetRenderReportsNotFound() *GetRenderReportsNotFound { + return &GetRenderReportsNotFound{} +} + +/*GetRenderReportsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRenderReportsNotFound struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderReportsNotFound) Error() string { + return fmt.Sprintf("[GET /reports][%d] getRenderReportsNotFound %+v", 404, o.Payload) +} + +func (o *GetRenderReportsNotFound) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderReportsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderReportsUnprocessableEntity creates a GetRenderReportsUnprocessableEntity with default headers values +func NewGetRenderReportsUnprocessableEntity() *GetRenderReportsUnprocessableEntity { + return &GetRenderReportsUnprocessableEntity{} +} + +/*GetRenderReportsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRenderReportsUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderReportsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /reports][%d] getRenderReportsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRenderReportsUnprocessableEntity) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderReportsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderReportsInternalServerError creates a GetRenderReportsInternalServerError with default headers values +func NewGetRenderReportsInternalServerError() *GetRenderReportsInternalServerError { + return &GetRenderReportsInternalServerError{} +} + +/*GetRenderReportsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRenderReportsInternalServerError struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderReportsInternalServerError) Error() string { + return fmt.Sprintf("[GET /reports][%d] getRenderReportsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRenderReportsInternalServerError) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderReportsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_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/render/render_client/report/report_client.go b/api/render/render_client/report/report_client.go new file mode 100644 index 0000000..63cdf29 --- /dev/null +++ b/api/render/render_client/report/report_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package report + +// 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 report API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for report API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRenderReports(params *GetRenderReportsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderReportsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRenderReports financials summary by account + + Return a month-by-month summary financial report for an Account +*/ +func (a *Client) GetRenderReports(params *GetRenderReportsParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderReportsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRenderReportsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRenderReports", + Method: "GET", + PathPattern: "/reports", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRenderReportsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRenderReportsOK) + 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 getRenderReports: 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/render/render_client/tax/get_render_taxes_parameters.go b/api/render/render_client/tax/get_render_taxes_parameters.go new file mode 100644 index 0000000..ec951ec --- /dev/null +++ b/api/render/render_client/tax/get_render_taxes_parameters.go @@ -0,0 +1,240 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" +) + +// NewGetRenderTaxesParams creates a new GetRenderTaxesParams object +// with the default values initialized. +func NewGetRenderTaxesParams() *GetRenderTaxesParams { + var () + return &GetRenderTaxesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRenderTaxesParamsWithTimeout creates a new GetRenderTaxesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRenderTaxesParamsWithTimeout(timeout time.Duration) *GetRenderTaxesParams { + var () + return &GetRenderTaxesParams{ + + timeout: timeout, + } +} + +// NewGetRenderTaxesParamsWithContext creates a new GetRenderTaxesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRenderTaxesParamsWithContext(ctx context.Context) *GetRenderTaxesParams { + var () + return &GetRenderTaxesParams{ + + Context: ctx, + } +} + +// NewGetRenderTaxesParamsWithHTTPClient creates a new GetRenderTaxesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRenderTaxesParamsWithHTTPClient(client *http.Client) *GetRenderTaxesParams { + var () + return &GetRenderTaxesParams{ + HTTPClient: client, + } +} + +/*GetRenderTaxesParams contains all the parameters to send to the API endpoint +for the get render taxes operation typically these are written to a http.Request +*/ +type GetRenderTaxesParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID string + /*Month + The Month Number (1,2, ..., 12) of the report + + */ + Month *int64 + /*Quarter + The Quarter Number (1,2,3,4) of the report + + */ + Quarter *int64 + /*Year + The year of the report + + */ + Year *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get render taxes params +func (o *GetRenderTaxesParams) WithTimeout(timeout time.Duration) *GetRenderTaxesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get render taxes params +func (o *GetRenderTaxesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get render taxes params +func (o *GetRenderTaxesParams) WithContext(ctx context.Context) *GetRenderTaxesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get render taxes params +func (o *GetRenderTaxesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get render taxes params +func (o *GetRenderTaxesParams) WithHTTPClient(client *http.Client) *GetRenderTaxesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get render taxes params +func (o *GetRenderTaxesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get render taxes params +func (o *GetRenderTaxesParams) WithAccountID(accountID string) *GetRenderTaxesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get render taxes params +func (o *GetRenderTaxesParams) SetAccountID(accountID string) { + o.AccountID = accountID +} + +// WithMonth adds the month to the get render taxes params +func (o *GetRenderTaxesParams) WithMonth(month *int64) *GetRenderTaxesParams { + o.SetMonth(month) + return o +} + +// SetMonth adds the month to the get render taxes params +func (o *GetRenderTaxesParams) SetMonth(month *int64) { + o.Month = month +} + +// WithQuarter adds the quarter to the get render taxes params +func (o *GetRenderTaxesParams) WithQuarter(quarter *int64) *GetRenderTaxesParams { + o.SetQuarter(quarter) + return o +} + +// SetQuarter adds the quarter to the get render taxes params +func (o *GetRenderTaxesParams) SetQuarter(quarter *int64) { + o.Quarter = quarter +} + +// WithYear adds the year to the get render taxes params +func (o *GetRenderTaxesParams) WithYear(year *int64) *GetRenderTaxesParams { + o.SetYear(year) + return o +} + +// SetYear adds the year to the get render taxes params +func (o *GetRenderTaxesParams) SetYear(year *int64) { + o.Year = year +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRenderTaxesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param accountId + qrAccountID := o.AccountID + qAccountID := qrAccountID + if qAccountID != "" { + if err := r.SetQueryParam("accountId", qAccountID); err != nil { + return err + } + } + + if o.Month != nil { + + // query param month + var qrMonth int64 + if o.Month != nil { + qrMonth = *o.Month + } + qMonth := swag.FormatInt64(qrMonth) + if qMonth != "" { + if err := r.SetQueryParam("month", qMonth); err != nil { + return err + } + } + + } + + if o.Quarter != nil { + + // query param quarter + var qrQuarter int64 + if o.Quarter != nil { + qrQuarter = *o.Quarter + } + qQuarter := swag.FormatInt64(qrQuarter) + if qQuarter != "" { + if err := r.SetQueryParam("quarter", qQuarter); err != nil { + return err + } + } + + } + + if o.Year != nil { + + // query param year + var qrYear int64 + if o.Year != nil { + qrYear = *o.Year + } + qYear := swag.FormatInt64(qrYear) + if qYear != "" { + if err := r.SetQueryParam("year", qYear); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/render/render_client/tax/get_render_taxes_responses.go b/api/render/render_client/tax/get_render_taxes_responses.go new file mode 100644 index 0000000..9fb5ff3 --- /dev/null +++ b/api/render/render_client/tax/get_render_taxes_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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" + + "github.com/taxnexus/go/lib/api/render/render_models" +) + +// GetRenderTaxesReader is a Reader for the GetRenderTaxes structure. +type GetRenderTaxesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRenderTaxesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRenderTaxesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRenderTaxesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRenderTaxesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRenderTaxesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRenderTaxesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRenderTaxesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRenderTaxesOK creates a GetRenderTaxesOK with default headers values +func NewGetRenderTaxesOK() *GetRenderTaxesOK { + return &GetRenderTaxesOK{} +} + +/*GetRenderTaxesOK handles this case with default header values. + +Rendered documents response +*/ +type GetRenderTaxesOK struct { + AccessControlAllowOrigin string + + Payload *render_models.DocumentResponse +} + +func (o *GetRenderTaxesOK) Error() string { + return fmt.Sprintf("[GET /taxes][%d] getRenderTaxesOK %+v", 200, o.Payload) +} + +func (o *GetRenderTaxesOK) GetPayload() *render_models.DocumentResponse { + return o.Payload +} + +func (o *GetRenderTaxesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.DocumentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderTaxesUnauthorized creates a GetRenderTaxesUnauthorized with default headers values +func NewGetRenderTaxesUnauthorized() *GetRenderTaxesUnauthorized { + return &GetRenderTaxesUnauthorized{} +} + +/*GetRenderTaxesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRenderTaxesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderTaxesUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxes][%d] getRenderTaxesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRenderTaxesUnauthorized) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderTaxesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderTaxesForbidden creates a GetRenderTaxesForbidden with default headers values +func NewGetRenderTaxesForbidden() *GetRenderTaxesForbidden { + return &GetRenderTaxesForbidden{} +} + +/*GetRenderTaxesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRenderTaxesForbidden struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderTaxesForbidden) Error() string { + return fmt.Sprintf("[GET /taxes][%d] getRenderTaxesForbidden %+v", 403, o.Payload) +} + +func (o *GetRenderTaxesForbidden) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderTaxesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderTaxesNotFound creates a GetRenderTaxesNotFound with default headers values +func NewGetRenderTaxesNotFound() *GetRenderTaxesNotFound { + return &GetRenderTaxesNotFound{} +} + +/*GetRenderTaxesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRenderTaxesNotFound struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderTaxesNotFound) Error() string { + return fmt.Sprintf("[GET /taxes][%d] getRenderTaxesNotFound %+v", 404, o.Payload) +} + +func (o *GetRenderTaxesNotFound) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderTaxesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderTaxesUnprocessableEntity creates a GetRenderTaxesUnprocessableEntity with default headers values +func NewGetRenderTaxesUnprocessableEntity() *GetRenderTaxesUnprocessableEntity { + return &GetRenderTaxesUnprocessableEntity{} +} + +/*GetRenderTaxesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRenderTaxesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderTaxesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxes][%d] getRenderTaxesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRenderTaxesUnprocessableEntity) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderTaxesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRenderTaxesInternalServerError creates a GetRenderTaxesInternalServerError with default headers values +func NewGetRenderTaxesInternalServerError() *GetRenderTaxesInternalServerError { + return &GetRenderTaxesInternalServerError{} +} + +/*GetRenderTaxesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRenderTaxesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *render_models.Error +} + +func (o *GetRenderTaxesInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxes][%d] getRenderTaxesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRenderTaxesInternalServerError) GetPayload() *render_models.Error { + return o.Payload +} + +func (o *GetRenderTaxesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + o.Payload = new(render_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/render/render_client/tax/tax_client.go b/api/render/render_client/tax/tax_client.go new file mode 100644 index 0000000..b20e4ce --- /dev/null +++ b/api/render/render_client/tax/tax_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax + +// 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 tax API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRenderTaxes(params *GetRenderTaxesParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderTaxesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRenderTaxes taxes summary by account + + Return a summary tax report for an Account +*/ +func (a *Client) GetRenderTaxes(params *GetRenderTaxesParams, authInfo runtime.ClientAuthInfoWriter) (*GetRenderTaxesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRenderTaxesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRenderTaxes", + Method: "GET", + PathPattern: "/taxes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRenderTaxesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRenderTaxesOK) + 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 getRenderTaxes: 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/render/render_models/document.go b/api/render/render_models/document.go new file mode 100644 index 0000000..d3ea6a8 --- /dev/null +++ b/api/render/render_models/document.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package render_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/render/render_models/document_response.go b/api/render/render_models/document_response.go new file mode 100644 index 0000000..9c80805 --- /dev/null +++ b/api/render/render_models/document_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package render_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DocumentResponse An array of reendered 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 +} + +// 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/render/render_models/error.go b/api/render/render_models/error.go new file mode 100644 index 0000000..bc082c3 --- /dev/null +++ b/api/render/render_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package render_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/render/render_models/invalid_error.go b/api/render/render_models/invalid_error.go new file mode 100644 index 0000000..473a5f6 --- /dev/null +++ b/api/render/render_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package render_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/render/render_models/pagination.go b/api/render/render_models/pagination.go new file mode 100644 index 0000000..d24ffd2 --- /dev/null +++ b/api/render/render_models/pagination.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package render_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/render/render_models/response_meta.go b/api/render/render_models/response_meta.go new file mode 100644 index 0000000..66f1f8b --- /dev/null +++ b/api/render/render_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package render_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/sf-gate/sf_gate_client/accounting_rules/accounting_rules_client.go b/api/sf-gate/sf_gate_client/accounting_rules/accounting_rules_client.go new file mode 100644 index 0000000..171ff2f --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounting_rules/accounting_rules_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_rules + +// 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 accounting rules API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for accounting rules API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAccountingRules(params *GetAccountingRulesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountingRules gets a list of accounting rules + + Return a list of Accounting Rules for an Account +*/ +func (a *Client) GetAccountingRules(params *GetAccountingRulesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountingRulesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getAccountingRules", + Method: "GET", + PathPattern: "/accountingrules", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAccountingRulesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAccountingRulesOK) + 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 getAccountingRules: 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/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_parameters.go b/api/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_parameters.go new file mode 100644 index 0000000..bab05ff --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_rules + +// 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" +) + +// NewGetAccountingRulesParams creates a new GetAccountingRulesParams object +// with the default values initialized. +func NewGetAccountingRulesParams() *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountingRulesParamsWithTimeout creates a new GetAccountingRulesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountingRulesParamsWithTimeout(timeout time.Duration) *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + + timeout: timeout, + } +} + +// NewGetAccountingRulesParamsWithContext creates a new GetAccountingRulesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountingRulesParamsWithContext(ctx context.Context) *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + + Context: ctx, + } +} + +// NewGetAccountingRulesParamsWithHTTPClient creates a new GetAccountingRulesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountingRulesParamsWithHTTPClient(client *http.Client) *GetAccountingRulesParams { + var () + return &GetAccountingRulesParams{ + HTTPClient: client, + } +} + +/*GetAccountingRulesParams contains all the parameters to send to the API endpoint +for the get accounting rules operation typically these are written to a http.Request +*/ +type GetAccountingRulesParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get accounting rules params +func (o *GetAccountingRulesParams) WithTimeout(timeout time.Duration) *GetAccountingRulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get accounting rules params +func (o *GetAccountingRulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get accounting rules params +func (o *GetAccountingRulesParams) WithContext(ctx context.Context) *GetAccountingRulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get accounting rules params +func (o *GetAccountingRulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get accounting rules params +func (o *GetAccountingRulesParams) WithHTTPClient(client *http.Client) *GetAccountingRulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get accounting rules params +func (o *GetAccountingRulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get accounting rules params +func (o *GetAccountingRulesParams) WithAccountID(accountID *string) *GetAccountingRulesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get accounting rules params +func (o *GetAccountingRulesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithLimit adds the limit to the get accounting rules params +func (o *GetAccountingRulesParams) WithLimit(limit *int64) *GetAccountingRulesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get accounting rules params +func (o *GetAccountingRulesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get accounting rules params +func (o *GetAccountingRulesParams) WithOffset(offset *int64) *GetAccountingRulesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get accounting rules params +func (o *GetAccountingRulesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountingRulesParams) 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.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/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_responses.go b/api/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_responses.go new file mode 100644 index 0000000..f5dfe0e --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounting_rules/get_accounting_rules_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_rules + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetAccountingRulesReader is a Reader for the GetAccountingRules structure. +type GetAccountingRulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountingRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountingRulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountingRulesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAccountingRulesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountingRulesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetAccountingRulesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAccountingRulesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetAccountingRulesOK creates a GetAccountingRulesOK with default headers values +func NewGetAccountingRulesOK() *GetAccountingRulesOK { + return &GetAccountingRulesOK{} +} + +/*GetAccountingRulesOK handles this case with default header values. + +Taxnexus Response with Accounting Rule objects +*/ +type GetAccountingRulesOK struct { + Payload *sf_gate_models.AccountingRuleResponse +} + +func (o *GetAccountingRulesOK) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesOK %+v", 200, o.Payload) +} + +func (o *GetAccountingRulesOK) GetPayload() *sf_gate_models.AccountingRuleResponse { + return o.Payload +} + +func (o *GetAccountingRulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.AccountingRuleResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesUnauthorized creates a GetAccountingRulesUnauthorized with default headers values +func NewGetAccountingRulesUnauthorized() *GetAccountingRulesUnauthorized { + return &GetAccountingRulesUnauthorized{} +} + +/*GetAccountingRulesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetAccountingRulesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesUnauthorized) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAccountingRulesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesForbidden creates a GetAccountingRulesForbidden with default headers values +func NewGetAccountingRulesForbidden() *GetAccountingRulesForbidden { + return &GetAccountingRulesForbidden{} +} + +/*GetAccountingRulesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountingRulesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesForbidden) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesForbidden %+v", 403, o.Payload) +} + +func (o *GetAccountingRulesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesNotFound creates a GetAccountingRulesNotFound with default headers values +func NewGetAccountingRulesNotFound() *GetAccountingRulesNotFound { + return &GetAccountingRulesNotFound{} +} + +/*GetAccountingRulesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetAccountingRulesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesNotFound) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesNotFound %+v", 404, o.Payload) +} + +func (o *GetAccountingRulesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesUnprocessableEntity creates a GetAccountingRulesUnprocessableEntity with default headers values +func NewGetAccountingRulesUnprocessableEntity() *GetAccountingRulesUnprocessableEntity { + return &GetAccountingRulesUnprocessableEntity{} +} + +/*GetAccountingRulesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountingRulesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAccountingRulesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesInternalServerError creates a GetAccountingRulesInternalServerError with default headers values +func NewGetAccountingRulesInternalServerError() *GetAccountingRulesInternalServerError { + return &GetAccountingRulesInternalServerError{} +} + +/*GetAccountingRulesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetAccountingRulesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesInternalServerError) Error() string { + return fmt.Sprintf("[GET /accountingrules][%d] getAccountingRulesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAccountingRulesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/accounting_rulesets/accounting_rulesets_client.go b/api/sf-gate/sf_gate_client/accounting_rulesets/accounting_rulesets_client.go new file mode 100644 index 0000000..63c6ead --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounting_rulesets/accounting_rulesets_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_rulesets + +// 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 accounting rulesets API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for accounting rulesets API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAccountingRulesets(params *GetAccountingRulesetsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesetsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccountingRulesets gets a list of accounting rulesets + + Return a list of Accounting Rulesets for an Account +*/ +func (a *Client) GetAccountingRulesets(params *GetAccountingRulesetsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountingRulesetsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountingRulesetsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getAccountingRulesets", + Method: "GET", + PathPattern: "/accountingrulesets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetAccountingRulesetsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetAccountingRulesetsOK) + 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 getAccountingRulesets: 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/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_parameters.go b/api/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_parameters.go new file mode 100644 index 0000000..acb3245 --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_rulesets + +// 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" +) + +// NewGetAccountingRulesetsParams creates a new GetAccountingRulesetsParams object +// with the default values initialized. +func NewGetAccountingRulesetsParams() *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountingRulesetsParamsWithTimeout creates a new GetAccountingRulesetsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountingRulesetsParamsWithTimeout(timeout time.Duration) *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + + timeout: timeout, + } +} + +// NewGetAccountingRulesetsParamsWithContext creates a new GetAccountingRulesetsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountingRulesetsParamsWithContext(ctx context.Context) *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + + Context: ctx, + } +} + +// NewGetAccountingRulesetsParamsWithHTTPClient creates a new GetAccountingRulesetsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountingRulesetsParamsWithHTTPClient(client *http.Client) *GetAccountingRulesetsParams { + var () + return &GetAccountingRulesetsParams{ + HTTPClient: client, + } +} + +/*GetAccountingRulesetsParams contains all the parameters to send to the API endpoint +for the get accounting rulesets operation typically these are written to a http.Request +*/ +type GetAccountingRulesetsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithTimeout(timeout time.Duration) *GetAccountingRulesetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithContext(ctx context.Context) *GetAccountingRulesetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithHTTPClient(client *http.Client) *GetAccountingRulesetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithAccountID(accountID *string) *GetAccountingRulesetsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithLimit adds the limit to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithLimit(limit *int64) *GetAccountingRulesetsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) WithOffset(offset *int64) *GetAccountingRulesetsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get accounting rulesets params +func (o *GetAccountingRulesetsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAccountingRulesetsParams) 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.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/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_responses.go b/api/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_responses.go new file mode 100644 index 0000000..61df4ae --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounting_rulesets/get_accounting_rulesets_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package accounting_rulesets + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetAccountingRulesetsReader is a Reader for the GetAccountingRulesets structure. +type GetAccountingRulesetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAccountingRulesetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAccountingRulesetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetAccountingRulesetsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetAccountingRulesetsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetAccountingRulesetsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetAccountingRulesetsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetAccountingRulesetsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetAccountingRulesetsOK creates a GetAccountingRulesetsOK with default headers values +func NewGetAccountingRulesetsOK() *GetAccountingRulesetsOK { + return &GetAccountingRulesetsOK{} +} + +/*GetAccountingRulesetsOK handles this case with default header values. + +Taxnexus Response with Accounting Ruleset objects +*/ +type GetAccountingRulesetsOK struct { + Payload *sf_gate_models.AccountingRulesetResponse +} + +func (o *GetAccountingRulesetsOK) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsOK %+v", 200, o.Payload) +} + +func (o *GetAccountingRulesetsOK) GetPayload() *sf_gate_models.AccountingRulesetResponse { + return o.Payload +} + +func (o *GetAccountingRulesetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.AccountingRulesetResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsUnauthorized creates a GetAccountingRulesetsUnauthorized with default headers values +func NewGetAccountingRulesetsUnauthorized() *GetAccountingRulesetsUnauthorized { + return &GetAccountingRulesetsUnauthorized{} +} + +/*GetAccountingRulesetsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetAccountingRulesetsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesetsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAccountingRulesetsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsForbidden creates a GetAccountingRulesetsForbidden with default headers values +func NewGetAccountingRulesetsForbidden() *GetAccountingRulesetsForbidden { + return &GetAccountingRulesetsForbidden{} +} + +/*GetAccountingRulesetsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountingRulesetsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesetsForbidden) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsForbidden %+v", 403, o.Payload) +} + +func (o *GetAccountingRulesetsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsNotFound creates a GetAccountingRulesetsNotFound with default headers values +func NewGetAccountingRulesetsNotFound() *GetAccountingRulesetsNotFound { + return &GetAccountingRulesetsNotFound{} +} + +/*GetAccountingRulesetsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetAccountingRulesetsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesetsNotFound) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsNotFound %+v", 404, o.Payload) +} + +func (o *GetAccountingRulesetsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsUnprocessableEntity creates a GetAccountingRulesetsUnprocessableEntity with default headers values +func NewGetAccountingRulesetsUnprocessableEntity() *GetAccountingRulesetsUnprocessableEntity { + return &GetAccountingRulesetsUnprocessableEntity{} +} + +/*GetAccountingRulesetsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountingRulesetsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesetsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAccountingRulesetsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAccountingRulesetsInternalServerError creates a GetAccountingRulesetsInternalServerError with default headers values +func NewGetAccountingRulesetsInternalServerError() *GetAccountingRulesetsInternalServerError { + return &GetAccountingRulesetsInternalServerError{} +} + +/*GetAccountingRulesetsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetAccountingRulesetsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountingRulesetsInternalServerError) Error() string { + return fmt.Sprintf("[GET /accountingrulesets][%d] getAccountingRulesetsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAccountingRulesetsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountingRulesetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/accounts/accounts_client.go b/api/sf-gate/sf_gate_client/accounts/accounts_client.go new file mode 100644 index 0000000..bce0e9e --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounts/accounts_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error) + + PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error) + + PutAccount(params *PutAccountParams, authInfo runtime.ClientAuthInfoWriter) (*PutAccountOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccounts gets a list of accounts + + Return a list of Accounts +*/ +func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PostAccounts adds a new account to taxnexus + + Account record to be added +*/ +func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAccountsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutAccountOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutAccountParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/accounts/get_accounts_parameters.go b/api/sf-gate/sf_gate_client/accounts/get_accounts_parameters.go new file mode 100644 index 0000000..d8e5cae --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounts/get_accounts_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetAccountsParams() *GetAccountsParams { + var () + return &GetAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountsParamsWithTimeout creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountsParamsWithTimeout(timeout time.Duration) *GetAccountsParams { + var () + return &GetAccountsParams{ + + timeout: timeout, + } +} + +// NewGetAccountsParamsWithContext creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams { + var () + return &GetAccountsParams{ + + Context: ctx, + } +} + +// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams { + var () + 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 + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// 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 +} + +// 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.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/sf-gate/sf_gate_client/accounts/get_accounts_responses.go b/api/sf-gate/sf_gate_client/accounts/get_accounts_responses.go new file mode 100644 index 0000000..4b383f3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounts/get_accounts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetAccountsOK creates a GetAccountsOK with default headers values +func NewGetAccountsOK() *GetAccountsOK { + return &GetAccountsOK{} +} + +/*GetAccountsOK handles this case with default header values. + +Taxnexus Response with Account objects +*/ +type GetAccountsOK struct { + Payload *sf_gate_models.AccountResponse +} + +func (o *GetAccountsOK) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload) +} + +func (o *GetAccountsOK) GetPayload() *sf_gate_models.AccountResponse { + return o.Payload +} + +func (o *GetAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetAccountsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAccountsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountsForbidden) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload) +} + +func (o *GetAccountsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetAccountsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload) +} + +func (o *GetAccountsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAccountsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetAccountsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetAccountsInternalServerError) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAccountsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/accounts/post_accounts_parameters.go b/api/sf-gate/sf_gate_client/accounts/post_accounts_parameters.go new file mode 100644 index 0000000..ffc7d74 --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounts/post_accounts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostAccountsParams creates a new PostAccountsParams object +// with the default values initialized. +func NewPostAccountsParams() *PostAccountsParams { + var () + return &PostAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAccountsParamsWithTimeout creates a new PostAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAccountsParamsWithTimeout(timeout time.Duration) *PostAccountsParams { + var () + return &PostAccountsParams{ + + timeout: timeout, + } +} + +// NewPostAccountsParamsWithContext creates a new PostAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAccountsParamsWithContext(ctx context.Context) *PostAccountsParams { + var () + return &PostAccountsParams{ + + Context: ctx, + } +} + +// NewPostAccountsParamsWithHTTPClient creates a new PostAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAccountsParamsWithHTTPClient(client *http.Client) *PostAccountsParams { + var () + 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 + A request with an array of Account Objects + + */ + AccountRequest *sf_gate_models.AccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.AccountRequest) *PostAccountsParams { + o.SetAccountRequest(accountRequest) + return o +} + +// SetAccountRequest adds the accountRequest to the post accounts params +func (o *PostAccountsParams) SetAccountRequest(accountRequest *sf_gate_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/sf-gate/sf_gate_client/accounts/post_accounts_responses.go b/api/sf-gate/sf_gate_client/accounts/post_accounts_responses.go new file mode 100644 index 0000000..99216c8 --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounts/post_accounts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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 500: + result := NewPostAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostAccountsOK creates a PostAccountsOK with default headers values +func NewPostAccountsOK() *PostAccountsOK { + return &PostAccountsOK{} +} + +/*PostAccountsOK handles this case with default header values. + +Taxnexus Response with Account objects +*/ +type PostAccountsOK struct { + Payload *sf_gate_models.AccountResponse +} + +func (o *PostAccountsOK) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %+v", 200, o.Payload) +} + +func (o *PostAccountsOK) GetPayload() *sf_gate_models.AccountResponse { + return o.Payload +} + +func (o *PostAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostAccountsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostAccountsUnauthorized) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostAccountsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostAccountsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostAccountsForbidden) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %+v", 403, o.Payload) +} + +func (o *PostAccountsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PostAccountsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostAccountsNotFound) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %+v", 404, o.Payload) +} + +func (o *PostAccountsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PostAccountsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostAccountsInternalServerError) Error() string { + return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostAccountsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/accounts/put_account_parameters.go b/api/sf-gate/sf_gate_client/accounts/put_account_parameters.go new file mode 100644 index 0000000..a9a646e --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounts/put_account_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutAccountParams creates a new PutAccountParams object +// with the default values initialized. +func NewPutAccountParams() *PutAccountParams { + var () + return &PutAccountParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutAccountParamsWithTimeout creates a new PutAccountParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutAccountParamsWithTimeout(timeout time.Duration) *PutAccountParams { + var () + return &PutAccountParams{ + + timeout: timeout, + } +} + +// NewPutAccountParamsWithContext creates a new PutAccountParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutAccountParamsWithContext(ctx context.Context) *PutAccountParams { + var () + return &PutAccountParams{ + + Context: ctx, + } +} + +// NewPutAccountParamsWithHTTPClient creates a new PutAccountParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutAccountParamsWithHTTPClient(client *http.Client) *PutAccountParams { + var () + 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 + A request with an array of Account Objects + + */ + AccountRequest *sf_gate_models.AccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.AccountRequest) *PutAccountParams { + o.SetAccountRequest(accountRequest) + return o +} + +// SetAccountRequest adds the accountRequest to the put account params +func (o *PutAccountParams) SetAccountRequest(accountRequest *sf_gate_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/sf-gate/sf_gate_client/accounts/put_account_responses.go b/api/sf-gate/sf_gate_client/accounts/put_account_responses.go new file mode 100644 index 0000000..fa34801 --- /dev/null +++ b/api/sf-gate/sf_gate_client/accounts/put_account_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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 500: + result := NewPutAccountInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutAccountOK creates a PutAccountOK with default headers values +func NewPutAccountOK() *PutAccountOK { + return &PutAccountOK{} +} + +/*PutAccountOK handles this case with default header values. + +Taxnexus Response with Account objects +*/ +type PutAccountOK struct { + Payload *sf_gate_models.AccountResponse +} + +func (o *PutAccountOK) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountOK %+v", 200, o.Payload) +} + +func (o *PutAccountOK) GetPayload() *sf_gate_models.AccountResponse { + return o.Payload +} + +func (o *PutAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutAccountUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutAccountUnauthorized) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountUnauthorized %+v", 401, o.Payload) +} + +func (o *PutAccountUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutAccountForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutAccountForbidden) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountForbidden %+v", 403, o.Payload) +} + +func (o *PutAccountForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutAccountForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutAccountNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutAccountNotFound) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountNotFound %+v", 404, o.Payload) +} + +func (o *PutAccountNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutAccountInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutAccountInternalServerError) Error() string { + return fmt.Sprintf("[PUT /accounts][%d] putAccountInternalServerError %+v", 500, o.Payload) +} + +func (o *PutAccountInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/authorities/authorities_client.go b/api/sf-gate/sf_gate_client/authorities/authorities_client.go new file mode 100644 index 0000000..c675665 --- /dev/null +++ b/api/sf-gate/sf_gate_client/authorities/authorities_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authorities + +// 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 authorities API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for authorities API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAuthorities(params *GetAuthoritiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetAuthoritiesOK, 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) (*GetAuthoritiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAuthoritiesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/sf-gate/sf_gate_client/authorities/get_authorities_parameters.go b/api/sf-gate/sf_gate_client/authorities/get_authorities_parameters.go new file mode 100644 index 0000000..0fc828d --- /dev/null +++ b/api/sf-gate/sf_gate_client/authorities/get_authorities_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authorities + +// 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 values initialized. +func NewGetAuthoritiesParams() *GetAuthoritiesParams { + var () + return &GetAuthoritiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAuthoritiesParamsWithTimeout creates a new GetAuthoritiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAuthoritiesParamsWithTimeout(timeout time.Duration) *GetAuthoritiesParams { + var () + return &GetAuthoritiesParams{ + + timeout: timeout, + } +} + +// NewGetAuthoritiesParamsWithContext creates a new GetAuthoritiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAuthoritiesParamsWithContext(ctx context.Context) *GetAuthoritiesParams { + var () + return &GetAuthoritiesParams{ + + Context: ctx, + } +} + +// NewGetAuthoritiesParamsWithHTTPClient creates a new GetAuthoritiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAuthoritiesParamsWithHTTPClient(client *http.Client) *GetAuthoritiesParams { + var () + 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 { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*AuthorityID + Taxnexus Id of the Authority to be retrieved + + */ + AuthorityID *string + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithAccountID adds the accountID to the get authorities params +func (o *GetAuthoritiesParams) WithAccountID(accountID *string) *GetAuthoritiesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get authorities params +func (o *GetAuthoritiesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get authorities params +func (o *GetAuthoritiesParams) WithActive(active *bool) *GetAuthoritiesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get authorities params +func (o *GetAuthoritiesParams) SetActive(active *bool) { + o.Active = active +} + +// 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 +} + +// WithCompanyID adds the companyID to the get authorities params +func (o *GetAuthoritiesParams) WithCompanyID(companyID *string) *GetAuthoritiesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get authorities params +func (o *GetAuthoritiesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// 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.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.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.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/sf-gate/sf_gate_client/authorities/get_authorities_responses.go b/api/sf-gate/sf_gate_client/authorities/get_authorities_responses.go new file mode 100644 index 0000000..5117a11 --- /dev/null +++ b/api/sf-gate/sf_gate_client/authorities/get_authorities_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package authorities + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetAuthoritiesOK creates a GetAuthoritiesOK with default headers values +func NewGetAuthoritiesOK() *GetAuthoritiesOK { + return &GetAuthoritiesOK{} +} + +/*GetAuthoritiesOK handles this case with default header values. + +An array of Authority objects +*/ +type GetAuthoritiesOK struct { + Payload *sf_gate_models.AuthorityResponse +} + +func (o *GetAuthoritiesOK) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesOK %+v", 200, o.Payload) +} + +func (o *GetAuthoritiesOK) GetPayload() *sf_gate_models.AuthorityResponse { + return o.Payload +} + +func (o *GetAuthoritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetAuthoritiesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetAuthoritiesUnauthorized) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAuthoritiesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAuthoritiesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetAuthoritiesForbidden) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesForbidden %+v", 403, o.Payload) +} + +func (o *GetAuthoritiesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetAuthoritiesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetAuthoritiesNotFound) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesNotFound %+v", 404, o.Payload) +} + +func (o *GetAuthoritiesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAuthoritiesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetAuthoritiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAuthoritiesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetAuthoritiesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetAuthoritiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /authorities][%d] getAuthoritiesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAuthoritiesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetAuthoritiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/backends/backends_client.go b/api/sf-gate/sf_gate_client/backends/backends_client.go new file mode 100644 index 0000000..c45a9d4 --- /dev/null +++ b/api/sf-gate/sf_gate_client/backends/backends_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backends + +// 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 backends API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for backends API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetBackends(params *GetBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*GetBackendsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetBackends gets a list of backends + + Return a list of Backends +*/ +func (a *Client) GetBackends(params *GetBackendsParams, authInfo runtime.ClientAuthInfoWriter) (*GetBackendsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetBackendsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getBackends", + Method: "GET", + PathPattern: "/backends", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetBackendsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetBackendsOK) + 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 getBackends: 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/sf-gate/sf_gate_client/backends/get_backends_parameters.go b/api/sf-gate/sf_gate_client/backends/get_backends_parameters.go new file mode 100644 index 0000000..03d7294 --- /dev/null +++ b/api/sf-gate/sf_gate_client/backends/get_backends_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backends + +// 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" +) + +// NewGetBackendsParams creates a new GetBackendsParams object +// with the default values initialized. +func NewGetBackendsParams() *GetBackendsParams { + var () + return &GetBackendsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetBackendsParamsWithTimeout creates a new GetBackendsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetBackendsParamsWithTimeout(timeout time.Duration) *GetBackendsParams { + var () + return &GetBackendsParams{ + + timeout: timeout, + } +} + +// NewGetBackendsParamsWithContext creates a new GetBackendsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetBackendsParamsWithContext(ctx context.Context) *GetBackendsParams { + var () + return &GetBackendsParams{ + + Context: ctx, + } +} + +// NewGetBackendsParamsWithHTTPClient creates a new GetBackendsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetBackendsParamsWithHTTPClient(client *http.Client) *GetBackendsParams { + var () + return &GetBackendsParams{ + HTTPClient: client, + } +} + +/*GetBackendsParams contains all the parameters to send to the API endpoint +for the get backends operation typically these are written to a http.Request +*/ +type GetBackendsParams struct { + + /*BackendID + Taxnexus Id of the Backend to be retrieved + + */ + BackendID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get backends params +func (o *GetBackendsParams) WithTimeout(timeout time.Duration) *GetBackendsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get backends params +func (o *GetBackendsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get backends params +func (o *GetBackendsParams) WithContext(ctx context.Context) *GetBackendsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get backends params +func (o *GetBackendsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get backends params +func (o *GetBackendsParams) WithHTTPClient(client *http.Client) *GetBackendsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get backends params +func (o *GetBackendsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBackendID adds the backendID to the get backends params +func (o *GetBackendsParams) WithBackendID(backendID *string) *GetBackendsParams { + o.SetBackendID(backendID) + return o +} + +// SetBackendID adds the backendId to the get backends params +func (o *GetBackendsParams) SetBackendID(backendID *string) { + o.BackendID = backendID +} + +// WithLimit adds the limit to the get backends params +func (o *GetBackendsParams) WithLimit(limit *int64) *GetBackendsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get backends params +func (o *GetBackendsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get backends params +func (o *GetBackendsParams) WithOffset(offset *int64) *GetBackendsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get backends params +func (o *GetBackendsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBackendsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BackendID != nil { + + // query param backendId + var qrBackendID string + if o.BackendID != nil { + qrBackendID = *o.BackendID + } + qBackendID := qrBackendID + if qBackendID != "" { + if err := r.SetQueryParam("backendId", qBackendID); 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/sf-gate/sf_gate_client/backends/get_backends_responses.go b/api/sf-gate/sf_gate_client/backends/get_backends_responses.go new file mode 100644 index 0000000..f28f709 --- /dev/null +++ b/api/sf-gate/sf_gate_client/backends/get_backends_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package backends + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetBackendsReader is a Reader for the GetBackends structure. +type GetBackendsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBackendsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBackendsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetBackendsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetBackendsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetBackendsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetBackendsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetBackendsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetBackendsOK creates a GetBackendsOK with default headers values +func NewGetBackendsOK() *GetBackendsOK { + return &GetBackendsOK{} +} + +/*GetBackendsOK handles this case with default header values. + +Taxnexus Response with Backend objects +*/ +type GetBackendsOK struct { + Payload *sf_gate_models.BackendResponse +} + +func (o *GetBackendsOK) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsOK %+v", 200, o.Payload) +} + +func (o *GetBackendsOK) GetPayload() *sf_gate_models.BackendResponse { + return o.Payload +} + +func (o *GetBackendsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.BackendResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsUnauthorized creates a GetBackendsUnauthorized with default headers values +func NewGetBackendsUnauthorized() *GetBackendsUnauthorized { + return &GetBackendsUnauthorized{} +} + +/*GetBackendsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetBackendsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetBackendsUnauthorized) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetBackendsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetBackendsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsForbidden creates a GetBackendsForbidden with default headers values +func NewGetBackendsForbidden() *GetBackendsForbidden { + return &GetBackendsForbidden{} +} + +/*GetBackendsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetBackendsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetBackendsForbidden) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsForbidden %+v", 403, o.Payload) +} + +func (o *GetBackendsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetBackendsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsNotFound creates a GetBackendsNotFound with default headers values +func NewGetBackendsNotFound() *GetBackendsNotFound { + return &GetBackendsNotFound{} +} + +/*GetBackendsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetBackendsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetBackendsNotFound) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsNotFound %+v", 404, o.Payload) +} + +func (o *GetBackendsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetBackendsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsUnprocessableEntity creates a GetBackendsUnprocessableEntity with default headers values +func NewGetBackendsUnprocessableEntity() *GetBackendsUnprocessableEntity { + return &GetBackendsUnprocessableEntity{} +} + +/*GetBackendsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetBackendsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetBackendsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetBackendsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetBackendsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetBackendsInternalServerError creates a GetBackendsInternalServerError with default headers values +func NewGetBackendsInternalServerError() *GetBackendsInternalServerError { + return &GetBackendsInternalServerError{} +} + +/*GetBackendsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetBackendsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetBackendsInternalServerError) Error() string { + return fmt.Sprintf("[GET /backends][%d] getBackendsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetBackendsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetBackendsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/cash_receipts/cash_receipts_client.go b/api/sf-gate/sf_gate_client/cash_receipts/cash_receipts_client.go new file mode 100644 index 0000000..322d35a --- /dev/null +++ b/api/sf-gate/sf_gate_client/cash_receipts/cash_receipts_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipts + +// 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 cash receipts API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for cash receipts API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCashReceipts(params *GetCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCashReceiptsOK, error) + + PostCashReceipts(params *PostCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCashReceiptsOK, error) + + PutCashRecipts(params *PutCashReciptsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCashReciptsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCashReceipts gets a list of cash receipts + + Return a list of available Taxnexus Cash Receipts +*/ +func (a *Client) GetCashReceipts(params *GetCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCashReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCashReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCashReceipts", + Method: "GET", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCashReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCashReceiptsOK) + 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 getCashReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostCashReceipts creates new cash receipts + + Create New Cash Receipts +*/ +func (a *Client) PostCashReceipts(params *PostCashReceiptsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCashReceiptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCashReceiptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postCashReceipts", + Method: "POST", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostCashReceiptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostCashReceiptsOK) + 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 postCashReceipts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutCashRecipts puts a list of cash receipts + + Put a list of Cash Receipts +*/ +func (a *Client) PutCashRecipts(params *PutCashReciptsParams, authInfo runtime.ClientAuthInfoWriter) (*PutCashReciptsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutCashReciptsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putCashRecipts", + Method: "PUT", + PathPattern: "/cashreceipts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutCashReciptsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutCashReciptsOK) + 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 putCashRecipts: 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/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_parameters.go b/api/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_parameters.go new file mode 100644 index 0000000..6d8a174 --- /dev/null +++ b/api/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipts + +// 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" +) + +// NewGetCashReceiptsParams creates a new GetCashReceiptsParams object +// with the default values initialized. +func NewGetCashReceiptsParams() *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCashReceiptsParamsWithTimeout creates a new GetCashReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCashReceiptsParamsWithTimeout(timeout time.Duration) *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + + timeout: timeout, + } +} + +// NewGetCashReceiptsParamsWithContext creates a new GetCashReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCashReceiptsParamsWithContext(ctx context.Context) *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + + Context: ctx, + } +} + +// NewGetCashReceiptsParamsWithHTTPClient creates a new GetCashReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCashReceiptsParamsWithHTTPClient(client *http.Client) *GetCashReceiptsParams { + var () + return &GetCashReceiptsParams{ + HTTPClient: client, + } +} + +/*GetCashReceiptsParams contains all the parameters to send to the API endpoint +for the get cash receipts operation typically these are written to a http.Request +*/ +type GetCashReceiptsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CashReceiptID + Taxnexus Record Id of a Cash Receipt + + */ + CashReceiptID *string + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cash receipts params +func (o *GetCashReceiptsParams) WithTimeout(timeout time.Duration) *GetCashReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cash receipts params +func (o *GetCashReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cash receipts params +func (o *GetCashReceiptsParams) WithContext(ctx context.Context) *GetCashReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cash receipts params +func (o *GetCashReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cash receipts params +func (o *GetCashReceiptsParams) WithHTTPClient(client *http.Client) *GetCashReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cash receipts params +func (o *GetCashReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get cash receipts params +func (o *GetCashReceiptsParams) WithAccountID(accountID *string) *GetCashReceiptsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get cash receipts params +func (o *GetCashReceiptsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get cash receipts params +func (o *GetCashReceiptsParams) WithActive(active *bool) *GetCashReceiptsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get cash receipts params +func (o *GetCashReceiptsParams) SetActive(active *bool) { + o.Active = active +} + +// WithCashReceiptID adds the cashReceiptID to the get cash receipts params +func (o *GetCashReceiptsParams) WithCashReceiptID(cashReceiptID *string) *GetCashReceiptsParams { + o.SetCashReceiptID(cashReceiptID) + return o +} + +// SetCashReceiptID adds the cashReceiptId to the get cash receipts params +func (o *GetCashReceiptsParams) SetCashReceiptID(cashReceiptID *string) { + o.CashReceiptID = cashReceiptID +} + +// WithCompanyID adds the companyID to the get cash receipts params +func (o *GetCashReceiptsParams) WithCompanyID(companyID *string) *GetCashReceiptsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get cash receipts params +func (o *GetCashReceiptsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get cash receipts params +func (o *GetCashReceiptsParams) WithLimit(limit *int64) *GetCashReceiptsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get cash receipts params +func (o *GetCashReceiptsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get cash receipts params +func (o *GetCashReceiptsParams) WithOffset(offset *int64) *GetCashReceiptsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get cash receipts params +func (o *GetCashReceiptsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCashReceiptsParams) 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.CashReceiptID != nil { + + // query param cashReceiptId + var qrCashReceiptID string + if o.CashReceiptID != nil { + qrCashReceiptID = *o.CashReceiptID + } + qCashReceiptID := qrCashReceiptID + if qCashReceiptID != "" { + if err := r.SetQueryParam("cashReceiptId", qCashReceiptID); 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/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_responses.go b/api/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_responses.go new file mode 100644 index 0000000..eb2d69a --- /dev/null +++ b/api/sf-gate/sf_gate_client/cash_receipts/get_cash_receipts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipts + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetCashReceiptsReader is a Reader for the GetCashReceipts structure. +type GetCashReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCashReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCashReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCashReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCashReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCashReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCashReceiptsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCashReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCashReceiptsOK creates a GetCashReceiptsOK with default headers values +func NewGetCashReceiptsOK() *GetCashReceiptsOK { + return &GetCashReceiptsOK{} +} + +/*GetCashReceiptsOK handles this case with default header values. + +Taxnexus Response with Cash Receipt objects +*/ +type GetCashReceiptsOK struct { + Payload *sf_gate_models.CashReceiptResponse +} + +func (o *GetCashReceiptsOK) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsOK %+v", 200, o.Payload) +} + +func (o *GetCashReceiptsOK) GetPayload() *sf_gate_models.CashReceiptResponse { + return o.Payload +} + +func (o *GetCashReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.CashReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsUnauthorized creates a GetCashReceiptsUnauthorized with default headers values +func NewGetCashReceiptsUnauthorized() *GetCashReceiptsUnauthorized { + return &GetCashReceiptsUnauthorized{} +} + +/*GetCashReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCashReceiptsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetCashReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCashReceiptsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsForbidden creates a GetCashReceiptsForbidden with default headers values +func NewGetCashReceiptsForbidden() *GetCashReceiptsForbidden { + return &GetCashReceiptsForbidden{} +} + +/*GetCashReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCashReceiptsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetCashReceiptsForbidden) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *GetCashReceiptsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsNotFound creates a GetCashReceiptsNotFound with default headers values +func NewGetCashReceiptsNotFound() *GetCashReceiptsNotFound { + return &GetCashReceiptsNotFound{} +} + +/*GetCashReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCashReceiptsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetCashReceiptsNotFound) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *GetCashReceiptsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsUnprocessableEntity creates a GetCashReceiptsUnprocessableEntity with default headers values +func NewGetCashReceiptsUnprocessableEntity() *GetCashReceiptsUnprocessableEntity { + return &GetCashReceiptsUnprocessableEntity{} +} + +/*GetCashReceiptsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCashReceiptsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetCashReceiptsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCashReceiptsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCashReceiptsInternalServerError creates a GetCashReceiptsInternalServerError with default headers values +func NewGetCashReceiptsInternalServerError() *GetCashReceiptsInternalServerError { + return &GetCashReceiptsInternalServerError{} +} + +/*GetCashReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCashReceiptsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetCashReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCashReceiptsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCashReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_parameters.go b/api/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_parameters.go new file mode 100644 index 0000000..5d95dc8 --- /dev/null +++ b/api/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipts + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostCashReceiptsParams creates a new PostCashReceiptsParams object +// with the default values initialized. +func NewPostCashReceiptsParams() *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostCashReceiptsParamsWithTimeout creates a new PostCashReceiptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostCashReceiptsParamsWithTimeout(timeout time.Duration) *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + + timeout: timeout, + } +} + +// NewPostCashReceiptsParamsWithContext creates a new PostCashReceiptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostCashReceiptsParamsWithContext(ctx context.Context) *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + + Context: ctx, + } +} + +// NewPostCashReceiptsParamsWithHTTPClient creates a new PostCashReceiptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostCashReceiptsParamsWithHTTPClient(client *http.Client) *PostCashReceiptsParams { + var () + return &PostCashReceiptsParams{ + HTTPClient: client, + } +} + +/*PostCashReceiptsParams contains all the parameters to send to the API endpoint +for the post cash receipts operation typically these are written to a http.Request +*/ +type PostCashReceiptsParams struct { + + /*CashReceiptRequest*/ + CashReceiptRequest *sf_gate_models.CashReceiptRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post cash receipts params +func (o *PostCashReceiptsParams) WithTimeout(timeout time.Duration) *PostCashReceiptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post cash receipts params +func (o *PostCashReceiptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post cash receipts params +func (o *PostCashReceiptsParams) WithContext(ctx context.Context) *PostCashReceiptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post cash receipts params +func (o *PostCashReceiptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post cash receipts params +func (o *PostCashReceiptsParams) WithHTTPClient(client *http.Client) *PostCashReceiptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post cash receipts params +func (o *PostCashReceiptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCashReceiptRequest adds the cashReceiptRequest to the post cash receipts params +func (o *PostCashReceiptsParams) WithCashReceiptRequest(cashReceiptRequest *sf_gate_models.CashReceiptRequest) *PostCashReceiptsParams { + o.SetCashReceiptRequest(cashReceiptRequest) + return o +} + +// SetCashReceiptRequest adds the cashReceiptRequest to the post cash receipts params +func (o *PostCashReceiptsParams) SetCashReceiptRequest(cashReceiptRequest *sf_gate_models.CashReceiptRequest) { + o.CashReceiptRequest = cashReceiptRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCashReceiptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CashReceiptRequest != nil { + if err := r.SetBodyParam(o.CashReceiptRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_responses.go b/api/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_responses.go new file mode 100644 index 0000000..a8d5266 --- /dev/null +++ b/api/sf-gate/sf_gate_client/cash_receipts/post_cash_receipts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipts + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostCashReceiptsReader is a Reader for the PostCashReceipts structure. +type PostCashReceiptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCashReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCashReceiptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostCashReceiptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCashReceiptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostCashReceiptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCashReceiptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostCashReceiptsOK creates a PostCashReceiptsOK with default headers values +func NewPostCashReceiptsOK() *PostCashReceiptsOK { + return &PostCashReceiptsOK{} +} + +/*PostCashReceiptsOK handles this case with default header values. + +Taxnexus Response with Cash Receipt objects +*/ +type PostCashReceiptsOK struct { + Payload *sf_gate_models.CashReceiptResponse +} + +func (o *PostCashReceiptsOK) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsOK %+v", 200, o.Payload) +} + +func (o *PostCashReceiptsOK) GetPayload() *sf_gate_models.CashReceiptResponse { + return o.Payload +} + +func (o *PostCashReceiptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.CashReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsUnauthorized creates a PostCashReceiptsUnauthorized with default headers values +func NewPostCashReceiptsUnauthorized() *PostCashReceiptsUnauthorized { + return &PostCashReceiptsUnauthorized{} +} + +/*PostCashReceiptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostCashReceiptsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostCashReceiptsUnauthorized) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostCashReceiptsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsForbidden creates a PostCashReceiptsForbidden with default headers values +func NewPostCashReceiptsForbidden() *PostCashReceiptsForbidden { + return &PostCashReceiptsForbidden{} +} + +/*PostCashReceiptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostCashReceiptsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostCashReceiptsForbidden) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsForbidden %+v", 403, o.Payload) +} + +func (o *PostCashReceiptsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsNotFound creates a PostCashReceiptsNotFound with default headers values +func NewPostCashReceiptsNotFound() *PostCashReceiptsNotFound { + return &PostCashReceiptsNotFound{} +} + +/*PostCashReceiptsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostCashReceiptsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostCashReceiptsNotFound) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsNotFound %+v", 404, o.Payload) +} + +func (o *PostCashReceiptsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCashReceiptsInternalServerError creates a PostCashReceiptsInternalServerError with default headers values +func NewPostCashReceiptsInternalServerError() *PostCashReceiptsInternalServerError { + return &PostCashReceiptsInternalServerError{} +} + +/*PostCashReceiptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostCashReceiptsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostCashReceiptsInternalServerError) Error() string { + return fmt.Sprintf("[POST /cashreceipts][%d] postCashReceiptsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostCashReceiptsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostCashReceiptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_parameters.go b/api/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_parameters.go new file mode 100644 index 0000000..efd943b --- /dev/null +++ b/api/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipts + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutCashReciptsParams creates a new PutCashReciptsParams object +// with the default values initialized. +func NewPutCashReciptsParams() *PutCashReciptsParams { + var () + return &PutCashReciptsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutCashReciptsParamsWithTimeout creates a new PutCashReciptsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutCashReciptsParamsWithTimeout(timeout time.Duration) *PutCashReciptsParams { + var () + return &PutCashReciptsParams{ + + timeout: timeout, + } +} + +// NewPutCashReciptsParamsWithContext creates a new PutCashReciptsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutCashReciptsParamsWithContext(ctx context.Context) *PutCashReciptsParams { + var () + return &PutCashReciptsParams{ + + Context: ctx, + } +} + +// NewPutCashReciptsParamsWithHTTPClient creates a new PutCashReciptsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutCashReciptsParamsWithHTTPClient(client *http.Client) *PutCashReciptsParams { + var () + return &PutCashReciptsParams{ + HTTPClient: client, + } +} + +/*PutCashReciptsParams contains all the parameters to send to the API endpoint +for the put cash recipts operation typically these are written to a http.Request +*/ +type PutCashReciptsParams struct { + + /*CashReceiptRequest*/ + CashReceiptRequest *sf_gate_models.CashReceiptRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cash recipts params +func (o *PutCashReciptsParams) WithTimeout(timeout time.Duration) *PutCashReciptsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cash recipts params +func (o *PutCashReciptsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cash recipts params +func (o *PutCashReciptsParams) WithContext(ctx context.Context) *PutCashReciptsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cash recipts params +func (o *PutCashReciptsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cash recipts params +func (o *PutCashReciptsParams) WithHTTPClient(client *http.Client) *PutCashReciptsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cash recipts params +func (o *PutCashReciptsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCashReceiptRequest adds the cashReceiptRequest to the put cash recipts params +func (o *PutCashReciptsParams) WithCashReceiptRequest(cashReceiptRequest *sf_gate_models.CashReceiptRequest) *PutCashReciptsParams { + o.SetCashReceiptRequest(cashReceiptRequest) + return o +} + +// SetCashReceiptRequest adds the cashReceiptRequest to the put cash recipts params +func (o *PutCashReciptsParams) SetCashReceiptRequest(cashReceiptRequest *sf_gate_models.CashReceiptRequest) { + o.CashReceiptRequest = cashReceiptRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutCashReciptsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CashReceiptRequest != nil { + if err := r.SetBodyParam(o.CashReceiptRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_responses.go b/api/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_responses.go new file mode 100644 index 0000000..809eddc --- /dev/null +++ b/api/sf-gate/sf_gate_client/cash_receipts/put_cash_recipts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package cash_receipts + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutCashReciptsReader is a Reader for the PutCashRecipts structure. +type PutCashReciptsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutCashReciptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutCashReciptsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutCashReciptsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutCashReciptsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutCashReciptsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutCashReciptsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutCashReciptsOK creates a PutCashReciptsOK with default headers values +func NewPutCashReciptsOK() *PutCashReciptsOK { + return &PutCashReciptsOK{} +} + +/*PutCashReciptsOK handles this case with default header values. + +Taxnexus Response with Cash Receipt objects +*/ +type PutCashReciptsOK struct { + Payload *sf_gate_models.CashReceiptResponse +} + +func (o *PutCashReciptsOK) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReciptsOK %+v", 200, o.Payload) +} + +func (o *PutCashReciptsOK) GetPayload() *sf_gate_models.CashReceiptResponse { + return o.Payload +} + +func (o *PutCashReciptsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.CashReceiptResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReciptsUnauthorized creates a PutCashReciptsUnauthorized with default headers values +func NewPutCashReciptsUnauthorized() *PutCashReciptsUnauthorized { + return &PutCashReciptsUnauthorized{} +} + +/*PutCashReciptsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutCashReciptsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutCashReciptsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReciptsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutCashReciptsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutCashReciptsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReciptsForbidden creates a PutCashReciptsForbidden with default headers values +func NewPutCashReciptsForbidden() *PutCashReciptsForbidden { + return &PutCashReciptsForbidden{} +} + +/*PutCashReciptsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutCashReciptsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutCashReciptsForbidden) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReciptsForbidden %+v", 403, o.Payload) +} + +func (o *PutCashReciptsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutCashReciptsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReciptsNotFound creates a PutCashReciptsNotFound with default headers values +func NewPutCashReciptsNotFound() *PutCashReciptsNotFound { + return &PutCashReciptsNotFound{} +} + +/*PutCashReciptsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutCashReciptsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutCashReciptsNotFound) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReciptsNotFound %+v", 404, o.Payload) +} + +func (o *PutCashReciptsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutCashReciptsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutCashReciptsInternalServerError creates a PutCashReciptsInternalServerError with default headers values +func NewPutCashReciptsInternalServerError() *PutCashReciptsInternalServerError { + return &PutCashReciptsInternalServerError{} +} + +/*PutCashReciptsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutCashReciptsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutCashReciptsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /cashreceipts][%d] putCashReciptsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutCashReciptsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutCashReciptsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/clusters/clusters_client.go b/api/sf-gate/sf_gate_client/clusters/clusters_client.go new file mode 100644 index 0000000..390cc04 --- /dev/null +++ b/api/sf-gate/sf_gate_client/clusters/clusters_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package clusters + +// 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 clusters API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for clusters API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter) (*GetClustersOK, error) + + PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter) (*PostClustersOK, error) + + PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter) (*PutClustersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetClusters gets a list clusters + + Return a list of Cluster records from the datastore +*/ +func (a *Client) GetClusters(params *GetClustersParams, authInfo runtime.ClientAuthInfoWriter) (*GetClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClustersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PostClusters creates new clusters + + Create Clusters in Taxnexus +*/ +func (a *Client) PostClusters(params *PostClustersParams, authInfo runtime.ClientAuthInfoWriter) (*PostClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostClustersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutClusters(params *PutClustersParams, authInfo runtime.ClientAuthInfoWriter) (*PutClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClustersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/clusters/get_clusters_parameters.go b/api/sf-gate/sf_gate_client/clusters/get_clusters_parameters.go new file mode 100644 index 0000000..d856c09 --- /dev/null +++ b/api/sf-gate/sf_gate_client/clusters/get_clusters_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package clusters + +// 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 values initialized. +func NewGetClustersParams() *GetClustersParams { + var () + return &GetClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClustersParamsWithTimeout creates a new GetClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClustersParamsWithTimeout(timeout time.Duration) *GetClustersParams { + var () + return &GetClustersParams{ + + timeout: timeout, + } +} + +// NewGetClustersParamsWithContext creates a new GetClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClustersParamsWithContext(ctx context.Context) *GetClustersParams { + var () + return &GetClustersParams{ + + Context: ctx, + } +} + +// NewGetClustersParamsWithHTTPClient creates a new GetClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClustersParamsWithHTTPClient(client *http.Client) *GetClustersParams { + var () + 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 + Taxnexus Record Id of a Cluster + + */ + ClusterID *string + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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/sf-gate/sf_gate_client/clusters/get_clusters_responses.go b/api/sf-gate/sf_gate_client/clusters/get_clusters_responses.go new file mode 100644 index 0000000..af5ae76 --- /dev/null +++ b/api/sf-gate/sf_gate_client/clusters/get_clusters_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package clusters + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetClustersOK creates a GetClustersOK with default headers values +func NewGetClustersOK() *GetClustersOK { + return &GetClustersOK{} +} + +/*GetClustersOK handles this case with default header values. + +Taxnexus Response with Cluster objects +*/ +type GetClustersOK struct { + Payload *sf_gate_models.ClusterResponse +} + +func (o *GetClustersOK) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersOK %+v", 200, o.Payload) +} + +func (o *GetClustersOK) GetPayload() *sf_gate_models.ClusterResponse { + return o.Payload +} + +func (o *GetClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetClustersUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetClustersUnauthorized) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersUnauthorized %+v", 401, o.Payload) +} + +func (o *GetClustersUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetClustersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetClustersForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetClustersForbidden) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersForbidden %+v", 403, o.Payload) +} + +func (o *GetClustersForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetClustersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetClustersNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetClustersNotFound) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersNotFound %+v", 404, o.Payload) +} + +func (o *GetClustersNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetClustersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetClustersUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetClustersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetClustersUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetClustersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetClustersInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetClustersInternalServerError) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersInternalServerError %+v", 500, o.Payload) +} + +func (o *GetClustersInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetClustersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/clusters/post_clusters_parameters.go b/api/sf-gate/sf_gate_client/clusters/post_clusters_parameters.go new file mode 100644 index 0000000..8e61437 --- /dev/null +++ b/api/sf-gate/sf_gate_client/clusters/post_clusters_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package clusters + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostClustersParams creates a new PostClustersParams object +// with the default values initialized. +func NewPostClustersParams() *PostClustersParams { + var () + return &PostClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostClustersParamsWithTimeout creates a new PostClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostClustersParamsWithTimeout(timeout time.Duration) *PostClustersParams { + var () + return &PostClustersParams{ + + timeout: timeout, + } +} + +// NewPostClustersParamsWithContext creates a new PostClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostClustersParamsWithContext(ctx context.Context) *PostClustersParams { + var () + return &PostClustersParams{ + + Context: ctx, + } +} + +// NewPostClustersParamsWithHTTPClient creates a new PostClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostClustersParamsWithHTTPClient(client *http.Client) *PostClustersParams { + var () + 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 *sf_gate_models.ClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.ClusterRequest) *PostClustersParams { + o.SetClusterRequest(clusterRequest) + return o +} + +// SetClusterRequest adds the clusterRequest to the post clusters params +func (o *PostClustersParams) SetClusterRequest(clusterRequest *sf_gate_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/sf-gate/sf_gate_client/clusters/post_clusters_responses.go b/api/sf-gate/sf_gate_client/clusters/post_clusters_responses.go new file mode 100644 index 0000000..47926de --- /dev/null +++ b/api/sf-gate/sf_gate_client/clusters/post_clusters_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package clusters + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPostClustersOK creates a PostClustersOK with default headers values +func NewPostClustersOK() *PostClustersOK { + return &PostClustersOK{} +} + +/*PostClustersOK handles this case with default header values. + +Taxnexus Response with Cluster objects +*/ +type PostClustersOK struct { + Payload *sf_gate_models.ClusterResponse +} + +func (o *PostClustersOK) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersOK %+v", 200, o.Payload) +} + +func (o *PostClustersOK) GetPayload() *sf_gate_models.ClusterResponse { + return o.Payload +} + +func (o *PostClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostClustersUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostClustersUnauthorized) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostClustersUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostClustersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostClustersForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostClustersForbidden) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersForbidden %+v", 403, o.Payload) +} + +func (o *PostClustersForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostClustersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PostClustersNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostClustersNotFound) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersNotFound %+v", 404, o.Payload) +} + +func (o *PostClustersNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostClustersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostClustersUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PostClustersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostClustersUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostClustersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PostClustersInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostClustersInternalServerError) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostClustersInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostClustersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/clusters/put_clusters_parameters.go b/api/sf-gate/sf_gate_client/clusters/put_clusters_parameters.go new file mode 100644 index 0000000..2874abd --- /dev/null +++ b/api/sf-gate/sf_gate_client/clusters/put_clusters_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package clusters + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutClustersParams creates a new PutClustersParams object +// with the default values initialized. +func NewPutClustersParams() *PutClustersParams { + var () + return &PutClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClustersParamsWithTimeout creates a new PutClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClustersParamsWithTimeout(timeout time.Duration) *PutClustersParams { + var () + return &PutClustersParams{ + + timeout: timeout, + } +} + +// NewPutClustersParamsWithContext creates a new PutClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClustersParamsWithContext(ctx context.Context) *PutClustersParams { + var () + return &PutClustersParams{ + + Context: ctx, + } +} + +// NewPutClustersParamsWithHTTPClient creates a new PutClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClustersParamsWithHTTPClient(client *http.Client) *PutClustersParams { + var () + 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 *sf_gate_models.ClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.ClusterRequest) *PutClustersParams { + o.SetClusterRequest(clusterRequest) + return o +} + +// SetClusterRequest adds the clusterRequest to the put clusters params +func (o *PutClustersParams) SetClusterRequest(clusterRequest *sf_gate_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/sf-gate/sf_gate_client/clusters/put_clusters_responses.go b/api/sf-gate/sf_gate_client/clusters/put_clusters_responses.go new file mode 100644 index 0000000..e7f789a --- /dev/null +++ b/api/sf-gate/sf_gate_client/clusters/put_clusters_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package clusters + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPutClustersOK creates a PutClustersOK with default headers values +func NewPutClustersOK() *PutClustersOK { + return &PutClustersOK{} +} + +/*PutClustersOK handles this case with default header values. + +Taxnexus Response with Cluster objects +*/ +type PutClustersOK struct { + Payload *sf_gate_models.ClusterResponse +} + +func (o *PutClustersOK) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersOK %+v", 200, o.Payload) +} + +func (o *PutClustersOK) GetPayload() *sf_gate_models.ClusterResponse { + return o.Payload +} + +func (o *PutClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutClustersUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutClustersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersUnauthorized %+v", 401, o.Payload) +} + +func (o *PutClustersUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutClustersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutClustersForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutClustersForbidden) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersForbidden %+v", 403, o.Payload) +} + +func (o *PutClustersForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutClustersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutClustersNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutClustersNotFound) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersNotFound %+v", 404, o.Payload) +} + +func (o *PutClustersNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutClustersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutClustersUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PutClustersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutClustersUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutClustersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutClustersInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutClustersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /clusters][%d] putClustersInternalServerError %+v", 500, o.Payload) +} + +func (o *PutClustersInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutClustersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/companies/companies_client.go b/api/sf-gate/sf_gate_client/companies/companies_client.go new file mode 100644 index 0000000..d8d6314 --- /dev/null +++ b/api/sf-gate/sf_gate_client/companies/companies_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCompanies gets a company record + + Retrieve a Company record from the datastore +*/ +func (a *Client) GetCompanies(params *GetCompaniesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCompaniesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCompaniesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/sf-gate/sf_gate_client/companies/get_companies_parameters.go b/api/sf-gate/sf_gate_client/companies/get_companies_parameters.go new file mode 100644 index 0000000..f64d070 --- /dev/null +++ b/api/sf-gate/sf_gate_client/companies/get_companies_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + "github.com/go-openapi/swag" +) + +// NewGetCompaniesParams creates a new GetCompaniesParams object +// with the default values initialized. +func NewGetCompaniesParams() *GetCompaniesParams { + var () + return &GetCompaniesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCompaniesParamsWithTimeout creates a new GetCompaniesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCompaniesParamsWithTimeout(timeout time.Duration) *GetCompaniesParams { + var () + return &GetCompaniesParams{ + + timeout: timeout, + } +} + +// NewGetCompaniesParamsWithContext creates a new GetCompaniesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCompaniesParamsWithContext(ctx context.Context) *GetCompaniesParams { + var () + return &GetCompaniesParams{ + + Context: ctx, + } +} + +// NewGetCompaniesParamsWithHTTPClient creates a new GetCompaniesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCompaniesParamsWithHTTPClient(client *http.Client) *GetCompaniesParams { + var () + 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 + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithLimit adds the limit to the get companies params +func (o *GetCompaniesParams) WithLimit(limit *int64) *GetCompaniesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get companies params +func (o *GetCompaniesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get companies params +func (o *GetCompaniesParams) WithOffset(offset *int64) *GetCompaniesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get companies params +func (o *GetCompaniesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// 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 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/sf-gate/sf_gate_client/companies/get_companies_responses.go b/api/sf-gate/sf_gate_client/companies/get_companies_responses.go new file mode 100644 index 0000000..c79676e --- /dev/null +++ b/api/sf-gate/sf_gate_client/companies/get_companies_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetCompaniesOK creates a GetCompaniesOK with default headers values +func NewGetCompaniesOK() *GetCompaniesOK { + return &GetCompaniesOK{} +} + +/*GetCompaniesOK handles this case with default header values. + +Taxnexus Response with Company objects +*/ +type GetCompaniesOK struct { + Payload *sf_gate_models.CompanyResponse +} + +func (o *GetCompaniesOK) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesOK %+v", 200, o.Payload) +} + +func (o *GetCompaniesOK) GetPayload() *sf_gate_models.CompanyResponse { + return o.Payload +} + +func (o *GetCompaniesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCompaniesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetCompaniesUnauthorized) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCompaniesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCompaniesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCompaniesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetCompaniesForbidden) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesForbidden %+v", 403, o.Payload) +} + +func (o *GetCompaniesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCompaniesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetCompaniesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetCompaniesNotFound) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesNotFound %+v", 404, o.Payload) +} + +func (o *GetCompaniesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCompaniesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCompaniesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetCompaniesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCompaniesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCompaniesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetCompaniesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetCompaniesInternalServerError) Error() string { + return fmt.Sprintf("[GET /companies][%d] getCompaniesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCompaniesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCompaniesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/contacts/contacts_client.go b/api/sf-gate/sf_gate_client/contacts/contacts_client.go new file mode 100644 index 0000000..c6213da --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/contacts_client.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error) + + GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter) (*GetContactsOK, error) + + PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PostContactsOK, error) + + PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PutContactsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + DeleteContact deletes a contact + + Delete Taxnexus Contact record +*/ +func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteContactOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteContactParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*GetContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetContactsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PostContacts adds new contacts + + Contact record to be added +*/ +func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter) (*PostContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostContactsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutContactsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutContactsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/contacts/delete_contact_parameters.go b/api/sf-gate/sf_gate_client/contacts/delete_contact_parameters.go new file mode 100644 index 0000000..5476fc2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/delete_contact_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewDeleteContactParams() *DeleteContactParams { + var () + return &DeleteContactParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteContactParamsWithTimeout creates a new DeleteContactParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteContactParamsWithTimeout(timeout time.Duration) *DeleteContactParams { + var () + return &DeleteContactParams{ + + timeout: timeout, + } +} + +// NewDeleteContactParamsWithContext creates a new DeleteContactParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteContactParamsWithContext(ctx context.Context) *DeleteContactParams { + var () + return &DeleteContactParams{ + + Context: ctx, + } +} + +// NewDeleteContactParamsWithHTTPClient creates a new DeleteContactParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteContactParamsWithHTTPClient(client *http.Client) *DeleteContactParams { + var () + 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 + Taxnexus Id of the Contact to be retrieved + + */ + ContactID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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/sf-gate/sf_gate_client/contacts/delete_contact_responses.go b/api/sf-gate/sf_gate_client/contacts/delete_contact_responses.go new file mode 100644 index 0000000..8d82abe --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/delete_contact_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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 500: + result := NewDeleteContactInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDeleteContactOK creates a DeleteContactOK with default headers values +func NewDeleteContactOK() *DeleteContactOK { + return &DeleteContactOK{} +} + +/*DeleteContactOK handles this case with default header values. + +An array of Message Objects with Delete Status +*/ +type DeleteContactOK struct { + Payload *DeleteContactOKBody +} + +func (o *DeleteContactOK) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %+v", 200, o.Payload) +} + +func (o *DeleteContactOK) GetPayload() *DeleteContactOKBody { + return o.Payload +} + +func (o *DeleteContactOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DeleteContactOKBody) + + // 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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type DeleteContactUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *DeleteContactUnauthorized) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %+v", 401, o.Payload) +} + +func (o *DeleteContactUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *DeleteContactUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type DeleteContactForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *DeleteContactForbidden) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %+v", 403, o.Payload) +} + +func (o *DeleteContactForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *DeleteContactForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type DeleteContactNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *DeleteContactNotFound) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %+v", 404, o.Payload) +} + +func (o *DeleteContactNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *DeleteContactNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type DeleteContactInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *DeleteContactInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteContactInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *DeleteContactInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DeleteContactOKBody delete contact o k body +swagger:model DeleteContactOKBody +*/ +type DeleteContactOKBody struct { + + // data + Data []*sf_gate_models.Message `json:"data"` + + // meta + Meta *sf_gate_models.ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this delete contact o k body +func (o *DeleteContactOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateData(formats); err != nil { + res = append(res, err) + } + + if err := o.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DeleteContactOKBody) validateData(formats strfmt.Registry) error { + + if swag.IsZero(o.Data) { // not required + return nil + } + + for i := 0; i < len(o.Data); i++ { + if swag.IsZero(o.Data[i]) { // not required + continue + } + + if o.Data[i] != nil { + if err := o.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteContactOK" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *DeleteContactOKBody) validateMeta(formats strfmt.Registry) error { + + if swag.IsZero(o.Meta) { // not required + return nil + } + + if o.Meta != nil { + if err := o.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteContactOK" + "." + "meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DeleteContactOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DeleteContactOKBody) UnmarshalBinary(b []byte) error { + var res DeleteContactOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/sf-gate/sf_gate_client/contacts/get_contacts_parameters.go b/api/sf-gate/sf_gate_client/contacts/get_contacts_parameters.go new file mode 100644 index 0000000..19d2760 --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/get_contacts_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetContactsParams() *GetContactsParams { + var () + return &GetContactsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetContactsParamsWithTimeout creates a new GetContactsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetContactsParamsWithTimeout(timeout time.Duration) *GetContactsParams { + var () + return &GetContactsParams{ + + timeout: timeout, + } +} + +// NewGetContactsParamsWithContext creates a new GetContactsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetContactsParamsWithContext(ctx context.Context) *GetContactsParams { + var () + return &GetContactsParams{ + + Context: ctx, + } +} + +// NewGetContactsParamsWithHTTPClient creates a new GetContactsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetContactsParamsWithHTTPClient(client *http.Client) *GetContactsParams { + var () + 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 { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*ContactID + Taxnexus Id of the Contact to be retrieved + + */ + ContactID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithAccountID adds the accountID to the get contacts params +func (o *GetContactsParams) WithAccountID(accountID *string) *GetContactsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get contacts params +func (o *GetContactsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// 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 +} + +// WithCompanyID adds the companyID to the get contacts params +func (o *GetContactsParams) WithCompanyID(companyID *string) *GetContactsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get contacts params +func (o *GetContactsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// 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 +} + +// 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 +} + +// 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.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.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.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/sf-gate/sf_gate_client/contacts/get_contacts_responses.go b/api/sf-gate/sf_gate_client/contacts/get_contacts_responses.go new file mode 100644 index 0000000..31822ef --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/get_contacts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetContactsOK creates a GetContactsOK with default headers values +func NewGetContactsOK() *GetContactsOK { + return &GetContactsOK{} +} + +/*GetContactsOK handles this case with default header values. + +An array of Contact objects +*/ +type GetContactsOK struct { + Payload *sf_gate_models.ContactResponse +} + +func (o *GetContactsOK) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsOK %+v", 200, o.Payload) +} + +func (o *GetContactsOK) GetPayload() *sf_gate_models.ContactResponse { + return o.Payload +} + +func (o *GetContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetContactsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetContactsUnauthorized) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetContactsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetContactsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetContactsForbidden) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %+v", 403, o.Payload) +} + +func (o *GetContactsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetContactsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetContactsNotFound) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %+v", 404, o.Payload) +} + +func (o *GetContactsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetContactsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetContactsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetContactsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetContactsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetContactsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetContactsInternalServerError) Error() string { + return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetContactsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/contacts/post_contacts_parameters.go b/api/sf-gate/sf_gate_client/contacts/post_contacts_parameters.go new file mode 100644 index 0000000..92083d6 --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/post_contacts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostContactsParams creates a new PostContactsParams object +// with the default values initialized. +func NewPostContactsParams() *PostContactsParams { + var () + return &PostContactsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostContactsParamsWithTimeout creates a new PostContactsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostContactsParamsWithTimeout(timeout time.Duration) *PostContactsParams { + var () + return &PostContactsParams{ + + timeout: timeout, + } +} + +// NewPostContactsParamsWithContext creates a new PostContactsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostContactsParamsWithContext(ctx context.Context) *PostContactsParams { + var () + return &PostContactsParams{ + + Context: ctx, + } +} + +// NewPostContactsParamsWithHTTPClient creates a new PostContactsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostContactsParamsWithHTTPClient(client *http.Client) *PostContactsParams { + var () + 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 *sf_gate_models.ContactRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.ContactRequest) *PostContactsParams { + o.SetContactsRequest(contactsRequest) + return o +} + +// SetContactsRequest adds the contactsRequest to the post contacts params +func (o *PostContactsParams) SetContactsRequest(contactsRequest *sf_gate_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/sf-gate/sf_gate_client/contacts/post_contacts_responses.go b/api/sf-gate/sf_gate_client/contacts/post_contacts_responses.go new file mode 100644 index 0000000..f26e74f --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/post_contacts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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 500: + result := NewPostContactsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostContactsOK creates a PostContactsOK with default headers values +func NewPostContactsOK() *PostContactsOK { + return &PostContactsOK{} +} + +/*PostContactsOK handles this case with default header values. + +An array of Contact objects +*/ +type PostContactsOK struct { + Payload *sf_gate_models.ContactResponse +} + +func (o *PostContactsOK) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsOK %+v", 200, o.Payload) +} + +func (o *PostContactsOK) GetPayload() *sf_gate_models.ContactResponse { + return o.Payload +} + +func (o *PostContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostContactsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostContactsUnauthorized) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostContactsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostContactsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostContactsForbidden) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %+v", 403, o.Payload) +} + +func (o *PostContactsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PostContactsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostContactsNotFound) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %+v", 404, o.Payload) +} + +func (o *PostContactsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PostContactsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostContactsInternalServerError) Error() string { + return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostContactsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/contacts/put_contacts_parameters.go b/api/sf-gate/sf_gate_client/contacts/put_contacts_parameters.go new file mode 100644 index 0000000..c33bb9a --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/put_contacts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutContactsParams creates a new PutContactsParams object +// with the default values initialized. +func NewPutContactsParams() *PutContactsParams { + var () + return &PutContactsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutContactsParamsWithTimeout creates a new PutContactsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutContactsParamsWithTimeout(timeout time.Duration) *PutContactsParams { + var () + return &PutContactsParams{ + + timeout: timeout, + } +} + +// NewPutContactsParamsWithContext creates a new PutContactsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutContactsParamsWithContext(ctx context.Context) *PutContactsParams { + var () + return &PutContactsParams{ + + Context: ctx, + } +} + +// NewPutContactsParamsWithHTTPClient creates a new PutContactsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutContactsParamsWithHTTPClient(client *http.Client) *PutContactsParams { + var () + 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 *sf_gate_models.ContactRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.ContactRequest) *PutContactsParams { + o.SetContactsRequest(contactsRequest) + return o +} + +// SetContactsRequest adds the contactsRequest to the put contacts params +func (o *PutContactsParams) SetContactsRequest(contactsRequest *sf_gate_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/sf-gate/sf_gate_client/contacts/put_contacts_responses.go b/api/sf-gate/sf_gate_client/contacts/put_contacts_responses.go new file mode 100644 index 0000000..41d0a05 --- /dev/null +++ b/api/sf-gate/sf_gate_client/contacts/put_contacts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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 500: + result := NewPutContactsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutContactsOK creates a PutContactsOK with default headers values +func NewPutContactsOK() *PutContactsOK { + return &PutContactsOK{} +} + +/*PutContactsOK handles this case with default header values. + +An array of Contact objects +*/ +type PutContactsOK struct { + Payload *sf_gate_models.ContactResponse +} + +func (o *PutContactsOK) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsOK %+v", 200, o.Payload) +} + +func (o *PutContactsOK) GetPayload() *sf_gate_models.ContactResponse { + return o.Payload +} + +func (o *PutContactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutContactsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutContactsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutContactsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutContactsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutContactsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutContactsForbidden) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsForbidden %+v", 403, o.Payload) +} + +func (o *PutContactsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutContactsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutContactsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutContactsNotFound) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsNotFound %+v", 404, o.Payload) +} + +func (o *PutContactsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutContactsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutContactsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutContactsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /contacts][%d] putContactsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutContactsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutContactsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/counties/counties_client.go b/api/sf-gate/sf_gate_client/counties/counties_client.go new file mode 100644 index 0000000..fd000f1 --- /dev/null +++ b/api/sf-gate/sf_gate_client/counties/counties_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package counties + +// 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 counties API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for counties API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCounties(params *GetCountiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountiesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCounties retrieves counties + + Retrieve Counties, filter with parameters +*/ +func (a *Client) GetCounties(params *GetCountiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountiesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCounties", + Method: "GET", + PathPattern: "/counties", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountiesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountiesOK) + 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 getCounties: 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/sf-gate/sf_gate_client/counties/get_counties_parameters.go b/api/sf-gate/sf_gate_client/counties/get_counties_parameters.go new file mode 100644 index 0000000..75362b9 --- /dev/null +++ b/api/sf-gate/sf_gate_client/counties/get_counties_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package counties + +// 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" +) + +// NewGetCountiesParams creates a new GetCountiesParams object +// with the default values initialized. +func NewGetCountiesParams() *GetCountiesParams { + var () + return &GetCountiesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountiesParamsWithTimeout creates a new GetCountiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountiesParamsWithTimeout(timeout time.Duration) *GetCountiesParams { + var () + return &GetCountiesParams{ + + timeout: timeout, + } +} + +// NewGetCountiesParamsWithContext creates a new GetCountiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountiesParamsWithContext(ctx context.Context) *GetCountiesParams { + var () + return &GetCountiesParams{ + + Context: ctx, + } +} + +// NewGetCountiesParamsWithHTTPClient creates a new GetCountiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountiesParamsWithHTTPClient(client *http.Client) *GetCountiesParams { + var () + return &GetCountiesParams{ + HTTPClient: client, + } +} + +/*GetCountiesParams contains all the parameters to send to the API endpoint +for the get counties operation typically these are written to a http.Request +*/ +type GetCountiesParams struct { + + /*CountyID + The County Taxnexus ID + + */ + CountyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*State + The State or Province abbreviation (2 char) + + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get counties params +func (o *GetCountiesParams) WithTimeout(timeout time.Duration) *GetCountiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get counties params +func (o *GetCountiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get counties params +func (o *GetCountiesParams) WithContext(ctx context.Context) *GetCountiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get counties params +func (o *GetCountiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get counties params +func (o *GetCountiesParams) WithHTTPClient(client *http.Client) *GetCountiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get counties params +func (o *GetCountiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountyID adds the countyID to the get counties params +func (o *GetCountiesParams) WithCountyID(countyID *string) *GetCountiesParams { + o.SetCountyID(countyID) + return o +} + +// SetCountyID adds the countyId to the get counties params +func (o *GetCountiesParams) SetCountyID(countyID *string) { + o.CountyID = countyID +} + +// WithLimit adds the limit to the get counties params +func (o *GetCountiesParams) WithLimit(limit *int64) *GetCountiesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get counties params +func (o *GetCountiesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get counties params +func (o *GetCountiesParams) WithOffset(offset *int64) *GetCountiesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get counties params +func (o *GetCountiesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithState adds the state to the get counties params +func (o *GetCountiesParams) WithState(state *string) *GetCountiesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get counties params +func (o *GetCountiesParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountyID != nil { + + // query param countyId + var qrCountyID string + if o.CountyID != nil { + qrCountyID = *o.CountyID + } + qCountyID := qrCountyID + if qCountyID != "" { + if err := r.SetQueryParam("countyId", qCountyID); 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.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/counties/get_counties_responses.go b/api/sf-gate/sf_gate_client/counties/get_counties_responses.go new file mode 100644 index 0000000..b5c06c0 --- /dev/null +++ b/api/sf-gate/sf_gate_client/counties/get_counties_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package counties + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetCountiesReader is a Reader for the GetCounties structure. +type GetCountiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCountiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCountiesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCountiesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCountiesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCountiesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountiesOK creates a GetCountiesOK with default headers values +func NewGetCountiesOK() *GetCountiesOK { + return &GetCountiesOK{} +} + +/*GetCountiesOK handles this case with default header values. + +Taxnexus Response with an array of County objects +*/ +type GetCountiesOK struct { + Payload *sf_gate_models.CountyResponse +} + +func (o *GetCountiesOK) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesOK %+v", 200, o.Payload) +} + +func (o *GetCountiesOK) GetPayload() *sf_gate_models.CountyResponse { + return o.Payload +} + +func (o *GetCountiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.CountyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesUnauthorized creates a GetCountiesUnauthorized with default headers values +func NewGetCountiesUnauthorized() *GetCountiesUnauthorized { + return &GetCountiesUnauthorized{} +} + +/*GetCountiesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCountiesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountiesUnauthorized) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCountiesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesForbidden creates a GetCountiesForbidden with default headers values +func NewGetCountiesForbidden() *GetCountiesForbidden { + return &GetCountiesForbidden{} +} + +/*GetCountiesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCountiesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountiesForbidden) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesForbidden %+v", 403, o.Payload) +} + +func (o *GetCountiesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesNotFound creates a GetCountiesNotFound with default headers values +func NewGetCountiesNotFound() *GetCountiesNotFound { + return &GetCountiesNotFound{} +} + +/*GetCountiesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCountiesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountiesNotFound) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesNotFound %+v", 404, o.Payload) +} + +func (o *GetCountiesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesUnprocessableEntity creates a GetCountiesUnprocessableEntity with default headers values +func NewGetCountiesUnprocessableEntity() *GetCountiesUnprocessableEntity { + return &GetCountiesUnprocessableEntity{} +} + +/*GetCountiesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCountiesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountiesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCountiesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountiesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountiesInternalServerError creates a GetCountiesInternalServerError with default headers values +func NewGetCountiesInternalServerError() *GetCountiesInternalServerError { + return &GetCountiesInternalServerError{} +} + +/*GetCountiesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCountiesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /counties][%d] getCountiesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCountiesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/countries/countries_client.go b/api/sf-gate/sf_gate_client/countries/countries_client.go new file mode 100644 index 0000000..60f731a --- /dev/null +++ b/api/sf-gate/sf_gate_client/countries/countries_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package countries + +// 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 countries API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for countries API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetCountries(params *GetCountriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountriesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetCountries retrieves countries + + Retrieve Countries, filter with parameters +*/ +func (a *Client) GetCountries(params *GetCountriesParams, authInfo runtime.ClientAuthInfoWriter) (*GetCountriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCountriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getCountries", + Method: "GET", + PathPattern: "/countries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCountriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetCountriesOK) + 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 getCountries: 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/sf-gate/sf_gate_client/countries/get_countries_parameters.go b/api/sf-gate/sf_gate_client/countries/get_countries_parameters.go new file mode 100644 index 0000000..cb925da --- /dev/null +++ b/api/sf-gate/sf_gate_client/countries/get_countries_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package countries + +// 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" +) + +// NewGetCountriesParams creates a new GetCountriesParams object +// with the default values initialized. +func NewGetCountriesParams() *GetCountriesParams { + var () + return &GetCountriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetCountriesParamsWithTimeout creates a new GetCountriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetCountriesParamsWithTimeout(timeout time.Duration) *GetCountriesParams { + var () + return &GetCountriesParams{ + + timeout: timeout, + } +} + +// NewGetCountriesParamsWithContext creates a new GetCountriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetCountriesParamsWithContext(ctx context.Context) *GetCountriesParams { + var () + return &GetCountriesParams{ + + Context: ctx, + } +} + +// NewGetCountriesParamsWithHTTPClient creates a new GetCountriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetCountriesParamsWithHTTPClient(client *http.Client) *GetCountriesParams { + var () + return &GetCountriesParams{ + HTTPClient: client, + } +} + +/*GetCountriesParams contains all the parameters to send to the API endpoint +for the get countries operation typically these are written to a http.Request +*/ +type GetCountriesParams struct { + + /*CountryID + The Country Taxnexus ID + + */ + CountryID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get countries params +func (o *GetCountriesParams) WithTimeout(timeout time.Duration) *GetCountriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get countries params +func (o *GetCountriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get countries params +func (o *GetCountriesParams) WithContext(ctx context.Context) *GetCountriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get countries params +func (o *GetCountriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get countries params +func (o *GetCountriesParams) WithHTTPClient(client *http.Client) *GetCountriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get countries params +func (o *GetCountriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountryID adds the countryID to the get countries params +func (o *GetCountriesParams) WithCountryID(countryID *string) *GetCountriesParams { + o.SetCountryID(countryID) + return o +} + +// SetCountryID adds the countryId to the get countries params +func (o *GetCountriesParams) SetCountryID(countryID *string) { + o.CountryID = countryID +} + +// WithLimit adds the limit to the get countries params +func (o *GetCountriesParams) WithLimit(limit *int64) *GetCountriesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get countries params +func (o *GetCountriesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get countries params +func (o *GetCountriesParams) WithOffset(offset *int64) *GetCountriesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get countries params +func (o *GetCountriesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCountriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CountryID != nil { + + // query param countryId + var qrCountryID string + if o.CountryID != nil { + qrCountryID = *o.CountryID + } + qCountryID := qrCountryID + if qCountryID != "" { + if err := r.SetQueryParam("countryId", qCountryID); 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/sf-gate/sf_gate_client/countries/get_countries_responses.go b/api/sf-gate/sf_gate_client/countries/get_countries_responses.go new file mode 100644 index 0000000..65b58fd --- /dev/null +++ b/api/sf-gate/sf_gate_client/countries/get_countries_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package countries + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetCountriesReader is a Reader for the GetCountries structure. +type GetCountriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCountriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCountriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCountriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCountriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCountriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCountriesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCountriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetCountriesOK creates a GetCountriesOK with default headers values +func NewGetCountriesOK() *GetCountriesOK { + return &GetCountriesOK{} +} + +/*GetCountriesOK handles this case with default header values. + +Taxnexus Response with an array of Country objects +*/ +type GetCountriesOK struct { + Payload *sf_gate_models.CountryResponse +} + +func (o *GetCountriesOK) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesOK %+v", 200, o.Payload) +} + +func (o *GetCountriesOK) GetPayload() *sf_gate_models.CountryResponse { + return o.Payload +} + +func (o *GetCountriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.CountryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesUnauthorized creates a GetCountriesUnauthorized with default headers values +func NewGetCountriesUnauthorized() *GetCountriesUnauthorized { + return &GetCountriesUnauthorized{} +} + +/*GetCountriesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCountriesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountriesUnauthorized) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCountriesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesForbidden creates a GetCountriesForbidden with default headers values +func NewGetCountriesForbidden() *GetCountriesForbidden { + return &GetCountriesForbidden{} +} + +/*GetCountriesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetCountriesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountriesForbidden) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesForbidden %+v", 403, o.Payload) +} + +func (o *GetCountriesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesNotFound creates a GetCountriesNotFound with default headers values +func NewGetCountriesNotFound() *GetCountriesNotFound { + return &GetCountriesNotFound{} +} + +/*GetCountriesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetCountriesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountriesNotFound) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesNotFound %+v", 404, o.Payload) +} + +func (o *GetCountriesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesUnprocessableEntity creates a GetCountriesUnprocessableEntity with default headers values +func NewGetCountriesUnprocessableEntity() *GetCountriesUnprocessableEntity { + return &GetCountriesUnprocessableEntity{} +} + +/*GetCountriesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCountriesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountriesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCountriesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountriesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCountriesInternalServerError creates a GetCountriesInternalServerError with default headers values +func NewGetCountriesInternalServerError() *GetCountriesInternalServerError { + return &GetCountriesInternalServerError{} +} + +/*GetCountriesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetCountriesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetCountriesInternalServerError) Error() string { + return fmt.Sprintf("[GET /countries][%d] getCountriesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCountriesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetCountriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/databases/databases_client.go b/api/sf-gate/sf_gate_client/databases/databases_client.go new file mode 100644 index 0000000..7b498f7 --- /dev/null +++ b/api/sf-gate/sf_gate_client/databases/databases_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package databases + +// 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 databases API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for databases API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*GetDatabasesOK, error) + + PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*PostDatabasesOK, error) + + PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*PutDatabasesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetDatabases gets a list databases + + Return a list of Database records from the datastore +*/ +func (a *Client) GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*GetDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDatabasesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PostDatabases creates new databases + + Create Databases in Taxnexus +*/ +func (a *Client) PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*PostDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostDatabasesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter) (*PutDatabasesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutDatabasesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/databases/get_databases_parameters.go b/api/sf-gate/sf_gate_client/databases/get_databases_parameters.go new file mode 100644 index 0000000..fe26dd9 --- /dev/null +++ b/api/sf-gate/sf_gate_client/databases/get_databases_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package databases + +// 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 values initialized. +func NewGetDatabasesParams() *GetDatabasesParams { + var () + return &GetDatabasesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDatabasesParamsWithTimeout creates a new GetDatabasesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDatabasesParamsWithTimeout(timeout time.Duration) *GetDatabasesParams { + var () + return &GetDatabasesParams{ + + timeout: timeout, + } +} + +// NewGetDatabasesParamsWithContext creates a new GetDatabasesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDatabasesParamsWithContext(ctx context.Context) *GetDatabasesParams { + var () + return &GetDatabasesParams{ + + Context: ctx, + } +} + +// NewGetDatabasesParamsWithHTTPClient creates a new GetDatabasesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDatabasesParamsWithHTTPClient(client *http.Client) *GetDatabasesParams { + var () + 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 + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*DatabaseID + Taxnexus Record Id of a Database + + */ + DatabaseID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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/sf-gate/sf_gate_client/databases/get_databases_responses.go b/api/sf-gate/sf_gate_client/databases/get_databases_responses.go new file mode 100644 index 0000000..1dc0560 --- /dev/null +++ b/api/sf-gate/sf_gate_client/databases/get_databases_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package databases + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetDatabasesOK creates a GetDatabasesOK with default headers values +func NewGetDatabasesOK() *GetDatabasesOK { + return &GetDatabasesOK{} +} + +/*GetDatabasesOK handles this case with default header values. + +Taxnexus Response with Database objects +*/ +type GetDatabasesOK struct { + Payload *sf_gate_models.DatabaseResponse +} + +func (o *GetDatabasesOK) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesOK %+v", 200, o.Payload) +} + +func (o *GetDatabasesOK) GetPayload() *sf_gate_models.DatabaseResponse { + return o.Payload +} + +func (o *GetDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetDatabasesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetDatabasesUnauthorized) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetDatabasesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetDatabasesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetDatabasesForbidden) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesForbidden %+v", 403, o.Payload) +} + +func (o *GetDatabasesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDatabasesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetDatabasesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetDatabasesNotFound) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesNotFound %+v", 404, o.Payload) +} + +func (o *GetDatabasesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDatabasesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDatabasesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetDatabasesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetDatabasesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetDatabasesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetDatabasesInternalServerError) Error() string { + return fmt.Sprintf("[GET /databases][%d] getDatabasesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDatabasesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDatabasesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/databases/post_databases_parameters.go b/api/sf-gate/sf_gate_client/databases/post_databases_parameters.go new file mode 100644 index 0000000..9ffe06d --- /dev/null +++ b/api/sf-gate/sf_gate_client/databases/post_databases_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package databases + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostDatabasesParams creates a new PostDatabasesParams object +// with the default values initialized. +func NewPostDatabasesParams() *PostDatabasesParams { + var () + return &PostDatabasesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostDatabasesParamsWithTimeout creates a new PostDatabasesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostDatabasesParamsWithTimeout(timeout time.Duration) *PostDatabasesParams { + var () + return &PostDatabasesParams{ + + timeout: timeout, + } +} + +// NewPostDatabasesParamsWithContext creates a new PostDatabasesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostDatabasesParamsWithContext(ctx context.Context) *PostDatabasesParams { + var () + return &PostDatabasesParams{ + + Context: ctx, + } +} + +// NewPostDatabasesParamsWithHTTPClient creates a new PostDatabasesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostDatabasesParamsWithHTTPClient(client *http.Client) *PostDatabasesParams { + var () + 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 *sf_gate_models.DatabaseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.DatabaseRequest) *PostDatabasesParams { + o.SetDatabaseRequest(databaseRequest) + return o +} + +// SetDatabaseRequest adds the databaseRequest to the post databases params +func (o *PostDatabasesParams) SetDatabaseRequest(databaseRequest *sf_gate_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/sf-gate/sf_gate_client/databases/post_databases_responses.go b/api/sf-gate/sf_gate_client/databases/post_databases_responses.go new file mode 100644 index 0000000..01d0e58 --- /dev/null +++ b/api/sf-gate/sf_gate_client/databases/post_databases_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package databases + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPostDatabasesOK creates a PostDatabasesOK with default headers values +func NewPostDatabasesOK() *PostDatabasesOK { + return &PostDatabasesOK{} +} + +/*PostDatabasesOK handles this case with default header values. + +Taxnexus Response with Database objects +*/ +type PostDatabasesOK struct { + Payload *sf_gate_models.DatabaseResponse +} + +func (o *PostDatabasesOK) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesOK %+v", 200, o.Payload) +} + +func (o *PostDatabasesOK) GetPayload() *sf_gate_models.DatabaseResponse { + return o.Payload +} + +func (o *PostDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostDatabasesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostDatabasesUnauthorized) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostDatabasesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostDatabasesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostDatabasesForbidden) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesForbidden %+v", 403, o.Payload) +} + +func (o *PostDatabasesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostDatabasesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PostDatabasesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostDatabasesNotFound) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesNotFound %+v", 404, o.Payload) +} + +func (o *PostDatabasesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostDatabasesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostDatabasesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PostDatabasesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostDatabasesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PostDatabasesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostDatabasesInternalServerError) Error() string { + return fmt.Sprintf("[POST /databases][%d] postDatabasesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostDatabasesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostDatabasesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/databases/put_databases_parameters.go b/api/sf-gate/sf_gate_client/databases/put_databases_parameters.go new file mode 100644 index 0000000..01bec49 --- /dev/null +++ b/api/sf-gate/sf_gate_client/databases/put_databases_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package databases + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutDatabasesParams creates a new PutDatabasesParams object +// with the default values initialized. +func NewPutDatabasesParams() *PutDatabasesParams { + var () + return &PutDatabasesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutDatabasesParamsWithTimeout creates a new PutDatabasesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutDatabasesParamsWithTimeout(timeout time.Duration) *PutDatabasesParams { + var () + return &PutDatabasesParams{ + + timeout: timeout, + } +} + +// NewPutDatabasesParamsWithContext creates a new PutDatabasesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutDatabasesParamsWithContext(ctx context.Context) *PutDatabasesParams { + var () + return &PutDatabasesParams{ + + Context: ctx, + } +} + +// NewPutDatabasesParamsWithHTTPClient creates a new PutDatabasesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutDatabasesParamsWithHTTPClient(client *http.Client) *PutDatabasesParams { + var () + 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 *sf_gate_models.DatabaseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.DatabaseRequest) *PutDatabasesParams { + o.SetDatabaseRequest(databaseRequest) + return o +} + +// SetDatabaseRequest adds the databaseRequest to the put databases params +func (o *PutDatabasesParams) SetDatabaseRequest(databaseRequest *sf_gate_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/sf-gate/sf_gate_client/databases/put_databases_responses.go b/api/sf-gate/sf_gate_client/databases/put_databases_responses.go new file mode 100644 index 0000000..3c0c98d --- /dev/null +++ b/api/sf-gate/sf_gate_client/databases/put_databases_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package databases + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPutDatabasesOK creates a PutDatabasesOK with default headers values +func NewPutDatabasesOK() *PutDatabasesOK { + return &PutDatabasesOK{} +} + +/*PutDatabasesOK handles this case with default header values. + +Taxnexus Response with Database objects +*/ +type PutDatabasesOK struct { + Payload *sf_gate_models.DatabaseResponse +} + +func (o *PutDatabasesOK) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesOK %+v", 200, o.Payload) +} + +func (o *PutDatabasesOK) GetPayload() *sf_gate_models.DatabaseResponse { + return o.Payload +} + +func (o *PutDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutDatabasesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutDatabasesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutDatabasesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutDatabasesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutDatabasesForbidden) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesForbidden %+v", 403, o.Payload) +} + +func (o *PutDatabasesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutDatabasesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutDatabasesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutDatabasesNotFound) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesNotFound %+v", 404, o.Payload) +} + +func (o *PutDatabasesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutDatabasesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutDatabasesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PutDatabasesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutDatabasesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutDatabasesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutDatabasesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /databases][%d] putDatabasesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutDatabasesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutDatabasesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/domains/domains_client.go b/api/sf-gate/sf_gate_client/domains/domains_client.go new file mode 100644 index 0000000..5cfe699 --- /dev/null +++ b/api/sf-gate/sf_gate_client/domains/domains_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domains + +// 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 domains API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for domains API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetDomains(params *GetDomainsParams, authInfo runtime.ClientAuthInfoWriter) (*GetDomainsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetDomains gets domain records + + Return all of the Commerce Domains in the Taxnexus system. Domains categorize general categories of commerce, such as Merchandise, Wholesale Goods, Wholesale Trade, Services, etc. +*/ +func (a *Client) GetDomains(params *GetDomainsParams, authInfo runtime.ClientAuthInfoWriter) (*GetDomainsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDomainsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getDomains", + Method: "GET", + PathPattern: "/domains", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDomainsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetDomainsOK) + 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 getDomains: 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/sf-gate/sf_gate_client/domains/get_domains_parameters.go b/api/sf-gate/sf_gate_client/domains/get_domains_parameters.go new file mode 100644 index 0000000..2b3e122 --- /dev/null +++ b/api/sf-gate/sf_gate_client/domains/get_domains_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domains + +// 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" +) + +// NewGetDomainsParams creates a new GetDomainsParams object +// with the default values initialized. +func NewGetDomainsParams() *GetDomainsParams { + var () + return &GetDomainsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetDomainsParamsWithTimeout creates a new GetDomainsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetDomainsParamsWithTimeout(timeout time.Duration) *GetDomainsParams { + var () + return &GetDomainsParams{ + + timeout: timeout, + } +} + +// NewGetDomainsParamsWithContext creates a new GetDomainsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetDomainsParamsWithContext(ctx context.Context) *GetDomainsParams { + var () + return &GetDomainsParams{ + + Context: ctx, + } +} + +// NewGetDomainsParamsWithHTTPClient creates a new GetDomainsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetDomainsParamsWithHTTPClient(client *http.Client) *GetDomainsParams { + var () + return &GetDomainsParams{ + HTTPClient: client, + } +} + +/*GetDomainsParams contains all the parameters to send to the API endpoint +for the get domains operation typically these are written to a http.Request +*/ +type GetDomainsParams struct { + + /*Active + Retrieve only active records? + + */ + Active *bool + /*DomainID + Taxnexus Id of the Domain to be retrieved + + */ + DomainID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Name + The Tax Domain to rate (cannabis, sales or telecom) + + */ + Name *string + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get domains params +func (o *GetDomainsParams) WithTimeout(timeout time.Duration) *GetDomainsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get domains params +func (o *GetDomainsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get domains params +func (o *GetDomainsParams) WithContext(ctx context.Context) *GetDomainsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get domains params +func (o *GetDomainsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get domains params +func (o *GetDomainsParams) WithHTTPClient(client *http.Client) *GetDomainsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get domains params +func (o *GetDomainsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get domains params +func (o *GetDomainsParams) WithActive(active *bool) *GetDomainsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get domains params +func (o *GetDomainsParams) SetActive(active *bool) { + o.Active = active +} + +// WithDomainID adds the domainID to the get domains params +func (o *GetDomainsParams) WithDomainID(domainID *string) *GetDomainsParams { + o.SetDomainID(domainID) + return o +} + +// SetDomainID adds the domainId to the get domains params +func (o *GetDomainsParams) SetDomainID(domainID *string) { + o.DomainID = domainID +} + +// WithLimit adds the limit to the get domains params +func (o *GetDomainsParams) WithLimit(limit *int64) *GetDomainsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get domains params +func (o *GetDomainsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the get domains params +func (o *GetDomainsParams) WithName(name *string) *GetDomainsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get domains params +func (o *GetDomainsParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the get domains params +func (o *GetDomainsParams) WithOffset(offset *int64) *GetDomainsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get domains params +func (o *GetDomainsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDomainsParams) 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.DomainID != nil { + + // query param domainId + var qrDomainID string + if o.DomainID != nil { + qrDomainID = *o.DomainID + } + qDomainID := qrDomainID + if qDomainID != "" { + if err := r.SetQueryParam("domainId", qDomainID); 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/sf-gate/sf_gate_client/domains/get_domains_responses.go b/api/sf-gate/sf_gate_client/domains/get_domains_responses.go new file mode 100644 index 0000000..3bd4074 --- /dev/null +++ b/api/sf-gate/sf_gate_client/domains/get_domains_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package domains + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetDomainsReader is a Reader for the GetDomains structure. +type GetDomainsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDomainsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDomainsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDomainsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetDomainsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetDomainsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetDomainsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDomainsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetDomainsOK creates a GetDomainsOK with default headers values +func NewGetDomainsOK() *GetDomainsOK { + return &GetDomainsOK{} +} + +/*GetDomainsOK handles this case with default header values. + +Taxnexus Response with an array of Domain objects +*/ +type GetDomainsOK struct { + Payload *sf_gate_models.DomainResponse +} + +func (o *GetDomainsOK) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsOK %+v", 200, o.Payload) +} + +func (o *GetDomainsOK) GetPayload() *sf_gate_models.DomainResponse { + return o.Payload +} + +func (o *GetDomainsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.DomainResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsUnauthorized creates a GetDomainsUnauthorized with default headers values +func NewGetDomainsUnauthorized() *GetDomainsUnauthorized { + return &GetDomainsUnauthorized{} +} + +/*GetDomainsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetDomainsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetDomainsUnauthorized) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetDomainsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDomainsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsForbidden creates a GetDomainsForbidden with default headers values +func NewGetDomainsForbidden() *GetDomainsForbidden { + return &GetDomainsForbidden{} +} + +/*GetDomainsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetDomainsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetDomainsForbidden) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsForbidden %+v", 403, o.Payload) +} + +func (o *GetDomainsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDomainsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsNotFound creates a GetDomainsNotFound with default headers values +func NewGetDomainsNotFound() *GetDomainsNotFound { + return &GetDomainsNotFound{} +} + +/*GetDomainsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetDomainsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetDomainsNotFound) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsNotFound %+v", 404, o.Payload) +} + +func (o *GetDomainsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDomainsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsUnprocessableEntity creates a GetDomainsUnprocessableEntity with default headers values +func NewGetDomainsUnprocessableEntity() *GetDomainsUnprocessableEntity { + return &GetDomainsUnprocessableEntity{} +} + +/*GetDomainsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetDomainsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetDomainsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetDomainsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDomainsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainsInternalServerError creates a GetDomainsInternalServerError with default headers values +func NewGetDomainsInternalServerError() *GetDomainsInternalServerError { + return &GetDomainsInternalServerError{} +} + +/*GetDomainsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetDomainsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetDomainsInternalServerError) Error() string { + return fmt.Sprintf("[GET /domains][%d] getDomainsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDomainsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetDomainsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/filing_types/filing_types_client.go b/api/sf-gate/sf_gate_client/filing_types/filing_types_client.go new file mode 100644 index 0000000..980076b --- /dev/null +++ b/api/sf-gate/sf_gate_client/filing_types/filing_types_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_types + +// 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 filing types API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for filing types API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetFilingTypes(params *GetFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingTypesOK, error) + + PostFilingTypes(params *PostFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingTypesOK, error) + + PutFilingTypes(params *PutFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingTypesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetFilingTypes gets a list of filing types + + Return a list of available Regulatory FilingTypes +*/ +func (a *Client) GetFilingTypes(params *GetFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetFilingTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getFilingTypes", + Method: "GET", + PathPattern: "/filingtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetFilingTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetFilingTypesOK) + 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 getFilingTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostFilingTypes creates new filing types + + Create new FilingTypes +*/ +func (a *Client) PostFilingTypes(params *PostFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostFilingTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postFilingTypes", + Method: "POST", + PathPattern: "/filingtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostFilingTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostFilingTypesOK) + 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 postFilingTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutFilingTypes updates a filing type + + Update all the fields in a FilingType record identified by Taxnexus ID +*/ +func (a *Client) PutFilingTypes(params *PutFilingTypesParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutFilingTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putFilingTypes", + Method: "PUT", + PathPattern: "/filingtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutFilingTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutFilingTypesOK) + 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 putFilingTypes: 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/sf-gate/sf_gate_client/filing_types/get_filing_types_parameters.go b/api/sf-gate/sf_gate_client/filing_types/get_filing_types_parameters.go new file mode 100644 index 0000000..246dfc4 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filing_types/get_filing_types_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_types + +// 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" +) + +// NewGetFilingTypesParams creates a new GetFilingTypesParams object +// with the default values initialized. +func NewGetFilingTypesParams() *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetFilingTypesParamsWithTimeout creates a new GetFilingTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetFilingTypesParamsWithTimeout(timeout time.Duration) *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + + timeout: timeout, + } +} + +// NewGetFilingTypesParamsWithContext creates a new GetFilingTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetFilingTypesParamsWithContext(ctx context.Context) *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + + Context: ctx, + } +} + +// NewGetFilingTypesParamsWithHTTPClient creates a new GetFilingTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetFilingTypesParamsWithHTTPClient(client *http.Client) *GetFilingTypesParams { + var () + return &GetFilingTypesParams{ + HTTPClient: client, + } +} + +/*GetFilingTypesParams contains all the parameters to send to the API endpoint +for the get filing types operation typically these are written to a http.Request +*/ +type GetFilingTypesParams struct { + + /*FilingTypeID + Taxnexus Record Id of a Filing + + */ + FilingTypeID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get filing types params +func (o *GetFilingTypesParams) WithTimeout(timeout time.Duration) *GetFilingTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get filing types params +func (o *GetFilingTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get filing types params +func (o *GetFilingTypesParams) WithContext(ctx context.Context) *GetFilingTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get filing types params +func (o *GetFilingTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get filing types params +func (o *GetFilingTypesParams) WithHTTPClient(client *http.Client) *GetFilingTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get filing types params +func (o *GetFilingTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingTypeID adds the filingTypeID to the get filing types params +func (o *GetFilingTypesParams) WithFilingTypeID(filingTypeID *string) *GetFilingTypesParams { + o.SetFilingTypeID(filingTypeID) + return o +} + +// SetFilingTypeID adds the filingTypeId to the get filing types params +func (o *GetFilingTypesParams) SetFilingTypeID(filingTypeID *string) { + o.FilingTypeID = filingTypeID +} + +// WithLimit adds the limit to the get filing types params +func (o *GetFilingTypesParams) WithLimit(limit *int64) *GetFilingTypesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get filing types params +func (o *GetFilingTypesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get filing types params +func (o *GetFilingTypesParams) WithOffset(offset *int64) *GetFilingTypesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get filing types params +func (o *GetFilingTypesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetFilingTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingTypeID != nil { + + // query param filingTypeId + var qrFilingTypeID string + if o.FilingTypeID != nil { + qrFilingTypeID = *o.FilingTypeID + } + qFilingTypeID := qrFilingTypeID + if qFilingTypeID != "" { + if err := r.SetQueryParam("filingTypeId", qFilingTypeID); 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/sf-gate/sf_gate_client/filing_types/get_filing_types_responses.go b/api/sf-gate/sf_gate_client/filing_types/get_filing_types_responses.go new file mode 100644 index 0000000..c8d76a5 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filing_types/get_filing_types_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_types + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetFilingTypesReader is a Reader for the GetFilingTypes structure. +type GetFilingTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetFilingTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetFilingTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetFilingTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetFilingTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetFilingTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetFilingTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetFilingTypesOK creates a GetFilingTypesOK with default headers values +func NewGetFilingTypesOK() *GetFilingTypesOK { + return &GetFilingTypesOK{} +} + +/*GetFilingTypesOK handles this case with default header values. + +Taxnexus Response with an array of FilingType objects +*/ +type GetFilingTypesOK struct { + Payload *sf_gate_models.FilingTypeResponse +} + +func (o *GetFilingTypesOK) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesOK %+v", 200, o.Payload) +} + +func (o *GetFilingTypesOK) GetPayload() *sf_gate_models.FilingTypeResponse { + return o.Payload +} + +func (o *GetFilingTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.FilingTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesUnauthorized creates a GetFilingTypesUnauthorized with default headers values +func NewGetFilingTypesUnauthorized() *GetFilingTypesUnauthorized { + return &GetFilingTypesUnauthorized{} +} + +/*GetFilingTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetFilingTypesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetFilingTypesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesForbidden creates a GetFilingTypesForbidden with default headers values +func NewGetFilingTypesForbidden() *GetFilingTypesForbidden { + return &GetFilingTypesForbidden{} +} + +/*GetFilingTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetFilingTypesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingTypesForbidden) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetFilingTypesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesNotFound creates a GetFilingTypesNotFound with default headers values +func NewGetFilingTypesNotFound() *GetFilingTypesNotFound { + return &GetFilingTypesNotFound{} +} + +/*GetFilingTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetFilingTypesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingTypesNotFound) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetFilingTypesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesUnprocessableEntity creates a GetFilingTypesUnprocessableEntity with default headers values +func NewGetFilingTypesUnprocessableEntity() *GetFilingTypesUnprocessableEntity { + return &GetFilingTypesUnprocessableEntity{} +} + +/*GetFilingTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetFilingTypesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetFilingTypesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingTypesInternalServerError creates a GetFilingTypesInternalServerError with default headers values +func NewGetFilingTypesInternalServerError() *GetFilingTypesInternalServerError { + return &GetFilingTypesInternalServerError{} +} + +/*GetFilingTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetFilingTypesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /filingtypes][%d] getFilingTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetFilingTypesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/filing_types/post_filing_types_parameters.go b/api/sf-gate/sf_gate_client/filing_types/post_filing_types_parameters.go new file mode 100644 index 0000000..baba796 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filing_types/post_filing_types_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_types + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostFilingTypesParams creates a new PostFilingTypesParams object +// with the default values initialized. +func NewPostFilingTypesParams() *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostFilingTypesParamsWithTimeout creates a new PostFilingTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostFilingTypesParamsWithTimeout(timeout time.Duration) *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + + timeout: timeout, + } +} + +// NewPostFilingTypesParamsWithContext creates a new PostFilingTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostFilingTypesParamsWithContext(ctx context.Context) *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + + Context: ctx, + } +} + +// NewPostFilingTypesParamsWithHTTPClient creates a new PostFilingTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostFilingTypesParamsWithHTTPClient(client *http.Client) *PostFilingTypesParams { + var () + return &PostFilingTypesParams{ + HTTPClient: client, + } +} + +/*PostFilingTypesParams contains all the parameters to send to the API endpoint +for the post filing types operation typically these are written to a http.Request +*/ +type PostFilingTypesParams struct { + + /*FilingTypeRequest + A request with an array of FilingType Objects + + */ + FilingTypeRequest *sf_gate_models.FilingTypeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post filing types params +func (o *PostFilingTypesParams) WithTimeout(timeout time.Duration) *PostFilingTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post filing types params +func (o *PostFilingTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post filing types params +func (o *PostFilingTypesParams) WithContext(ctx context.Context) *PostFilingTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post filing types params +func (o *PostFilingTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post filing types params +func (o *PostFilingTypesParams) WithHTTPClient(client *http.Client) *PostFilingTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post filing types params +func (o *PostFilingTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingTypeRequest adds the filingTypeRequest to the post filing types params +func (o *PostFilingTypesParams) WithFilingTypeRequest(filingTypeRequest *sf_gate_models.FilingTypeRequest) *PostFilingTypesParams { + o.SetFilingTypeRequest(filingTypeRequest) + return o +} + +// SetFilingTypeRequest adds the filingTypeRequest to the post filing types params +func (o *PostFilingTypesParams) SetFilingTypeRequest(filingTypeRequest *sf_gate_models.FilingTypeRequest) { + o.FilingTypeRequest = filingTypeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostFilingTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingTypeRequest != nil { + if err := r.SetBodyParam(o.FilingTypeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/filing_types/post_filing_types_responses.go b/api/sf-gate/sf_gate_client/filing_types/post_filing_types_responses.go new file mode 100644 index 0000000..cb15f1c --- /dev/null +++ b/api/sf-gate/sf_gate_client/filing_types/post_filing_types_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_types + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostFilingTypesReader is a Reader for the PostFilingTypes structure. +type PostFilingTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostFilingTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostFilingTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostFilingTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostFilingTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostFilingTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostFilingTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostFilingTypesOK creates a PostFilingTypesOK with default headers values +func NewPostFilingTypesOK() *PostFilingTypesOK { + return &PostFilingTypesOK{} +} + +/*PostFilingTypesOK handles this case with default header values. + +Taxnexus Response with an array of FilingType objects +*/ +type PostFilingTypesOK struct { + Payload *sf_gate_models.FilingTypeResponse +} + +func (o *PostFilingTypesOK) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesOK %+v", 200, o.Payload) +} + +func (o *PostFilingTypesOK) GetPayload() *sf_gate_models.FilingTypeResponse { + return o.Payload +} + +func (o *PostFilingTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.FilingTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesUnauthorized creates a PostFilingTypesUnauthorized with default headers values +func NewPostFilingTypesUnauthorized() *PostFilingTypesUnauthorized { + return &PostFilingTypesUnauthorized{} +} + +/*PostFilingTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostFilingTypesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingTypesUnauthorized) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostFilingTypesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesForbidden creates a PostFilingTypesForbidden with default headers values +func NewPostFilingTypesForbidden() *PostFilingTypesForbidden { + return &PostFilingTypesForbidden{} +} + +/*PostFilingTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostFilingTypesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingTypesForbidden) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesForbidden %+v", 403, o.Payload) +} + +func (o *PostFilingTypesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesNotFound creates a PostFilingTypesNotFound with default headers values +func NewPostFilingTypesNotFound() *PostFilingTypesNotFound { + return &PostFilingTypesNotFound{} +} + +/*PostFilingTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostFilingTypesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingTypesNotFound) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesNotFound %+v", 404, o.Payload) +} + +func (o *PostFilingTypesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesUnprocessableEntity creates a PostFilingTypesUnprocessableEntity with default headers values +func NewPostFilingTypesUnprocessableEntity() *PostFilingTypesUnprocessableEntity { + return &PostFilingTypesUnprocessableEntity{} +} + +/*PostFilingTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostFilingTypesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostFilingTypesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingTypesInternalServerError creates a PostFilingTypesInternalServerError with default headers values +func NewPostFilingTypesInternalServerError() *PostFilingTypesInternalServerError { + return &PostFilingTypesInternalServerError{} +} + +/*PostFilingTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostFilingTypesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingTypesInternalServerError) Error() string { + return fmt.Sprintf("[POST /filingtypes][%d] postFilingTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostFilingTypesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/filing_types/put_filing_types_parameters.go b/api/sf-gate/sf_gate_client/filing_types/put_filing_types_parameters.go new file mode 100644 index 0000000..24e1e0f --- /dev/null +++ b/api/sf-gate/sf_gate_client/filing_types/put_filing_types_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_types + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutFilingTypesParams creates a new PutFilingTypesParams object +// with the default values initialized. +func NewPutFilingTypesParams() *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutFilingTypesParamsWithTimeout creates a new PutFilingTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutFilingTypesParamsWithTimeout(timeout time.Duration) *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + + timeout: timeout, + } +} + +// NewPutFilingTypesParamsWithContext creates a new PutFilingTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutFilingTypesParamsWithContext(ctx context.Context) *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + + Context: ctx, + } +} + +// NewPutFilingTypesParamsWithHTTPClient creates a new PutFilingTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutFilingTypesParamsWithHTTPClient(client *http.Client) *PutFilingTypesParams { + var () + return &PutFilingTypesParams{ + HTTPClient: client, + } +} + +/*PutFilingTypesParams contains all the parameters to send to the API endpoint +for the put filing types operation typically these are written to a http.Request +*/ +type PutFilingTypesParams struct { + + /*FilingTypeRequest + A request with an array of FilingType Objects + + */ + FilingTypeRequest *sf_gate_models.FilingTypeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put filing types params +func (o *PutFilingTypesParams) WithTimeout(timeout time.Duration) *PutFilingTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put filing types params +func (o *PutFilingTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put filing types params +func (o *PutFilingTypesParams) WithContext(ctx context.Context) *PutFilingTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put filing types params +func (o *PutFilingTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put filing types params +func (o *PutFilingTypesParams) WithHTTPClient(client *http.Client) *PutFilingTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put filing types params +func (o *PutFilingTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingTypeRequest adds the filingTypeRequest to the put filing types params +func (o *PutFilingTypesParams) WithFilingTypeRequest(filingTypeRequest *sf_gate_models.FilingTypeRequest) *PutFilingTypesParams { + o.SetFilingTypeRequest(filingTypeRequest) + return o +} + +// SetFilingTypeRequest adds the filingTypeRequest to the put filing types params +func (o *PutFilingTypesParams) SetFilingTypeRequest(filingTypeRequest *sf_gate_models.FilingTypeRequest) { + o.FilingTypeRequest = filingTypeRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutFilingTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingTypeRequest != nil { + if err := r.SetBodyParam(o.FilingTypeRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/filing_types/put_filing_types_responses.go b/api/sf-gate/sf_gate_client/filing_types/put_filing_types_responses.go new file mode 100644 index 0000000..fd049c3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filing_types/put_filing_types_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filing_types + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutFilingTypesReader is a Reader for the PutFilingTypes structure. +type PutFilingTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutFilingTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutFilingTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutFilingTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutFilingTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutFilingTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutFilingTypesOK creates a PutFilingTypesOK with default headers values +func NewPutFilingTypesOK() *PutFilingTypesOK { + return &PutFilingTypesOK{} +} + +/*PutFilingTypesOK handles this case with default header values. + +Taxnexus Response with an array of FilingType objects +*/ +type PutFilingTypesOK struct { + Payload *sf_gate_models.FilingTypeResponse +} + +func (o *PutFilingTypesOK) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesOK %+v", 200, o.Payload) +} + +func (o *PutFilingTypesOK) GetPayload() *sf_gate_models.FilingTypeResponse { + return o.Payload +} + +func (o *PutFilingTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.FilingTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesUnauthorized creates a PutFilingTypesUnauthorized with default headers values +func NewPutFilingTypesUnauthorized() *PutFilingTypesUnauthorized { + return &PutFilingTypesUnauthorized{} +} + +/*PutFilingTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutFilingTypesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingTypesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutFilingTypesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesForbidden creates a PutFilingTypesForbidden with default headers values +func NewPutFilingTypesForbidden() *PutFilingTypesForbidden { + return &PutFilingTypesForbidden{} +} + +/*PutFilingTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutFilingTypesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingTypesForbidden) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesForbidden %+v", 403, o.Payload) +} + +func (o *PutFilingTypesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesNotFound creates a PutFilingTypesNotFound with default headers values +func NewPutFilingTypesNotFound() *PutFilingTypesNotFound { + return &PutFilingTypesNotFound{} +} + +/*PutFilingTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutFilingTypesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingTypesNotFound) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesNotFound %+v", 404, o.Payload) +} + +func (o *PutFilingTypesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingTypesInternalServerError creates a PutFilingTypesInternalServerError with default headers values +func NewPutFilingTypesInternalServerError() *PutFilingTypesInternalServerError { + return &PutFilingTypesInternalServerError{} +} + +/*PutFilingTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutFilingTypesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingTypesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /filingtypes][%d] putFilingTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutFilingTypesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/filings/filings_client.go b/api/sf-gate/sf_gate_client/filings/filings_client.go new file mode 100644 index 0000000..fa0cbbe --- /dev/null +++ b/api/sf-gate/sf_gate_client/filings/filings_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filings + +// 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 filings API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for filings API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetFilings(params *GetFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingsOK, error) + + PostFilings(params *PostFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingsOK, error) + + PutFilings(params *PutFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetFilings gets a list of filings + + Return a list of available Regulatory Filings +*/ +func (a *Client) GetFilings(params *GetFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*GetFilingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetFilingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getFilings", + Method: "GET", + PathPattern: "/filings", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetFilingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetFilingsOK) + 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 getFilings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostFilings creates new filings + + Create new Filings +*/ +func (a *Client) PostFilings(params *PostFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PostFilingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostFilingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postFilings", + Method: "POST", + PathPattern: "/filings", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostFilingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostFilingsOK) + 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 postFilings: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutFilings updates a filing + + Update all the fields in a Filing record identified by Taxnexus ID +*/ +func (a *Client) PutFilings(params *PutFilingsParams, authInfo runtime.ClientAuthInfoWriter) (*PutFilingsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutFilingsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putFilings", + Method: "PUT", + PathPattern: "/filings", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutFilingsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutFilingsOK) + 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 putFilings: 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/sf-gate/sf_gate_client/filings/get_filings_parameters.go b/api/sf-gate/sf_gate_client/filings/get_filings_parameters.go new file mode 100644 index 0000000..e355b44 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filings/get_filings_parameters.go @@ -0,0 +1,343 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filings + +// 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" +) + +// NewGetFilingsParams creates a new GetFilingsParams object +// with the default values initialized. +func NewGetFilingsParams() *GetFilingsParams { + var () + return &GetFilingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetFilingsParamsWithTimeout creates a new GetFilingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetFilingsParamsWithTimeout(timeout time.Duration) *GetFilingsParams { + var () + return &GetFilingsParams{ + + timeout: timeout, + } +} + +// NewGetFilingsParamsWithContext creates a new GetFilingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetFilingsParamsWithContext(ctx context.Context) *GetFilingsParams { + var () + return &GetFilingsParams{ + + Context: ctx, + } +} + +// NewGetFilingsParamsWithHTTPClient creates a new GetFilingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetFilingsParamsWithHTTPClient(client *http.Client) *GetFilingsParams { + var () + return &GetFilingsParams{ + HTTPClient: client, + } +} + +/*GetFilingsParams contains all the parameters to send to the API endpoint +for the get filings operation typically these are written to a http.Request +*/ +type GetFilingsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*FilingID + Taxnexus Id of the Filing to be retrieved + + */ + FilingID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Name + The Tax Domain to rate (cannabis, sales or telecom) + + */ + Name *string + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get filings params +func (o *GetFilingsParams) WithTimeout(timeout time.Duration) *GetFilingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get filings params +func (o *GetFilingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get filings params +func (o *GetFilingsParams) WithContext(ctx context.Context) *GetFilingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get filings params +func (o *GetFilingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get filings params +func (o *GetFilingsParams) WithHTTPClient(client *http.Client) *GetFilingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get filings params +func (o *GetFilingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get filings params +func (o *GetFilingsParams) WithAccountID(accountID *string) *GetFilingsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get filings params +func (o *GetFilingsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get filings params +func (o *GetFilingsParams) WithActive(active *bool) *GetFilingsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get filings params +func (o *GetFilingsParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get filings params +func (o *GetFilingsParams) WithCompanyID(companyID *string) *GetFilingsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get filings params +func (o *GetFilingsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithFilingID adds the filingID to the get filings params +func (o *GetFilingsParams) WithFilingID(filingID *string) *GetFilingsParams { + o.SetFilingID(filingID) + return o +} + +// SetFilingID adds the filingId to the get filings params +func (o *GetFilingsParams) SetFilingID(filingID *string) { + o.FilingID = filingID +} + +// WithLimit adds the limit to the get filings params +func (o *GetFilingsParams) WithLimit(limit *int64) *GetFilingsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get filings params +func (o *GetFilingsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the get filings params +func (o *GetFilingsParams) WithName(name *string) *GetFilingsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get filings params +func (o *GetFilingsParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the get filings params +func (o *GetFilingsParams) WithOffset(offset *int64) *GetFilingsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get filings params +func (o *GetFilingsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetFilingsParams) 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.FilingID != nil { + + // query param filingId + var qrFilingID string + if o.FilingID != nil { + qrFilingID = *o.FilingID + } + qFilingID := qrFilingID + if qFilingID != "" { + if err := r.SetQueryParam("filingId", qFilingID); 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/sf-gate/sf_gate_client/filings/get_filings_responses.go b/api/sf-gate/sf_gate_client/filings/get_filings_responses.go new file mode 100644 index 0000000..0af31c1 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filings/get_filings_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filings + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetFilingsReader is a Reader for the GetFilings structure. +type GetFilingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetFilingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetFilingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetFilingsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetFilingsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetFilingsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetFilingsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetFilingsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetFilingsOK creates a GetFilingsOK with default headers values +func NewGetFilingsOK() *GetFilingsOK { + return &GetFilingsOK{} +} + +/*GetFilingsOK handles this case with default header values. + +Taxnexus Response with an array of Filing objects +*/ +type GetFilingsOK struct { + Payload *sf_gate_models.FilingResponse +} + +func (o *GetFilingsOK) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsOK %+v", 200, o.Payload) +} + +func (o *GetFilingsOK) GetPayload() *sf_gate_models.FilingResponse { + return o.Payload +} + +func (o *GetFilingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.FilingResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsUnauthorized creates a GetFilingsUnauthorized with default headers values +func NewGetFilingsUnauthorized() *GetFilingsUnauthorized { + return &GetFilingsUnauthorized{} +} + +/*GetFilingsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetFilingsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingsUnauthorized) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetFilingsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsForbidden creates a GetFilingsForbidden with default headers values +func NewGetFilingsForbidden() *GetFilingsForbidden { + return &GetFilingsForbidden{} +} + +/*GetFilingsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetFilingsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingsForbidden) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsForbidden %+v", 403, o.Payload) +} + +func (o *GetFilingsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsNotFound creates a GetFilingsNotFound with default headers values +func NewGetFilingsNotFound() *GetFilingsNotFound { + return &GetFilingsNotFound{} +} + +/*GetFilingsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetFilingsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingsNotFound) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsNotFound %+v", 404, o.Payload) +} + +func (o *GetFilingsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsUnprocessableEntity creates a GetFilingsUnprocessableEntity with default headers values +func NewGetFilingsUnprocessableEntity() *GetFilingsUnprocessableEntity { + return &GetFilingsUnprocessableEntity{} +} + +/*GetFilingsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetFilingsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetFilingsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetFilingsInternalServerError creates a GetFilingsInternalServerError with default headers values +func NewGetFilingsInternalServerError() *GetFilingsInternalServerError { + return &GetFilingsInternalServerError{} +} + +/*GetFilingsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetFilingsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetFilingsInternalServerError) Error() string { + return fmt.Sprintf("[GET /filings][%d] getFilingsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetFilingsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetFilingsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/filings/post_filings_parameters.go b/api/sf-gate/sf_gate_client/filings/post_filings_parameters.go new file mode 100644 index 0000000..9f6b7c0 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filings/post_filings_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filings + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostFilingsParams creates a new PostFilingsParams object +// with the default values initialized. +func NewPostFilingsParams() *PostFilingsParams { + var () + return &PostFilingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostFilingsParamsWithTimeout creates a new PostFilingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostFilingsParamsWithTimeout(timeout time.Duration) *PostFilingsParams { + var () + return &PostFilingsParams{ + + timeout: timeout, + } +} + +// NewPostFilingsParamsWithContext creates a new PostFilingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostFilingsParamsWithContext(ctx context.Context) *PostFilingsParams { + var () + return &PostFilingsParams{ + + Context: ctx, + } +} + +// NewPostFilingsParamsWithHTTPClient creates a new PostFilingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostFilingsParamsWithHTTPClient(client *http.Client) *PostFilingsParams { + var () + return &PostFilingsParams{ + HTTPClient: client, + } +} + +/*PostFilingsParams contains all the parameters to send to the API endpoint +for the post filings operation typically these are written to a http.Request +*/ +type PostFilingsParams struct { + + /*FilingRequest + A request with an array of Filing Objects + + */ + FilingRequest *sf_gate_models.FilingRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post filings params +func (o *PostFilingsParams) WithTimeout(timeout time.Duration) *PostFilingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post filings params +func (o *PostFilingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post filings params +func (o *PostFilingsParams) WithContext(ctx context.Context) *PostFilingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post filings params +func (o *PostFilingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post filings params +func (o *PostFilingsParams) WithHTTPClient(client *http.Client) *PostFilingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post filings params +func (o *PostFilingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingRequest adds the filingRequest to the post filings params +func (o *PostFilingsParams) WithFilingRequest(filingRequest *sf_gate_models.FilingRequest) *PostFilingsParams { + o.SetFilingRequest(filingRequest) + return o +} + +// SetFilingRequest adds the filingRequest to the post filings params +func (o *PostFilingsParams) SetFilingRequest(filingRequest *sf_gate_models.FilingRequest) { + o.FilingRequest = filingRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostFilingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingRequest != nil { + if err := r.SetBodyParam(o.FilingRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/filings/post_filings_responses.go b/api/sf-gate/sf_gate_client/filings/post_filings_responses.go new file mode 100644 index 0000000..070bbd6 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filings/post_filings_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filings + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostFilingsReader is a Reader for the PostFilings structure. +type PostFilingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostFilingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostFilingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostFilingsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostFilingsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostFilingsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostFilingsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostFilingsOK creates a PostFilingsOK with default headers values +func NewPostFilingsOK() *PostFilingsOK { + return &PostFilingsOK{} +} + +/*PostFilingsOK handles this case with default header values. + +Taxnexus Response with an array of Filing objects +*/ +type PostFilingsOK struct { + Payload *sf_gate_models.FilingResponse +} + +func (o *PostFilingsOK) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsOK %+v", 200, o.Payload) +} + +func (o *PostFilingsOK) GetPayload() *sf_gate_models.FilingResponse { + return o.Payload +} + +func (o *PostFilingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.FilingResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsUnauthorized creates a PostFilingsUnauthorized with default headers values +func NewPostFilingsUnauthorized() *PostFilingsUnauthorized { + return &PostFilingsUnauthorized{} +} + +/*PostFilingsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostFilingsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingsUnauthorized) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostFilingsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsForbidden creates a PostFilingsForbidden with default headers values +func NewPostFilingsForbidden() *PostFilingsForbidden { + return &PostFilingsForbidden{} +} + +/*PostFilingsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostFilingsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingsForbidden) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsForbidden %+v", 403, o.Payload) +} + +func (o *PostFilingsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsNotFound creates a PostFilingsNotFound with default headers values +func NewPostFilingsNotFound() *PostFilingsNotFound { + return &PostFilingsNotFound{} +} + +/*PostFilingsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostFilingsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingsNotFound) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsNotFound %+v", 404, o.Payload) +} + +func (o *PostFilingsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostFilingsInternalServerError creates a PostFilingsInternalServerError with default headers values +func NewPostFilingsInternalServerError() *PostFilingsInternalServerError { + return &PostFilingsInternalServerError{} +} + +/*PostFilingsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostFilingsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostFilingsInternalServerError) Error() string { + return fmt.Sprintf("[POST /filings][%d] postFilingsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostFilingsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostFilingsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/filings/put_filings_parameters.go b/api/sf-gate/sf_gate_client/filings/put_filings_parameters.go new file mode 100644 index 0000000..48a90d4 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filings/put_filings_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filings + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutFilingsParams creates a new PutFilingsParams object +// with the default values initialized. +func NewPutFilingsParams() *PutFilingsParams { + var () + return &PutFilingsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutFilingsParamsWithTimeout creates a new PutFilingsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutFilingsParamsWithTimeout(timeout time.Duration) *PutFilingsParams { + var () + return &PutFilingsParams{ + + timeout: timeout, + } +} + +// NewPutFilingsParamsWithContext creates a new PutFilingsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutFilingsParamsWithContext(ctx context.Context) *PutFilingsParams { + var () + return &PutFilingsParams{ + + Context: ctx, + } +} + +// NewPutFilingsParamsWithHTTPClient creates a new PutFilingsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutFilingsParamsWithHTTPClient(client *http.Client) *PutFilingsParams { + var () + return &PutFilingsParams{ + HTTPClient: client, + } +} + +/*PutFilingsParams contains all the parameters to send to the API endpoint +for the put filings operation typically these are written to a http.Request +*/ +type PutFilingsParams struct { + + /*FilingRequest + A request with an array of Filing Objects + + */ + FilingRequest *sf_gate_models.FilingRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put filings params +func (o *PutFilingsParams) WithTimeout(timeout time.Duration) *PutFilingsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put filings params +func (o *PutFilingsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put filings params +func (o *PutFilingsParams) WithContext(ctx context.Context) *PutFilingsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put filings params +func (o *PutFilingsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put filings params +func (o *PutFilingsParams) WithHTTPClient(client *http.Client) *PutFilingsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put filings params +func (o *PutFilingsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFilingRequest adds the filingRequest to the put filings params +func (o *PutFilingsParams) WithFilingRequest(filingRequest *sf_gate_models.FilingRequest) *PutFilingsParams { + o.SetFilingRequest(filingRequest) + return o +} + +// SetFilingRequest adds the filingRequest to the put filings params +func (o *PutFilingsParams) SetFilingRequest(filingRequest *sf_gate_models.FilingRequest) { + o.FilingRequest = filingRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutFilingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilingRequest != nil { + if err := r.SetBodyParam(o.FilingRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/filings/put_filings_responses.go b/api/sf-gate/sf_gate_client/filings/put_filings_responses.go new file mode 100644 index 0000000..3978b23 --- /dev/null +++ b/api/sf-gate/sf_gate_client/filings/put_filings_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package filings + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutFilingsReader is a Reader for the PutFilings structure. +type PutFilingsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutFilingsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutFilingsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutFilingsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutFilingsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutFilingsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutFilingsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutFilingsOK creates a PutFilingsOK with default headers values +func NewPutFilingsOK() *PutFilingsOK { + return &PutFilingsOK{} +} + +/*PutFilingsOK handles this case with default header values. + +Taxnexus Response with an array of Filing objects +*/ +type PutFilingsOK struct { + Payload *sf_gate_models.FilingResponse +} + +func (o *PutFilingsOK) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsOK %+v", 200, o.Payload) +} + +func (o *PutFilingsOK) GetPayload() *sf_gate_models.FilingResponse { + return o.Payload +} + +func (o *PutFilingsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.FilingResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsUnauthorized creates a PutFilingsUnauthorized with default headers values +func NewPutFilingsUnauthorized() *PutFilingsUnauthorized { + return &PutFilingsUnauthorized{} +} + +/*PutFilingsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutFilingsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutFilingsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsForbidden creates a PutFilingsForbidden with default headers values +func NewPutFilingsForbidden() *PutFilingsForbidden { + return &PutFilingsForbidden{} +} + +/*PutFilingsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutFilingsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingsForbidden) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsForbidden %+v", 403, o.Payload) +} + +func (o *PutFilingsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsNotFound creates a PutFilingsNotFound with default headers values +func NewPutFilingsNotFound() *PutFilingsNotFound { + return &PutFilingsNotFound{} +} + +/*PutFilingsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutFilingsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingsNotFound) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsNotFound %+v", 404, o.Payload) +} + +func (o *PutFilingsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutFilingsInternalServerError creates a PutFilingsInternalServerError with default headers values +func NewPutFilingsInternalServerError() *PutFilingsInternalServerError { + return &PutFilingsInternalServerError{} +} + +/*PutFilingsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutFilingsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutFilingsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /filings][%d] putFilingsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutFilingsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutFilingsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_parameters.go b/api/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_parameters.go new file mode 100644 index 0000000..ec5494d --- /dev/null +++ b/api/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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" +) + +// NewGetGlAccountsParams creates a new GetGlAccountsParams object +// with the default values initialized. +func NewGetGlAccountsParams() *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetGlAccountsParamsWithTimeout creates a new GetGlAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetGlAccountsParamsWithTimeout(timeout time.Duration) *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + + timeout: timeout, + } +} + +// NewGetGlAccountsParamsWithContext creates a new GetGlAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetGlAccountsParamsWithContext(ctx context.Context) *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + + Context: ctx, + } +} + +// NewGetGlAccountsParamsWithHTTPClient creates a new GetGlAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetGlAccountsParamsWithHTTPClient(client *http.Client) *GetGlAccountsParams { + var () + return &GetGlAccountsParams{ + HTTPClient: client, + } +} + +/*GetGlAccountsParams contains all the parameters to send to the API endpoint +for the get gl accounts operation typically these are written to a http.Request +*/ +type GetGlAccountsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get gl accounts params +func (o *GetGlAccountsParams) WithTimeout(timeout time.Duration) *GetGlAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get gl accounts params +func (o *GetGlAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get gl accounts params +func (o *GetGlAccountsParams) WithContext(ctx context.Context) *GetGlAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get gl accounts params +func (o *GetGlAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get gl accounts params +func (o *GetGlAccountsParams) WithHTTPClient(client *http.Client) *GetGlAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get gl accounts params +func (o *GetGlAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get gl accounts params +func (o *GetGlAccountsParams) WithAccountID(accountID *string) *GetGlAccountsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get gl accounts params +func (o *GetGlAccountsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithLimit adds the limit to the get gl accounts params +func (o *GetGlAccountsParams) WithLimit(limit *int64) *GetGlAccountsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get gl accounts params +func (o *GetGlAccountsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get gl accounts params +func (o *GetGlAccountsParams) WithOffset(offset *int64) *GetGlAccountsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get gl accounts params +func (o *GetGlAccountsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetGlAccountsParams) 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.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/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_responses.go b/api/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_responses.go new file mode 100644 index 0000000..19638de --- /dev/null +++ b/api/sf-gate/sf_gate_client/gl_accounts/get_gl_accounts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetGlAccountsReader is a Reader for the GetGlAccounts structure. +type GetGlAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetGlAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetGlAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetGlAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetGlAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetGlAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetGlAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetGlAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetGlAccountsOK creates a GetGlAccountsOK with default headers values +func NewGetGlAccountsOK() *GetGlAccountsOK { + return &GetGlAccountsOK{} +} + +/*GetGlAccountsOK handles this case with default header values. + +An array of GL Account Objects +*/ +type GetGlAccountsOK struct { + Payload *sf_gate_models.GlAccountResponse +} + +func (o *GetGlAccountsOK) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsOK %+v", 200, o.Payload) +} + +func (o *GetGlAccountsOK) GetPayload() *sf_gate_models.GlAccountResponse { + return o.Payload +} + +func (o *GetGlAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.GlAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsUnauthorized creates a GetGlAccountsUnauthorized with default headers values +func NewGetGlAccountsUnauthorized() *GetGlAccountsUnauthorized { + return &GetGlAccountsUnauthorized{} +} + +/*GetGlAccountsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetGlAccountsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetGlAccountsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsForbidden creates a GetGlAccountsForbidden with default headers values +func NewGetGlAccountsForbidden() *GetGlAccountsForbidden { + return &GetGlAccountsForbidden{} +} + +/*GetGlAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetGlAccountsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlAccountsForbidden) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsForbidden %+v", 403, o.Payload) +} + +func (o *GetGlAccountsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsNotFound creates a GetGlAccountsNotFound with default headers values +func NewGetGlAccountsNotFound() *GetGlAccountsNotFound { + return &GetGlAccountsNotFound{} +} + +/*GetGlAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetGlAccountsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsNotFound %+v", 404, o.Payload) +} + +func (o *GetGlAccountsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsUnprocessableEntity creates a GetGlAccountsUnprocessableEntity with default headers values +func NewGetGlAccountsUnprocessableEntity() *GetGlAccountsUnprocessableEntity { + return &GetGlAccountsUnprocessableEntity{} +} + +/*GetGlAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetGlAccountsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetGlAccountsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlAccountsInternalServerError creates a GetGlAccountsInternalServerError with default headers values +func NewGetGlAccountsInternalServerError() *GetGlAccountsInternalServerError { + return &GetGlAccountsInternalServerError{} +} + +/*GetGlAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetGlAccountsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlAccountsInternalServerError) Error() string { + return fmt.Sprintf("[GET /glaccounts][%d] getGlAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetGlAccountsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/gl_accounts/gl_accounts_client.go b/api/sf-gate/sf_gate_client/gl_accounts/gl_accounts_client.go new file mode 100644 index 0000000..5a58ef8 --- /dev/null +++ b/api/sf-gate/sf_gate_client/gl_accounts/gl_accounts_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_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 gl accounts API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for gl accounts API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetGlAccounts(params *GetGlAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlAccountsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetGlAccounts gets a list of general ledger accounts + + Return a list of available General Ledger Accounts +*/ +func (a *Client) GetGlAccounts(params *GetGlAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetGlAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getGlAccounts", + Method: "GET", + PathPattern: "/glaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetGlAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetGlAccountsOK) + 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 getGlAccounts: 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/sf-gate/sf_gate_client/gl_balances/get_gl_balances_parameters.go b/api/sf-gate/sf_gate_client/gl_balances/get_gl_balances_parameters.go new file mode 100644 index 0000000..fed9a5a --- /dev/null +++ b/api/sf-gate/sf_gate_client/gl_balances/get_gl_balances_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balances + +// 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" +) + +// NewGetGlBalancesParams creates a new GetGlBalancesParams object +// with the default values initialized. +func NewGetGlBalancesParams() *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetGlBalancesParamsWithTimeout creates a new GetGlBalancesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetGlBalancesParamsWithTimeout(timeout time.Duration) *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + + timeout: timeout, + } +} + +// NewGetGlBalancesParamsWithContext creates a new GetGlBalancesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetGlBalancesParamsWithContext(ctx context.Context) *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + + Context: ctx, + } +} + +// NewGetGlBalancesParamsWithHTTPClient creates a new GetGlBalancesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetGlBalancesParamsWithHTTPClient(client *http.Client) *GetGlBalancesParams { + var () + return &GetGlBalancesParams{ + HTTPClient: client, + } +} + +/*GetGlBalancesParams contains all the parameters to send to the API endpoint +for the get gl balances operation typically these are written to a http.Request +*/ +type GetGlBalancesParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get gl balances params +func (o *GetGlBalancesParams) WithTimeout(timeout time.Duration) *GetGlBalancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get gl balances params +func (o *GetGlBalancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get gl balances params +func (o *GetGlBalancesParams) WithContext(ctx context.Context) *GetGlBalancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get gl balances params +func (o *GetGlBalancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get gl balances params +func (o *GetGlBalancesParams) WithHTTPClient(client *http.Client) *GetGlBalancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get gl balances params +func (o *GetGlBalancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get gl balances params +func (o *GetGlBalancesParams) WithAccountID(accountID *string) *GetGlBalancesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get gl balances params +func (o *GetGlBalancesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithLimit adds the limit to the get gl balances params +func (o *GetGlBalancesParams) WithLimit(limit *int64) *GetGlBalancesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get gl balances params +func (o *GetGlBalancesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get gl balances params +func (o *GetGlBalancesParams) WithOffset(offset *int64) *GetGlBalancesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get gl balances params +func (o *GetGlBalancesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetGlBalancesParams) 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.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/sf-gate/sf_gate_client/gl_balances/get_gl_balances_responses.go b/api/sf-gate/sf_gate_client/gl_balances/get_gl_balances_responses.go new file mode 100644 index 0000000..1d7df87 --- /dev/null +++ b/api/sf-gate/sf_gate_client/gl_balances/get_gl_balances_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balances + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetGlBalancesReader is a Reader for the GetGlBalances structure. +type GetGlBalancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetGlBalancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetGlBalancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetGlBalancesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetGlBalancesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetGlBalancesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetGlBalancesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetGlBalancesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetGlBalancesOK creates a GetGlBalancesOK with default headers values +func NewGetGlBalancesOK() *GetGlBalancesOK { + return &GetGlBalancesOK{} +} + +/*GetGlBalancesOK handles this case with default header values. + +An array of GL Balance Objects +*/ +type GetGlBalancesOK struct { + Payload *sf_gate_models.GlBalanceResponse +} + +func (o *GetGlBalancesOK) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesOK %+v", 200, o.Payload) +} + +func (o *GetGlBalancesOK) GetPayload() *sf_gate_models.GlBalanceResponse { + return o.Payload +} + +func (o *GetGlBalancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.GlBalanceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesUnauthorized creates a GetGlBalancesUnauthorized with default headers values +func NewGetGlBalancesUnauthorized() *GetGlBalancesUnauthorized { + return &GetGlBalancesUnauthorized{} +} + +/*GetGlBalancesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetGlBalancesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlBalancesUnauthorized) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetGlBalancesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlBalancesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesForbidden creates a GetGlBalancesForbidden with default headers values +func NewGetGlBalancesForbidden() *GetGlBalancesForbidden { + return &GetGlBalancesForbidden{} +} + +/*GetGlBalancesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetGlBalancesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlBalancesForbidden) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesForbidden %+v", 403, o.Payload) +} + +func (o *GetGlBalancesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlBalancesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesNotFound creates a GetGlBalancesNotFound with default headers values +func NewGetGlBalancesNotFound() *GetGlBalancesNotFound { + return &GetGlBalancesNotFound{} +} + +/*GetGlBalancesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetGlBalancesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlBalancesNotFound) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesNotFound %+v", 404, o.Payload) +} + +func (o *GetGlBalancesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlBalancesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesUnprocessableEntity creates a GetGlBalancesUnprocessableEntity with default headers values +func NewGetGlBalancesUnprocessableEntity() *GetGlBalancesUnprocessableEntity { + return &GetGlBalancesUnprocessableEntity{} +} + +/*GetGlBalancesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetGlBalancesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlBalancesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetGlBalancesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlBalancesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGlBalancesInternalServerError creates a GetGlBalancesInternalServerError with default headers values +func NewGetGlBalancesInternalServerError() *GetGlBalancesInternalServerError { + return &GetGlBalancesInternalServerError{} +} + +/*GetGlBalancesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetGlBalancesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetGlBalancesInternalServerError) Error() string { + return fmt.Sprintf("[GET /glbalances][%d] getGlBalancesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetGlBalancesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetGlBalancesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/gl_balances/gl_balances_client.go b/api/sf-gate/sf_gate_client/gl_balances/gl_balances_client.go new file mode 100644 index 0000000..bfe43e3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/gl_balances/gl_balances_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package gl_balances + +// 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 gl balances API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for gl balances API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetGlBalances(params *GetGlBalancesParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlBalancesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetGlBalances gets a list of general ledger account balances + + Return a list of General Ledger Account Balances for a Taxnexus Account +*/ +func (a *Client) GetGlBalances(params *GetGlBalancesParams, authInfo runtime.ClientAuthInfoWriter) (*GetGlBalancesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetGlBalancesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getGlBalances", + Method: "GET", + PathPattern: "/glbalances", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetGlBalancesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetGlBalancesOK) + 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 getGlBalances: 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/sf-gate/sf_gate_client/ingests/get_ingests_parameters.go b/api/sf-gate/sf_gate_client/ingests/get_ingests_parameters.go new file mode 100644 index 0000000..92c5b6e --- /dev/null +++ b/api/sf-gate/sf_gate_client/ingests/get_ingests_parameters.go @@ -0,0 +1,343 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingests + +// 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 values initialized. +func NewGetIngestsParams() *GetIngestsParams { + var () + return &GetIngestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetIngestsParamsWithTimeout creates a new GetIngestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetIngestsParamsWithTimeout(timeout time.Duration) *GetIngestsParams { + var () + return &GetIngestsParams{ + + timeout: timeout, + } +} + +// NewGetIngestsParamsWithContext creates a new GetIngestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetIngestsParamsWithContext(ctx context.Context) *GetIngestsParams { + var () + return &GetIngestsParams{ + + Context: ctx, + } +} + +// NewGetIngestsParamsWithHTTPClient creates a new GetIngestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetIngestsParamsWithHTTPClient(client *http.Client) *GetIngestsParams { + var () + 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 + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*AccountNumber + The Taxnexus Account Number of the Account to be used a record retrieval + + */ + AccountNumber *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*IngestID + Taxnexus Record Id of an Ingest + + */ + IngestID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithAccountNumber adds the accountNumber to the get ingests params +func (o *GetIngestsParams) WithAccountNumber(accountNumber *string) *GetIngestsParams { + o.SetAccountNumber(accountNumber) + return o +} + +// SetAccountNumber adds the accountNumber to the get ingests params +func (o *GetIngestsParams) SetAccountNumber(accountNumber *string) { + o.AccountNumber = accountNumber +} + +// WithActive adds the active to the get ingests params +func (o *GetIngestsParams) WithActive(active *bool) *GetIngestsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get ingests params +func (o *GetIngestsParams) SetActive(active *bool) { + o.Active = active +} + +// 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.AccountNumber != nil { + + // query param accountNumber + var qrAccountNumber string + if o.AccountNumber != nil { + qrAccountNumber = *o.AccountNumber + } + qAccountNumber := qrAccountNumber + if qAccountNumber != "" { + if err := r.SetQueryParam("accountNumber", qAccountNumber); 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.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/sf-gate/sf_gate_client/ingests/get_ingests_responses.go b/api/sf-gate/sf_gate_client/ingests/get_ingests_responses.go new file mode 100644 index 0000000..54a6922 --- /dev/null +++ b/api/sf-gate/sf_gate_client/ingests/get_ingests_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingests + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetIngestsOK creates a GetIngestsOK with default headers values +func NewGetIngestsOK() *GetIngestsOK { + return &GetIngestsOK{} +} + +/*GetIngestsOK handles this case with default header values. + +Taxnexus Response with Ingest objects +*/ +type GetIngestsOK struct { + Payload *sf_gate_models.IngestResponse +} + +func (o *GetIngestsOK) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsOK %+v", 200, o.Payload) +} + +func (o *GetIngestsOK) GetPayload() *sf_gate_models.IngestResponse { + return o.Payload +} + +func (o *GetIngestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetIngestsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetIngestsUnauthorized) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetIngestsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetIngestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetIngestsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetIngestsForbidden) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsForbidden %+v", 403, o.Payload) +} + +func (o *GetIngestsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetIngestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetIngestsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetIngestsNotFound) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsNotFound %+v", 404, o.Payload) +} + +func (o *GetIngestsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetIngestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetIngestsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetIngestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetIngestsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetIngestsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetIngestsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetIngestsInternalServerError) Error() string { + return fmt.Sprintf("[GET /ingests][%d] getIngestsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetIngestsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetIngestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/ingests/ingests_client.go b/api/sf-gate/sf_gate_client/ingests/ingests_client.go new file mode 100644 index 0000000..a688d54 --- /dev/null +++ b/api/sf-gate/sf_gate_client/ingests/ingests_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingests + +// 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 ingests API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for ingests API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetIngests(params *GetIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetIngestsOK, error) + + PostIngests(params *PostIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*PostIngestsOK, error) + + PutIngests(params *PutIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*PutIngestsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetIngests gets a list ingests + + Return a list of Print-Ready Ingest records +*/ +func (a *Client) GetIngests(params *GetIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*GetIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetIngestsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PostIngests updates ingests + + Update Ingests +*/ +func (a *Client) PostIngests(params *PostIngestsParams, authInfo runtime.ClientAuthInfoWriter) (*PostIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostIngestsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*PutIngestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutIngestsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/ingests/post_ingests_parameters.go b/api/sf-gate/sf_gate_client/ingests/post_ingests_parameters.go new file mode 100644 index 0000000..f3b0383 --- /dev/null +++ b/api/sf-gate/sf_gate_client/ingests/post_ingests_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingests + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostIngestsParams creates a new PostIngestsParams object +// with the default values initialized. +func NewPostIngestsParams() *PostIngestsParams { + var () + return &PostIngestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostIngestsParamsWithTimeout creates a new PostIngestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostIngestsParamsWithTimeout(timeout time.Duration) *PostIngestsParams { + var () + return &PostIngestsParams{ + + timeout: timeout, + } +} + +// NewPostIngestsParamsWithContext creates a new PostIngestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostIngestsParamsWithContext(ctx context.Context) *PostIngestsParams { + var () + return &PostIngestsParams{ + + Context: ctx, + } +} + +// NewPostIngestsParamsWithHTTPClient creates a new PostIngestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostIngestsParamsWithHTTPClient(client *http.Client) *PostIngestsParams { + var () + 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 new Ingest records + + */ + IngestRequest *sf_gate_models.IngestRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.IngestRequest) *PostIngestsParams { + o.SetIngestRequest(ingestRequest) + return o +} + +// SetIngestRequest adds the ingestRequest to the post ingests params +func (o *PostIngestsParams) SetIngestRequest(ingestRequest *sf_gate_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/sf-gate/sf_gate_client/ingests/post_ingests_responses.go b/api/sf-gate/sf_gate_client/ingests/post_ingests_responses.go new file mode 100644 index 0000000..259a386 --- /dev/null +++ b/api/sf-gate/sf_gate_client/ingests/post_ingests_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingests + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPostIngestsOK creates a PostIngestsOK with default headers values +func NewPostIngestsOK() *PostIngestsOK { + return &PostIngestsOK{} +} + +/*PostIngestsOK handles this case with default header values. + +Taxnexus Response with Ingest objects +*/ +type PostIngestsOK struct { + Payload *sf_gate_models.IngestResponse +} + +func (o *PostIngestsOK) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsOK %+v", 200, o.Payload) +} + +func (o *PostIngestsOK) GetPayload() *sf_gate_models.IngestResponse { + return o.Payload +} + +func (o *PostIngestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostIngestsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostIngestsUnauthorized) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostIngestsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostIngestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostIngestsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostIngestsForbidden) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsForbidden %+v", 403, o.Payload) +} + +func (o *PostIngestsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostIngestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PostIngestsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostIngestsNotFound) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsNotFound %+v", 404, o.Payload) +} + +func (o *PostIngestsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostIngestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostIngestsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PostIngestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostIngestsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostIngestsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PostIngestsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostIngestsInternalServerError) Error() string { + return fmt.Sprintf("[POST /ingests][%d] postIngestsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostIngestsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostIngestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/ingests/put_ingests_parameters.go b/api/sf-gate/sf_gate_client/ingests/put_ingests_parameters.go new file mode 100644 index 0000000..4ddb94a --- /dev/null +++ b/api/sf-gate/sf_gate_client/ingests/put_ingests_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingests + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutIngestsParams creates a new PutIngestsParams object +// with the default values initialized. +func NewPutIngestsParams() *PutIngestsParams { + var () + return &PutIngestsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutIngestsParamsWithTimeout creates a new PutIngestsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutIngestsParamsWithTimeout(timeout time.Duration) *PutIngestsParams { + var () + return &PutIngestsParams{ + + timeout: timeout, + } +} + +// NewPutIngestsParamsWithContext creates a new PutIngestsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutIngestsParamsWithContext(ctx context.Context) *PutIngestsParams { + var () + return &PutIngestsParams{ + + Context: ctx, + } +} + +// NewPutIngestsParamsWithHTTPClient creates a new PutIngestsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutIngestsParamsWithHTTPClient(client *http.Client) *PutIngestsParams { + var () + 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 new Ingest records + + */ + IngestRequest *sf_gate_models.IngestRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.IngestRequest) *PutIngestsParams { + o.SetIngestRequest(ingestRequest) + return o +} + +// SetIngestRequest adds the ingestRequest to the put ingests params +func (o *PutIngestsParams) SetIngestRequest(ingestRequest *sf_gate_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/sf-gate/sf_gate_client/ingests/put_ingests_responses.go b/api/sf-gate/sf_gate_client/ingests/put_ingests_responses.go new file mode 100644 index 0000000..640080e --- /dev/null +++ b/api/sf-gate/sf_gate_client/ingests/put_ingests_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package ingests + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPutIngestsOK creates a PutIngestsOK with default headers values +func NewPutIngestsOK() *PutIngestsOK { + return &PutIngestsOK{} +} + +/*PutIngestsOK handles this case with default header values. + +Taxnexus Response with Ingest objects +*/ +type PutIngestsOK struct { + Payload *sf_gate_models.IngestResponse +} + +func (o *PutIngestsOK) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsOK %+v", 200, o.Payload) +} + +func (o *PutIngestsOK) GetPayload() *sf_gate_models.IngestResponse { + return o.Payload +} + +func (o *PutIngestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutIngestsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutIngestsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutIngestsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutIngestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutIngestsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutIngestsForbidden) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsForbidden %+v", 403, o.Payload) +} + +func (o *PutIngestsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutIngestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutIngestsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutIngestsNotFound) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsNotFound %+v", 404, o.Payload) +} + +func (o *PutIngestsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutIngestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutIngestsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PutIngestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutIngestsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutIngestsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutIngestsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutIngestsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /ingests][%d] putIngestsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutIngestsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutIngestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/invoices/get_invoices_parameters.go b/api/sf-gate/sf_gate_client/invoices/get_invoices_parameters.go new file mode 100644 index 0000000..b3a14cc --- /dev/null +++ b/api/sf-gate/sf_gate_client/invoices/get_invoices_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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" +) + +// NewGetInvoicesParams creates a new GetInvoicesParams object +// with the default values initialized. +func NewGetInvoicesParams() *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetInvoicesParamsWithTimeout creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetInvoicesParamsWithTimeout(timeout time.Duration) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: timeout, + } +} + +// NewGetInvoicesParamsWithContext creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetInvoicesParamsWithContext(ctx context.Context) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + Context: ctx, + } +} + +// NewGetInvoicesParamsWithHTTPClient creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetInvoicesParamsWithHTTPClient(client *http.Client) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + HTTPClient: client, + } +} + +/*GetInvoicesParams contains all the parameters to send to the API endpoint +for the get invoices operation typically these are written to a http.Request +*/ +type GetInvoicesParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*InvoiceID + Taxnexus Id of the Invoice to be retrieved + + */ + InvoiceID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) WithTimeout(timeout time.Duration) *GetInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get invoices params +func (o *GetInvoicesParams) WithContext(ctx context.Context) *GetInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get invoices params +func (o *GetInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) WithHTTPClient(client *http.Client) *GetInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get invoices params +func (o *GetInvoicesParams) WithAccountID(accountID *string) *GetInvoicesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get invoices params +func (o *GetInvoicesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get invoices params +func (o *GetInvoicesParams) WithActive(active *bool) *GetInvoicesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get invoices params +func (o *GetInvoicesParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get invoices params +func (o *GetInvoicesParams) WithCompanyID(companyID *string) *GetInvoicesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get invoices params +func (o *GetInvoicesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithInvoiceID adds the invoiceID to the get invoices params +func (o *GetInvoicesParams) WithInvoiceID(invoiceID *string) *GetInvoicesParams { + o.SetInvoiceID(invoiceID) + return o +} + +// SetInvoiceID adds the invoiceId to the get invoices params +func (o *GetInvoicesParams) SetInvoiceID(invoiceID *string) { + o.InvoiceID = invoiceID +} + +// WithLimit adds the limit to the get invoices params +func (o *GetInvoicesParams) WithLimit(limit *int64) *GetInvoicesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get invoices params +func (o *GetInvoicesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get invoices params +func (o *GetInvoicesParams) WithOffset(offset *int64) *GetInvoicesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get invoices params +func (o *GetInvoicesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInvoicesParams) 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.InvoiceID != nil { + + // query param invoiceId + var qrInvoiceID string + if o.InvoiceID != nil { + qrInvoiceID = *o.InvoiceID + } + qInvoiceID := qrInvoiceID + if qInvoiceID != "" { + if err := r.SetQueryParam("invoiceId", qInvoiceID); 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/sf-gate/sf_gate_client/invoices/get_invoices_responses.go b/api/sf-gate/sf_gate_client/invoices/get_invoices_responses.go new file mode 100644 index 0000000..7198630 --- /dev/null +++ b/api/sf-gate/sf_gate_client/invoices/get_invoices_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetInvoicesReader is a Reader for the GetInvoices structure. +type GetInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetInvoicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetInvoicesOK creates a GetInvoicesOK with default headers values +func NewGetInvoicesOK() *GetInvoicesOK { + return &GetInvoicesOK{} +} + +/*GetInvoicesOK handles this case with default header values. + +Taxnexus Response with an array of Invoice (full) objects +*/ +type GetInvoicesOK struct { + Payload *sf_gate_models.InvoiceResponse +} + +func (o *GetInvoicesOK) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesOK %+v", 200, o.Payload) +} + +func (o *GetInvoicesOK) GetPayload() *sf_gate_models.InvoiceResponse { + return o.Payload +} + +func (o *GetInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.InvoiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnauthorized creates a GetInvoicesUnauthorized with default headers values +func NewGetInvoicesUnauthorized() *GetInvoicesUnauthorized { + return &GetInvoicesUnauthorized{} +} + +/*GetInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetInvoicesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetInvoicesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesForbidden creates a GetInvoicesForbidden with default headers values +func NewGetInvoicesForbidden() *GetInvoicesForbidden { + return &GetInvoicesForbidden{} +} + +/*GetInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetInvoicesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetInvoicesForbidden) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *GetInvoicesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesNotFound creates a GetInvoicesNotFound with default headers values +func NewGetInvoicesNotFound() *GetInvoicesNotFound { + return &GetInvoicesNotFound{} +} + +/*GetInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetInvoicesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetInvoicesNotFound) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *GetInvoicesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnprocessableEntity creates a GetInvoicesUnprocessableEntity with default headers values +func NewGetInvoicesUnprocessableEntity() *GetInvoicesUnprocessableEntity { + return &GetInvoicesUnprocessableEntity{} +} + +/*GetInvoicesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetInvoicesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetInvoicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetInvoicesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesInternalServerError creates a GetInvoicesInternalServerError with default headers values +func NewGetInvoicesInternalServerError() *GetInvoicesInternalServerError { + return &GetInvoicesInternalServerError{} +} + +/*GetInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetInvoicesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetInvoicesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/invoices/invoices_client.go b/api/sf-gate/sf_gate_client/invoices/invoices_client.go new file mode 100644 index 0000000..9f6e46f --- /dev/null +++ b/api/sf-gate/sf_gate_client/invoices/invoices_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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 invoices API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for invoices API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) + + PostInvoices(params *PostInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostInvoicesOK, error) + + PutInvoices(params *PutInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PutInvoicesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetInvoices gets a list of invoices + + Return a list of available Taxnexus Invoices +*/ +func (a *Client) GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getInvoices", + Method: "GET", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetInvoicesOK) + 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 getInvoices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostInvoices creates a new invoice + + Create New Invoices +*/ +func (a *Client) PostInvoices(params *PostInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postInvoices", + Method: "POST", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostInvoicesOK) + 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 postInvoices: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutInvoices puts a list of invoices + + Put a list of Invoices +*/ +func (a *Client) PutInvoices(params *PutInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*PutInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putInvoices", + Method: "PUT", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutInvoicesOK) + 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 putInvoices: 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/sf-gate/sf_gate_client/invoices/post_invoices_parameters.go b/api/sf-gate/sf_gate_client/invoices/post_invoices_parameters.go new file mode 100644 index 0000000..fda954e --- /dev/null +++ b/api/sf-gate/sf_gate_client/invoices/post_invoices_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostInvoicesParams creates a new PostInvoicesParams object +// with the default values initialized. +func NewPostInvoicesParams() *PostInvoicesParams { + var () + return &PostInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostInvoicesParamsWithTimeout creates a new PostInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostInvoicesParamsWithTimeout(timeout time.Duration) *PostInvoicesParams { + var () + return &PostInvoicesParams{ + + timeout: timeout, + } +} + +// NewPostInvoicesParamsWithContext creates a new PostInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostInvoicesParamsWithContext(ctx context.Context) *PostInvoicesParams { + var () + return &PostInvoicesParams{ + + Context: ctx, + } +} + +// NewPostInvoicesParamsWithHTTPClient creates a new PostInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostInvoicesParamsWithHTTPClient(client *http.Client) *PostInvoicesParams { + var () + return &PostInvoicesParams{ + HTTPClient: client, + } +} + +/*PostInvoicesParams contains all the parameters to send to the API endpoint +for the post invoices operation typically these are written to a http.Request +*/ +type PostInvoicesParams struct { + + /*InvoiceRequest*/ + InvoiceRequest *sf_gate_models.InvoiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post invoices params +func (o *PostInvoicesParams) WithTimeout(timeout time.Duration) *PostInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post invoices params +func (o *PostInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post invoices params +func (o *PostInvoicesParams) WithContext(ctx context.Context) *PostInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post invoices params +func (o *PostInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post invoices params +func (o *PostInvoicesParams) WithHTTPClient(client *http.Client) *PostInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post invoices params +func (o *PostInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceRequest adds the invoiceRequest to the post invoices params +func (o *PostInvoicesParams) WithInvoiceRequest(invoiceRequest *sf_gate_models.InvoiceRequest) *PostInvoicesParams { + o.SetInvoiceRequest(invoiceRequest) + return o +} + +// SetInvoiceRequest adds the invoiceRequest to the post invoices params +func (o *PostInvoicesParams) SetInvoiceRequest(invoiceRequest *sf_gate_models.InvoiceRequest) { + o.InvoiceRequest = invoiceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostInvoicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.InvoiceRequest != nil { + if err := r.SetBodyParam(o.InvoiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/invoices/post_invoices_responses.go b/api/sf-gate/sf_gate_client/invoices/post_invoices_responses.go new file mode 100644 index 0000000..829873d --- /dev/null +++ b/api/sf-gate/sf_gate_client/invoices/post_invoices_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostInvoicesReader is a Reader for the PostInvoices structure. +type PostInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostInvoicesOK creates a PostInvoicesOK with default headers values +func NewPostInvoicesOK() *PostInvoicesOK { + return &PostInvoicesOK{} +} + +/*PostInvoicesOK handles this case with default header values. + +Taxnexus Response with an array of Invoice (full) objects +*/ +type PostInvoicesOK struct { + Payload *sf_gate_models.InvoiceResponse +} + +func (o *PostInvoicesOK) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesOK %+v", 200, o.Payload) +} + +func (o *PostInvoicesOK) GetPayload() *sf_gate_models.InvoiceResponse { + return o.Payload +} + +func (o *PostInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.InvoiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesUnauthorized creates a PostInvoicesUnauthorized with default headers values +func NewPostInvoicesUnauthorized() *PostInvoicesUnauthorized { + return &PostInvoicesUnauthorized{} +} + +/*PostInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostInvoicesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostInvoicesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesForbidden creates a PostInvoicesForbidden with default headers values +func NewPostInvoicesForbidden() *PostInvoicesForbidden { + return &PostInvoicesForbidden{} +} + +/*PostInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostInvoicesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostInvoicesForbidden) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *PostInvoicesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesNotFound creates a PostInvoicesNotFound with default headers values +func NewPostInvoicesNotFound() *PostInvoicesNotFound { + return &PostInvoicesNotFound{} +} + +/*PostInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostInvoicesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostInvoicesNotFound) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *PostInvoicesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostInvoicesInternalServerError creates a PostInvoicesInternalServerError with default headers values +func NewPostInvoicesInternalServerError() *PostInvoicesInternalServerError { + return &PostInvoicesInternalServerError{} +} + +/*PostInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostInvoicesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[POST /invoices][%d] postInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostInvoicesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/invoices/put_invoices_parameters.go b/api/sf-gate/sf_gate_client/invoices/put_invoices_parameters.go new file mode 100644 index 0000000..1cec60c --- /dev/null +++ b/api/sf-gate/sf_gate_client/invoices/put_invoices_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutInvoicesParams creates a new PutInvoicesParams object +// with the default values initialized. +func NewPutInvoicesParams() *PutInvoicesParams { + var () + return &PutInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutInvoicesParamsWithTimeout creates a new PutInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutInvoicesParamsWithTimeout(timeout time.Duration) *PutInvoicesParams { + var () + return &PutInvoicesParams{ + + timeout: timeout, + } +} + +// NewPutInvoicesParamsWithContext creates a new PutInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutInvoicesParamsWithContext(ctx context.Context) *PutInvoicesParams { + var () + return &PutInvoicesParams{ + + Context: ctx, + } +} + +// NewPutInvoicesParamsWithHTTPClient creates a new PutInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutInvoicesParamsWithHTTPClient(client *http.Client) *PutInvoicesParams { + var () + return &PutInvoicesParams{ + HTTPClient: client, + } +} + +/*PutInvoicesParams contains all the parameters to send to the API endpoint +for the put invoices operation typically these are written to a http.Request +*/ +type PutInvoicesParams struct { + + /*InvoiceRequest*/ + InvoiceRequest *sf_gate_models.InvoiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put invoices params +func (o *PutInvoicesParams) WithTimeout(timeout time.Duration) *PutInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put invoices params +func (o *PutInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put invoices params +func (o *PutInvoicesParams) WithContext(ctx context.Context) *PutInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put invoices params +func (o *PutInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put invoices params +func (o *PutInvoicesParams) WithHTTPClient(client *http.Client) *PutInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put invoices params +func (o *PutInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInvoiceRequest adds the invoiceRequest to the put invoices params +func (o *PutInvoicesParams) WithInvoiceRequest(invoiceRequest *sf_gate_models.InvoiceRequest) *PutInvoicesParams { + o.SetInvoiceRequest(invoiceRequest) + return o +} + +// SetInvoiceRequest adds the invoiceRequest to the put invoices params +func (o *PutInvoicesParams) SetInvoiceRequest(invoiceRequest *sf_gate_models.InvoiceRequest) { + o.InvoiceRequest = invoiceRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutInvoicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.InvoiceRequest != nil { + if err := r.SetBodyParam(o.InvoiceRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/invoices/put_invoices_responses.go b/api/sf-gate/sf_gate_client/invoices/put_invoices_responses.go new file mode 100644 index 0000000..249e33d --- /dev/null +++ b/api/sf-gate/sf_gate_client/invoices/put_invoices_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutInvoicesReader is a Reader for the PutInvoices structure. +type PutInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutInvoicesOK creates a PutInvoicesOK with default headers values +func NewPutInvoicesOK() *PutInvoicesOK { + return &PutInvoicesOK{} +} + +/*PutInvoicesOK handles this case with default header values. + +Taxnexus Response with an array of Invoice (full) objects +*/ +type PutInvoicesOK struct { + Payload *sf_gate_models.InvoiceResponse +} + +func (o *PutInvoicesOK) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesOK %+v", 200, o.Payload) +} + +func (o *PutInvoicesOK) GetPayload() *sf_gate_models.InvoiceResponse { + return o.Payload +} + +func (o *PutInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.InvoiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesUnauthorized creates a PutInvoicesUnauthorized with default headers values +func NewPutInvoicesUnauthorized() *PutInvoicesUnauthorized { + return &PutInvoicesUnauthorized{} +} + +/*PutInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutInvoicesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutInvoicesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesForbidden creates a PutInvoicesForbidden with default headers values +func NewPutInvoicesForbidden() *PutInvoicesForbidden { + return &PutInvoicesForbidden{} +} + +/*PutInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutInvoicesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutInvoicesForbidden) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *PutInvoicesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesNotFound creates a PutInvoicesNotFound with default headers values +func NewPutInvoicesNotFound() *PutInvoicesNotFound { + return &PutInvoicesNotFound{} +} + +/*PutInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutInvoicesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutInvoicesNotFound) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *PutInvoicesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutInvoicesInternalServerError creates a PutInvoicesInternalServerError with default headers values +func NewPutInvoicesInternalServerError() *PutInvoicesInternalServerError { + return &PutInvoicesInternalServerError{} +} + +/*PutInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutInvoicesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /invoices][%d] putInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutInvoicesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/jobs/get_jobs_parameters.go b/api/sf-gate/sf_gate_client/jobs/get_jobs_parameters.go new file mode 100644 index 0000000..9ae37f2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/jobs/get_jobs_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package jobs + +// 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 values initialized. +func NewGetJobsParams() *GetJobsParams { + var () + return &GetJobsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetJobsParamsWithTimeout creates a new GetJobsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetJobsParamsWithTimeout(timeout time.Duration) *GetJobsParams { + var () + return &GetJobsParams{ + + timeout: timeout, + } +} + +// NewGetJobsParamsWithContext creates a new GetJobsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetJobsParamsWithContext(ctx context.Context) *GetJobsParams { + var () + return &GetJobsParams{ + + Context: ctx, + } +} + +// NewGetJobsParamsWithHTTPClient creates a new GetJobsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetJobsParamsWithHTTPClient(client *http.Client) *GetJobsParams { + var () + 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 + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*AccountNumber + The Taxnexus Account Number of the Account to be used a record retrieval + + */ + AccountNumber *string + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*JobID + Taxnexus Record Id of a Job record + + */ + JobID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithAccountNumber adds the accountNumber to the get jobs params +func (o *GetJobsParams) WithAccountNumber(accountNumber *string) *GetJobsParams { + o.SetAccountNumber(accountNumber) + return o +} + +// SetAccountNumber adds the accountNumber to the get jobs params +func (o *GetJobsParams) SetAccountNumber(accountNumber *string) { + o.AccountNumber = accountNumber +} + +// 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.AccountNumber != nil { + + // query param accountNumber + var qrAccountNumber string + if o.AccountNumber != nil { + qrAccountNumber = *o.AccountNumber + } + qAccountNumber := qrAccountNumber + if qAccountNumber != "" { + if err := r.SetQueryParam("accountNumber", qAccountNumber); 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/sf-gate/sf_gate_client/jobs/get_jobs_responses.go b/api/sf-gate/sf_gate_client/jobs/get_jobs_responses.go new file mode 100644 index 0000000..07a3aad --- /dev/null +++ b/api/sf-gate/sf_gate_client/jobs/get_jobs_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package jobs + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetJobsOK creates a GetJobsOK with default headers values +func NewGetJobsOK() *GetJobsOK { + return &GetJobsOK{} +} + +/*GetJobsOK handles this case with default header values. + +Taxnexus Response with Job objects +*/ +type GetJobsOK struct { + Payload *sf_gate_models.JobResponse +} + +func (o *GetJobsOK) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsOK %+v", 200, o.Payload) +} + +func (o *GetJobsOK) GetPayload() *sf_gate_models.JobResponse { + return o.Payload +} + +func (o *GetJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetJobsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetJobsUnauthorized) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetJobsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetJobsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetJobsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetJobsForbidden) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsForbidden %+v", 403, o.Payload) +} + +func (o *GetJobsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetJobsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetJobsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetJobsNotFound) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsNotFound %+v", 404, o.Payload) +} + +func (o *GetJobsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetJobsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetJobsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetJobsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetJobsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetJobsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetJobsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetJobsInternalServerError) Error() string { + return fmt.Sprintf("[GET /jobs][%d] getJobsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetJobsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetJobsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/jobs/jobs_client.go b/api/sf-gate/sf_gate_client/jobs/jobs_client.go new file mode 100644 index 0000000..f9f5bc2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/jobs/jobs_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package jobs + +// 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 jobs API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for jobs API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetJobs(params *GetJobsParams, authInfo runtime.ClientAuthInfoWriter) (*GetJobsOK, error) + + PostJobs(params *PostJobsParams, authInfo runtime.ClientAuthInfoWriter) (*PostJobsOK, error) + + PutJobs(params *PutJobsParams, authInfo runtime.ClientAuthInfoWriter) (*PutJobsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetJobs gets a list jobs + + Return a list of Job records from the datastore +*/ +func (a *Client) GetJobs(params *GetJobsParams, authInfo runtime.ClientAuthInfoWriter) (*GetJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetJobsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PostJobs creates new jobs + + Create and enqueue Jobs in Taxnexus +*/ +func (a *Client) PostJobs(params *PostJobsParams, authInfo runtime.ClientAuthInfoWriter) (*PostJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostJobsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutJobs(params *PutJobsParams, authInfo runtime.ClientAuthInfoWriter) (*PutJobsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutJobsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/jobs/post_jobs_parameters.go b/api/sf-gate/sf_gate_client/jobs/post_jobs_parameters.go new file mode 100644 index 0000000..9dcc360 --- /dev/null +++ b/api/sf-gate/sf_gate_client/jobs/post_jobs_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package jobs + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostJobsParams creates a new PostJobsParams object +// with the default values initialized. +func NewPostJobsParams() *PostJobsParams { + var () + return &PostJobsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostJobsParamsWithTimeout creates a new PostJobsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostJobsParamsWithTimeout(timeout time.Duration) *PostJobsParams { + var () + return &PostJobsParams{ + + timeout: timeout, + } +} + +// NewPostJobsParamsWithContext creates a new PostJobsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostJobsParamsWithContext(ctx context.Context) *PostJobsParams { + var () + return &PostJobsParams{ + + Context: ctx, + } +} + +// NewPostJobsParamsWithHTTPClient creates a new PostJobsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostJobsParamsWithHTTPClient(client *http.Client) *PostJobsParams { + var () + 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 new Job records + + */ + JobRequest *sf_gate_models.JobRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.JobRequest) *PostJobsParams { + o.SetJobRequest(jobRequest) + return o +} + +// SetJobRequest adds the jobRequest to the post jobs params +func (o *PostJobsParams) SetJobRequest(jobRequest *sf_gate_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/sf-gate/sf_gate_client/jobs/post_jobs_responses.go b/api/sf-gate/sf_gate_client/jobs/post_jobs_responses.go new file mode 100644 index 0000000..047c7bc --- /dev/null +++ b/api/sf-gate/sf_gate_client/jobs/post_jobs_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package jobs + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPostJobsOK creates a PostJobsOK with default headers values +func NewPostJobsOK() *PostJobsOK { + return &PostJobsOK{} +} + +/*PostJobsOK handles this case with default header values. + +Taxnexus Response with Job objects +*/ +type PostJobsOK struct { + Payload *sf_gate_models.JobResponse +} + +func (o *PostJobsOK) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsOK %+v", 200, o.Payload) +} + +func (o *PostJobsOK) GetPayload() *sf_gate_models.JobResponse { + return o.Payload +} + +func (o *PostJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostJobsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostJobsUnauthorized) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostJobsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostJobsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostJobsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostJobsForbidden) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsForbidden %+v", 403, o.Payload) +} + +func (o *PostJobsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostJobsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PostJobsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostJobsNotFound) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsNotFound %+v", 404, o.Payload) +} + +func (o *PostJobsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostJobsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostJobsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PostJobsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostJobsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostJobsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PostJobsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostJobsInternalServerError) Error() string { + return fmt.Sprintf("[POST /jobs][%d] postJobsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostJobsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostJobsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/jobs/put_jobs_parameters.go b/api/sf-gate/sf_gate_client/jobs/put_jobs_parameters.go new file mode 100644 index 0000000..6a7607c --- /dev/null +++ b/api/sf-gate/sf_gate_client/jobs/put_jobs_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package jobs + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutJobsParams creates a new PutJobsParams object +// with the default values initialized. +func NewPutJobsParams() *PutJobsParams { + var () + return &PutJobsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutJobsParamsWithTimeout creates a new PutJobsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutJobsParamsWithTimeout(timeout time.Duration) *PutJobsParams { + var () + return &PutJobsParams{ + + timeout: timeout, + } +} + +// NewPutJobsParamsWithContext creates a new PutJobsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutJobsParamsWithContext(ctx context.Context) *PutJobsParams { + var () + return &PutJobsParams{ + + Context: ctx, + } +} + +// NewPutJobsParamsWithHTTPClient creates a new PutJobsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutJobsParamsWithHTTPClient(client *http.Client) *PutJobsParams { + var () + 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 new Job records + + */ + JobRequest *sf_gate_models.JobRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.JobRequest) *PutJobsParams { + o.SetJobRequest(jobRequest) + return o +} + +// SetJobRequest adds the jobRequest to the put jobs params +func (o *PutJobsParams) SetJobRequest(jobRequest *sf_gate_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/sf-gate/sf_gate_client/jobs/put_jobs_responses.go b/api/sf-gate/sf_gate_client/jobs/put_jobs_responses.go new file mode 100644 index 0000000..3f4c345 --- /dev/null +++ b/api/sf-gate/sf_gate_client/jobs/put_jobs_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package jobs + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPutJobsOK creates a PutJobsOK with default headers values +func NewPutJobsOK() *PutJobsOK { + return &PutJobsOK{} +} + +/*PutJobsOK handles this case with default header values. + +Taxnexus Response with Job objects +*/ +type PutJobsOK struct { + Payload *sf_gate_models.JobResponse +} + +func (o *PutJobsOK) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsOK %+v", 200, o.Payload) +} + +func (o *PutJobsOK) GetPayload() *sf_gate_models.JobResponse { + return o.Payload +} + +func (o *PutJobsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutJobsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutJobsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutJobsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutJobsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutJobsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutJobsForbidden) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsForbidden %+v", 403, o.Payload) +} + +func (o *PutJobsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutJobsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutJobsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutJobsNotFound) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsNotFound %+v", 404, o.Payload) +} + +func (o *PutJobsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutJobsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutJobsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PutJobsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutJobsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutJobsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutJobsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutJobsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /jobs][%d] putJobsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutJobsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutJobsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/license_types/get_license_types_parameters.go b/api/sf-gate/sf_gate_client/license_types/get_license_types_parameters.go new file mode 100644 index 0000000..c52e636 --- /dev/null +++ b/api/sf-gate/sf_gate_client/license_types/get_license_types_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_types + +// 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" +) + +// NewGetLicenseTypesParams creates a new GetLicenseTypesParams object +// with the default values initialized. +func NewGetLicenseTypesParams() *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLicenseTypesParamsWithTimeout creates a new GetLicenseTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLicenseTypesParamsWithTimeout(timeout time.Duration) *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + + timeout: timeout, + } +} + +// NewGetLicenseTypesParamsWithContext creates a new GetLicenseTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLicenseTypesParamsWithContext(ctx context.Context) *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + + Context: ctx, + } +} + +// NewGetLicenseTypesParamsWithHTTPClient creates a new GetLicenseTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLicenseTypesParamsWithHTTPClient(client *http.Client) *GetLicenseTypesParams { + var () + return &GetLicenseTypesParams{ + HTTPClient: client, + } +} + +/*GetLicenseTypesParams contains all the parameters to send to the API endpoint +for the get license types operation typically these are written to a http.Request +*/ +type GetLicenseTypesParams struct { + + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*LicensetypeID + Taxnexus Id of the License Type to be retrieved + + */ + LicensetypeID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get license types params +func (o *GetLicenseTypesParams) WithTimeout(timeout time.Duration) *GetLicenseTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get license types params +func (o *GetLicenseTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get license types params +func (o *GetLicenseTypesParams) WithContext(ctx context.Context) *GetLicenseTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get license types params +func (o *GetLicenseTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get license types params +func (o *GetLicenseTypesParams) WithHTTPClient(client *http.Client) *GetLicenseTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get license types params +func (o *GetLicenseTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get license types params +func (o *GetLicenseTypesParams) WithActive(active *bool) *GetLicenseTypesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get license types params +func (o *GetLicenseTypesParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get license types params +func (o *GetLicenseTypesParams) WithCompanyID(companyID *string) *GetLicenseTypesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get license types params +func (o *GetLicenseTypesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLicensetypeID adds the licensetypeID to the get license types params +func (o *GetLicenseTypesParams) WithLicensetypeID(licensetypeID *string) *GetLicenseTypesParams { + o.SetLicensetypeID(licensetypeID) + return o +} + +// SetLicensetypeID adds the licensetypeId to the get license types params +func (o *GetLicenseTypesParams) SetLicensetypeID(licensetypeID *string) { + o.LicensetypeID = licensetypeID +} + +// WithLimit adds the limit to the get license types params +func (o *GetLicenseTypesParams) WithLimit(limit *int64) *GetLicenseTypesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get license types params +func (o *GetLicenseTypesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get license types params +func (o *GetLicenseTypesParams) WithOffset(offset *int64) *GetLicenseTypesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get license types params +func (o *GetLicenseTypesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLicenseTypesParams) 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.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.LicensetypeID != nil { + + // query param licensetypeId + var qrLicensetypeID string + if o.LicensetypeID != nil { + qrLicensetypeID = *o.LicensetypeID + } + qLicensetypeID := qrLicensetypeID + if qLicensetypeID != "" { + if err := r.SetQueryParam("licensetypeId", qLicensetypeID); 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/sf-gate/sf_gate_client/license_types/get_license_types_responses.go b/api/sf-gate/sf_gate_client/license_types/get_license_types_responses.go new file mode 100644 index 0000000..998ff4f --- /dev/null +++ b/api/sf-gate/sf_gate_client/license_types/get_license_types_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_types + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetLicenseTypesReader is a Reader for the GetLicenseTypes structure. +type GetLicenseTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLicenseTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLicenseTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLicenseTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLicenseTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLicenseTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetLicenseTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLicenseTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetLicenseTypesOK creates a GetLicenseTypesOK with default headers values +func NewGetLicenseTypesOK() *GetLicenseTypesOK { + return &GetLicenseTypesOK{} +} + +/*GetLicenseTypesOK handles this case with default header values. + +An array of License Type Objects +*/ +type GetLicenseTypesOK struct { + Payload *sf_gate_models.LicenseTypeResponse +} + +func (o *GetLicenseTypesOK) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesOK %+v", 200, o.Payload) +} + +func (o *GetLicenseTypesOK) GetPayload() *sf_gate_models.LicenseTypeResponse { + return o.Payload +} + +func (o *GetLicenseTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.LicenseTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesUnauthorized creates a GetLicenseTypesUnauthorized with default headers values +func NewGetLicenseTypesUnauthorized() *GetLicenseTypesUnauthorized { + return &GetLicenseTypesUnauthorized{} +} + +/*GetLicenseTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetLicenseTypesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicenseTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetLicenseTypesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesForbidden creates a GetLicenseTypesForbidden with default headers values +func NewGetLicenseTypesForbidden() *GetLicenseTypesForbidden { + return &GetLicenseTypesForbidden{} +} + +/*GetLicenseTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetLicenseTypesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicenseTypesForbidden) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetLicenseTypesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesNotFound creates a GetLicenseTypesNotFound with default headers values +func NewGetLicenseTypesNotFound() *GetLicenseTypesNotFound { + return &GetLicenseTypesNotFound{} +} + +/*GetLicenseTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetLicenseTypesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicenseTypesNotFound) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetLicenseTypesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesUnprocessableEntity creates a GetLicenseTypesUnprocessableEntity with default headers values +func NewGetLicenseTypesUnprocessableEntity() *GetLicenseTypesUnprocessableEntity { + return &GetLicenseTypesUnprocessableEntity{} +} + +/*GetLicenseTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetLicenseTypesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicenseTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetLicenseTypesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicenseTypesInternalServerError creates a GetLicenseTypesInternalServerError with default headers values +func NewGetLicenseTypesInternalServerError() *GetLicenseTypesInternalServerError { + return &GetLicenseTypesInternalServerError{} +} + +/*GetLicenseTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetLicenseTypesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicenseTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /licensetypes][%d] getLicenseTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetLicenseTypesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicenseTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/license_types/license_types_client.go b/api/sf-gate/sf_gate_client/license_types/license_types_client.go new file mode 100644 index 0000000..6186f4f --- /dev/null +++ b/api/sf-gate/sf_gate_client/license_types/license_types_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package license_types + +// 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 license types API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for license types API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetLicenseTypes(params *GetLicenseTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicenseTypesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetLicenseTypes retrieves license type records + + Retrieve LicenseType records +*/ +func (a *Client) GetLicenseTypes(params *GetLicenseTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicenseTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLicenseTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getLicenseTypes", + Method: "GET", + PathPattern: "/licensetypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLicenseTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetLicenseTypesOK) + 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 getLicenseTypes: 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/sf-gate/sf_gate_client/licenses/get_licenses_parameters.go b/api/sf-gate/sf_gate_client/licenses/get_licenses_parameters.go new file mode 100644 index 0000000..364ec93 --- /dev/null +++ b/api/sf-gate/sf_gate_client/licenses/get_licenses_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package licenses + +// 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" +) + +// NewGetLicensesParams creates a new GetLicensesParams object +// with the default values initialized. +func NewGetLicensesParams() *GetLicensesParams { + var () + return &GetLicensesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetLicensesParamsWithTimeout creates a new GetLicensesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetLicensesParamsWithTimeout(timeout time.Duration) *GetLicensesParams { + var () + return &GetLicensesParams{ + + timeout: timeout, + } +} + +// NewGetLicensesParamsWithContext creates a new GetLicensesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetLicensesParamsWithContext(ctx context.Context) *GetLicensesParams { + var () + return &GetLicensesParams{ + + Context: ctx, + } +} + +// NewGetLicensesParamsWithHTTPClient creates a new GetLicensesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetLicensesParamsWithHTTPClient(client *http.Client) *GetLicensesParams { + var () + return &GetLicensesParams{ + HTTPClient: client, + } +} + +/*GetLicensesParams contains all the parameters to send to the API endpoint +for the get licenses operation typically these are written to a http.Request +*/ +type GetLicensesParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*LicenseID + Taxnexus Id of the License to be retrieved + + */ + LicenseID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get licenses params +func (o *GetLicensesParams) WithTimeout(timeout time.Duration) *GetLicensesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get licenses params +func (o *GetLicensesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get licenses params +func (o *GetLicensesParams) WithContext(ctx context.Context) *GetLicensesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get licenses params +func (o *GetLicensesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get licenses params +func (o *GetLicensesParams) WithHTTPClient(client *http.Client) *GetLicensesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get licenses params +func (o *GetLicensesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get licenses params +func (o *GetLicensesParams) WithAccountID(accountID *string) *GetLicensesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get licenses params +func (o *GetLicensesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get licenses params +func (o *GetLicensesParams) WithActive(active *bool) *GetLicensesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get licenses params +func (o *GetLicensesParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get licenses params +func (o *GetLicensesParams) WithCompanyID(companyID *string) *GetLicensesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get licenses params +func (o *GetLicensesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLicenseID adds the licenseID to the get licenses params +func (o *GetLicensesParams) WithLicenseID(licenseID *string) *GetLicensesParams { + o.SetLicenseID(licenseID) + return o +} + +// SetLicenseID adds the licenseId to the get licenses params +func (o *GetLicensesParams) SetLicenseID(licenseID *string) { + o.LicenseID = licenseID +} + +// WithLimit adds the limit to the get licenses params +func (o *GetLicensesParams) WithLimit(limit *int64) *GetLicensesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get licenses params +func (o *GetLicensesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get licenses params +func (o *GetLicensesParams) WithOffset(offset *int64) *GetLicensesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get licenses params +func (o *GetLicensesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLicensesParams) 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.LicenseID != nil { + + // query param licenseId + var qrLicenseID string + if o.LicenseID != nil { + qrLicenseID = *o.LicenseID + } + qLicenseID := qrLicenseID + if qLicenseID != "" { + if err := r.SetQueryParam("licenseId", qLicenseID); 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/sf-gate/sf_gate_client/licenses/get_licenses_responses.go b/api/sf-gate/sf_gate_client/licenses/get_licenses_responses.go new file mode 100644 index 0000000..9cfa019 --- /dev/null +++ b/api/sf-gate/sf_gate_client/licenses/get_licenses_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package licenses + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetLicensesReader is a Reader for the GetLicenses structure. +type GetLicensesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLicensesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLicensesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetLicensesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetLicensesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetLicensesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetLicensesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetLicensesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetLicensesOK creates a GetLicensesOK with default headers values +func NewGetLicensesOK() *GetLicensesOK { + return &GetLicensesOK{} +} + +/*GetLicensesOK handles this case with default header values. + +An array of License Objects +*/ +type GetLicensesOK struct { + Payload *sf_gate_models.LicenseResponse +} + +func (o *GetLicensesOK) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesOK %+v", 200, o.Payload) +} + +func (o *GetLicensesOK) GetPayload() *sf_gate_models.LicenseResponse { + return o.Payload +} + +func (o *GetLicensesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.LicenseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesUnauthorized creates a GetLicensesUnauthorized with default headers values +func NewGetLicensesUnauthorized() *GetLicensesUnauthorized { + return &GetLicensesUnauthorized{} +} + +/*GetLicensesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetLicensesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicensesUnauthorized) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetLicensesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicensesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesForbidden creates a GetLicensesForbidden with default headers values +func NewGetLicensesForbidden() *GetLicensesForbidden { + return &GetLicensesForbidden{} +} + +/*GetLicensesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetLicensesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicensesForbidden) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesForbidden %+v", 403, o.Payload) +} + +func (o *GetLicensesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicensesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesNotFound creates a GetLicensesNotFound with default headers values +func NewGetLicensesNotFound() *GetLicensesNotFound { + return &GetLicensesNotFound{} +} + +/*GetLicensesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetLicensesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicensesNotFound) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesNotFound %+v", 404, o.Payload) +} + +func (o *GetLicensesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicensesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesUnprocessableEntity creates a GetLicensesUnprocessableEntity with default headers values +func NewGetLicensesUnprocessableEntity() *GetLicensesUnprocessableEntity { + return &GetLicensesUnprocessableEntity{} +} + +/*GetLicensesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetLicensesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicensesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetLicensesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicensesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetLicensesInternalServerError creates a GetLicensesInternalServerError with default headers values +func NewGetLicensesInternalServerError() *GetLicensesInternalServerError { + return &GetLicensesInternalServerError{} +} + +/*GetLicensesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetLicensesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetLicensesInternalServerError) Error() string { + return fmt.Sprintf("[GET /licenses][%d] getLicensesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetLicensesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetLicensesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/licenses/licenses_client.go b/api/sf-gate/sf_gate_client/licenses/licenses_client.go new file mode 100644 index 0000000..6b4ad74 --- /dev/null +++ b/api/sf-gate/sf_gate_client/licenses/licenses_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package licenses + +// 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 licenses API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for licenses API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetLicenses(params *GetLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicensesOK, error) + + PostLicenses(params *PostLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PostLicensesOK, error) + + PutLicenses(params *PutLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PutLicensesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetLicenses retrieves licenses + + Retrieve all licenses, filter with parameters +*/ +func (a *Client) GetLicenses(params *GetLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*GetLicensesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLicensesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getLicenses", + Method: "GET", + PathPattern: "/licenses", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetLicensesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetLicensesOK) + 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 getLicenses: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostLicenses creates new licenses + + Create new Licenses +*/ +func (a *Client) PostLicenses(params *PostLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PostLicensesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostLicensesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postLicenses", + Method: "POST", + PathPattern: "/licenses", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostLicensesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostLicensesOK) + 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 postLicenses: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutLicenses upserts a license + + Add or update licenses +*/ +func (a *Client) PutLicenses(params *PutLicensesParams, authInfo runtime.ClientAuthInfoWriter) (*PutLicensesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutLicensesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putLicenses", + Method: "PUT", + PathPattern: "/licenses", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutLicensesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutLicensesOK) + 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 putLicenses: 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/sf-gate/sf_gate_client/licenses/post_licenses_parameters.go b/api/sf-gate/sf_gate_client/licenses/post_licenses_parameters.go new file mode 100644 index 0000000..d4dbad0 --- /dev/null +++ b/api/sf-gate/sf_gate_client/licenses/post_licenses_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package licenses + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostLicensesParams creates a new PostLicensesParams object +// with the default values initialized. +func NewPostLicensesParams() *PostLicensesParams { + var () + return &PostLicensesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostLicensesParamsWithTimeout creates a new PostLicensesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostLicensesParamsWithTimeout(timeout time.Duration) *PostLicensesParams { + var () + return &PostLicensesParams{ + + timeout: timeout, + } +} + +// NewPostLicensesParamsWithContext creates a new PostLicensesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostLicensesParamsWithContext(ctx context.Context) *PostLicensesParams { + var () + return &PostLicensesParams{ + + Context: ctx, + } +} + +// NewPostLicensesParamsWithHTTPClient creates a new PostLicensesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostLicensesParamsWithHTTPClient(client *http.Client) *PostLicensesParams { + var () + return &PostLicensesParams{ + HTTPClient: client, + } +} + +/*PostLicensesParams contains all the parameters to send to the API endpoint +for the post licenses operation typically these are written to a http.Request +*/ +type PostLicensesParams struct { + + /*LicenseRequest + The new licenses + + */ + LicenseRequest *sf_gate_models.LicenseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post licenses params +func (o *PostLicensesParams) WithTimeout(timeout time.Duration) *PostLicensesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post licenses params +func (o *PostLicensesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post licenses params +func (o *PostLicensesParams) WithContext(ctx context.Context) *PostLicensesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post licenses params +func (o *PostLicensesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post licenses params +func (o *PostLicensesParams) WithHTTPClient(client *http.Client) *PostLicensesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post licenses params +func (o *PostLicensesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicenseRequest adds the licenseRequest to the post licenses params +func (o *PostLicensesParams) WithLicenseRequest(licenseRequest *sf_gate_models.LicenseRequest) *PostLicensesParams { + o.SetLicenseRequest(licenseRequest) + return o +} + +// SetLicenseRequest adds the licenseRequest to the post licenses params +func (o *PostLicensesParams) SetLicenseRequest(licenseRequest *sf_gate_models.LicenseRequest) { + o.LicenseRequest = licenseRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostLicensesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LicenseRequest != nil { + if err := r.SetBodyParam(o.LicenseRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/licenses/post_licenses_responses.go b/api/sf-gate/sf_gate_client/licenses/post_licenses_responses.go new file mode 100644 index 0000000..c753fc3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/licenses/post_licenses_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package licenses + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostLicensesReader is a Reader for the PostLicenses structure. +type PostLicensesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostLicensesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostLicensesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostLicensesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostLicensesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostLicensesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostLicensesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostLicensesOK creates a PostLicensesOK with default headers values +func NewPostLicensesOK() *PostLicensesOK { + return &PostLicensesOK{} +} + +/*PostLicensesOK handles this case with default header values. + +An array of License Objects +*/ +type PostLicensesOK struct { + Payload *sf_gate_models.LicenseResponse +} + +func (o *PostLicensesOK) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesOK %+v", 200, o.Payload) +} + +func (o *PostLicensesOK) GetPayload() *sf_gate_models.LicenseResponse { + return o.Payload +} + +func (o *PostLicensesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.LicenseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesUnauthorized creates a PostLicensesUnauthorized with default headers values +func NewPostLicensesUnauthorized() *PostLicensesUnauthorized { + return &PostLicensesUnauthorized{} +} + +/*PostLicensesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostLicensesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostLicensesUnauthorized) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostLicensesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostLicensesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesForbidden creates a PostLicensesForbidden with default headers values +func NewPostLicensesForbidden() *PostLicensesForbidden { + return &PostLicensesForbidden{} +} + +/*PostLicensesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostLicensesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostLicensesForbidden) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesForbidden %+v", 403, o.Payload) +} + +func (o *PostLicensesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostLicensesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesNotFound creates a PostLicensesNotFound with default headers values +func NewPostLicensesNotFound() *PostLicensesNotFound { + return &PostLicensesNotFound{} +} + +/*PostLicensesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostLicensesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostLicensesNotFound) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesNotFound %+v", 404, o.Payload) +} + +func (o *PostLicensesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostLicensesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostLicensesInternalServerError creates a PostLicensesInternalServerError with default headers values +func NewPostLicensesInternalServerError() *PostLicensesInternalServerError { + return &PostLicensesInternalServerError{} +} + +/*PostLicensesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostLicensesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostLicensesInternalServerError) Error() string { + return fmt.Sprintf("[POST /licenses][%d] postLicensesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostLicensesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostLicensesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/licenses/put_licenses_parameters.go b/api/sf-gate/sf_gate_client/licenses/put_licenses_parameters.go new file mode 100644 index 0000000..e086fa4 --- /dev/null +++ b/api/sf-gate/sf_gate_client/licenses/put_licenses_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package licenses + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutLicensesParams creates a new PutLicensesParams object +// with the default values initialized. +func NewPutLicensesParams() *PutLicensesParams { + var () + return &PutLicensesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutLicensesParamsWithTimeout creates a new PutLicensesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutLicensesParamsWithTimeout(timeout time.Duration) *PutLicensesParams { + var () + return &PutLicensesParams{ + + timeout: timeout, + } +} + +// NewPutLicensesParamsWithContext creates a new PutLicensesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutLicensesParamsWithContext(ctx context.Context) *PutLicensesParams { + var () + return &PutLicensesParams{ + + Context: ctx, + } +} + +// NewPutLicensesParamsWithHTTPClient creates a new PutLicensesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutLicensesParamsWithHTTPClient(client *http.Client) *PutLicensesParams { + var () + return &PutLicensesParams{ + HTTPClient: client, + } +} + +/*PutLicensesParams contains all the parameters to send to the API endpoint +for the put licenses operation typically these are written to a http.Request +*/ +type PutLicensesParams struct { + + /*LicenseRequest + The updated licenses + + */ + LicenseRequest *sf_gate_models.LicenseRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put licenses params +func (o *PutLicensesParams) WithTimeout(timeout time.Duration) *PutLicensesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put licenses params +func (o *PutLicensesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put licenses params +func (o *PutLicensesParams) WithContext(ctx context.Context) *PutLicensesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put licenses params +func (o *PutLicensesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put licenses params +func (o *PutLicensesParams) WithHTTPClient(client *http.Client) *PutLicensesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put licenses params +func (o *PutLicensesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicenseRequest adds the licenseRequest to the put licenses params +func (o *PutLicensesParams) WithLicenseRequest(licenseRequest *sf_gate_models.LicenseRequest) *PutLicensesParams { + o.SetLicenseRequest(licenseRequest) + return o +} + +// SetLicenseRequest adds the licenseRequest to the put licenses params +func (o *PutLicensesParams) SetLicenseRequest(licenseRequest *sf_gate_models.LicenseRequest) { + o.LicenseRequest = licenseRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutLicensesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.LicenseRequest != nil { + if err := r.SetBodyParam(o.LicenseRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/licenses/put_licenses_responses.go b/api/sf-gate/sf_gate_client/licenses/put_licenses_responses.go new file mode 100644 index 0000000..3f2401b --- /dev/null +++ b/api/sf-gate/sf_gate_client/licenses/put_licenses_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package licenses + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutLicensesReader is a Reader for the PutLicenses structure. +type PutLicensesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutLicensesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutLicensesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutLicensesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutLicensesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutLicensesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutLicensesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutLicensesOK creates a PutLicensesOK with default headers values +func NewPutLicensesOK() *PutLicensesOK { + return &PutLicensesOK{} +} + +/*PutLicensesOK handles this case with default header values. + +An array of License Objects +*/ +type PutLicensesOK struct { + Payload *sf_gate_models.LicenseResponse +} + +func (o *PutLicensesOK) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesOK %+v", 200, o.Payload) +} + +func (o *PutLicensesOK) GetPayload() *sf_gate_models.LicenseResponse { + return o.Payload +} + +func (o *PutLicensesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.LicenseResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesUnauthorized creates a PutLicensesUnauthorized with default headers values +func NewPutLicensesUnauthorized() *PutLicensesUnauthorized { + return &PutLicensesUnauthorized{} +} + +/*PutLicensesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutLicensesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutLicensesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutLicensesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutLicensesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesForbidden creates a PutLicensesForbidden with default headers values +func NewPutLicensesForbidden() *PutLicensesForbidden { + return &PutLicensesForbidden{} +} + +/*PutLicensesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutLicensesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutLicensesForbidden) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesForbidden %+v", 403, o.Payload) +} + +func (o *PutLicensesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutLicensesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesNotFound creates a PutLicensesNotFound with default headers values +func NewPutLicensesNotFound() *PutLicensesNotFound { + return &PutLicensesNotFound{} +} + +/*PutLicensesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutLicensesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutLicensesNotFound) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesNotFound %+v", 404, o.Payload) +} + +func (o *PutLicensesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutLicensesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutLicensesInternalServerError creates a PutLicensesInternalServerError with default headers values +func NewPutLicensesInternalServerError() *PutLicensesInternalServerError { + return &PutLicensesInternalServerError{} +} + +/*PutLicensesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutLicensesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutLicensesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /licenses][%d] putLicensesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutLicensesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutLicensesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/notebooks/get_notebooks_parameters.go b/api/sf-gate/sf_gate_client/notebooks/get_notebooks_parameters.go new file mode 100644 index 0000000..b0388ad --- /dev/null +++ b/api/sf-gate/sf_gate_client/notebooks/get_notebooks_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebooks + +// 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" +) + +// NewGetNotebooksParams creates a new GetNotebooksParams object +// with the default values initialized. +func NewGetNotebooksParams() *GetNotebooksParams { + var () + return &GetNotebooksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetNotebooksParamsWithTimeout creates a new GetNotebooksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetNotebooksParamsWithTimeout(timeout time.Duration) *GetNotebooksParams { + var () + return &GetNotebooksParams{ + + timeout: timeout, + } +} + +// NewGetNotebooksParamsWithContext creates a new GetNotebooksParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetNotebooksParamsWithContext(ctx context.Context) *GetNotebooksParams { + var () + return &GetNotebooksParams{ + + Context: ctx, + } +} + +// NewGetNotebooksParamsWithHTTPClient creates a new GetNotebooksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetNotebooksParamsWithHTTPClient(client *http.Client) *GetNotebooksParams { + var () + return &GetNotebooksParams{ + HTTPClient: client, + } +} + +/*GetNotebooksParams contains all the parameters to send to the API endpoint +for the get notebooks operation typically these are written to a http.Request +*/ +type GetNotebooksParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*NotebookID + Template ID + + */ + NotebookID *string + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get notebooks params +func (o *GetNotebooksParams) WithTimeout(timeout time.Duration) *GetNotebooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get notebooks params +func (o *GetNotebooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get notebooks params +func (o *GetNotebooksParams) WithContext(ctx context.Context) *GetNotebooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get notebooks params +func (o *GetNotebooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get notebooks params +func (o *GetNotebooksParams) WithHTTPClient(client *http.Client) *GetNotebooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get notebooks params +func (o *GetNotebooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get notebooks params +func (o *GetNotebooksParams) WithLimit(limit *int64) *GetNotebooksParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get notebooks params +func (o *GetNotebooksParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithNotebookID adds the notebookID to the get notebooks params +func (o *GetNotebooksParams) WithNotebookID(notebookID *string) *GetNotebooksParams { + o.SetNotebookID(notebookID) + return o +} + +// SetNotebookID adds the notebookId to the get notebooks params +func (o *GetNotebooksParams) SetNotebookID(notebookID *string) { + o.NotebookID = notebookID +} + +// WithOffset adds the offset to the get notebooks params +func (o *GetNotebooksParams) WithOffset(offset *int64) *GetNotebooksParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get notebooks params +func (o *GetNotebooksParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *GetNotebooksParams) 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.NotebookID != nil { + + // query param notebookId + var qrNotebookID string + if o.NotebookID != nil { + qrNotebookID = *o.NotebookID + } + qNotebookID := qrNotebookID + if qNotebookID != "" { + if err := r.SetQueryParam("notebookId", qNotebookID); 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/sf-gate/sf_gate_client/notebooks/get_notebooks_responses.go b/api/sf-gate/sf_gate_client/notebooks/get_notebooks_responses.go new file mode 100644 index 0000000..9cef58e --- /dev/null +++ b/api/sf-gate/sf_gate_client/notebooks/get_notebooks_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebooks + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetNotebooksReader is a Reader for the GetNotebooks structure. +type GetNotebooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetNotebooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetNotebooksUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetNotebooksForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetNotebooksNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetNotebooksUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetNotebooksInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetNotebooksOK creates a GetNotebooksOK with default headers values +func NewGetNotebooksOK() *GetNotebooksOK { + return &GetNotebooksOK{} +} + +/*GetNotebooksOK handles this case with default header values. + +Taxnexus Response with Notebook objects +*/ +type GetNotebooksOK struct { + Payload *sf_gate_models.NotebookResponse +} + +func (o *GetNotebooksOK) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksOK %+v", 200, o.Payload) +} + +func (o *GetNotebooksOK) GetPayload() *sf_gate_models.NotebookResponse { + return o.Payload +} + +func (o *GetNotebooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.NotebookResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksUnauthorized creates a GetNotebooksUnauthorized with default headers values +func NewGetNotebooksUnauthorized() *GetNotebooksUnauthorized { + return &GetNotebooksUnauthorized{} +} + +/*GetNotebooksUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetNotebooksUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetNotebooksUnauthorized) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksUnauthorized %+v", 401, o.Payload) +} + +func (o *GetNotebooksUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetNotebooksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksForbidden creates a GetNotebooksForbidden with default headers values +func NewGetNotebooksForbidden() *GetNotebooksForbidden { + return &GetNotebooksForbidden{} +} + +/*GetNotebooksForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetNotebooksForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetNotebooksForbidden) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksForbidden %+v", 403, o.Payload) +} + +func (o *GetNotebooksForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetNotebooksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksNotFound creates a GetNotebooksNotFound with default headers values +func NewGetNotebooksNotFound() *GetNotebooksNotFound { + return &GetNotebooksNotFound{} +} + +/*GetNotebooksNotFound handles this case with default header values. + +Resource was not found +*/ +type GetNotebooksNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetNotebooksNotFound) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksNotFound %+v", 404, o.Payload) +} + +func (o *GetNotebooksNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetNotebooksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksUnprocessableEntity creates a GetNotebooksUnprocessableEntity with default headers values +func NewGetNotebooksUnprocessableEntity() *GetNotebooksUnprocessableEntity { + return &GetNotebooksUnprocessableEntity{} +} + +/*GetNotebooksUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetNotebooksUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetNotebooksUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetNotebooksUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetNotebooksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetNotebooksInternalServerError creates a GetNotebooksInternalServerError with default headers values +func NewGetNotebooksInternalServerError() *GetNotebooksInternalServerError { + return &GetNotebooksInternalServerError{} +} + +/*GetNotebooksInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetNotebooksInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetNotebooksInternalServerError) Error() string { + return fmt.Sprintf("[GET /notebooks][%d] getNotebooksInternalServerError %+v", 500, o.Payload) +} + +func (o *GetNotebooksInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetNotebooksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/notebooks/notebooks_client.go b/api/sf-gate/sf_gate_client/notebooks/notebooks_client.go new file mode 100644 index 0000000..adca0a6 --- /dev/null +++ b/api/sf-gate/sf_gate_client/notebooks/notebooks_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebooks + +// 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 notebooks API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for notebooks API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetNotebooks(params *GetNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*GetNotebooksOK, error) + + PostNotebooks(params *PostNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PostNotebooksOK, error) + + PutNotebooks(params *PutNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PutNotebooksOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetNotebooks gets a list of notebooks + + Return a list of Notebook records from the datastore +*/ +func (a *Client) GetNotebooks(params *GetNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*GetNotebooksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetNotebooksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getNotebooks", + Method: "GET", + PathPattern: "/notebooks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetNotebooksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetNotebooksOK) + 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 getNotebooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostNotebooks creates new notebooks + + Create Notebooks in Taxnexus +*/ +func (a *Client) PostNotebooks(params *PostNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PostNotebooksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostNotebooksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postNotebooks", + Method: "POST", + PathPattern: "/notebooks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostNotebooksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostNotebooksOK) + 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 postNotebooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutNotebooks updates notebooks + + Update Notebooks in Taxnexus +*/ +func (a *Client) PutNotebooks(params *PutNotebooksParams, authInfo runtime.ClientAuthInfoWriter) (*PutNotebooksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutNotebooksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putNotebooks", + Method: "PUT", + PathPattern: "/notebooks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutNotebooksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutNotebooksOK) + 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 putNotebooks: 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/sf-gate/sf_gate_client/notebooks/post_notebooks_parameters.go b/api/sf-gate/sf_gate_client/notebooks/post_notebooks_parameters.go new file mode 100644 index 0000000..5e65345 --- /dev/null +++ b/api/sf-gate/sf_gate_client/notebooks/post_notebooks_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebooks + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostNotebooksParams creates a new PostNotebooksParams object +// with the default values initialized. +func NewPostNotebooksParams() *PostNotebooksParams { + var () + return &PostNotebooksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostNotebooksParamsWithTimeout creates a new PostNotebooksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostNotebooksParamsWithTimeout(timeout time.Duration) *PostNotebooksParams { + var () + return &PostNotebooksParams{ + + timeout: timeout, + } +} + +// NewPostNotebooksParamsWithContext creates a new PostNotebooksParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostNotebooksParamsWithContext(ctx context.Context) *PostNotebooksParams { + var () + return &PostNotebooksParams{ + + Context: ctx, + } +} + +// NewPostNotebooksParamsWithHTTPClient creates a new PostNotebooksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostNotebooksParamsWithHTTPClient(client *http.Client) *PostNotebooksParams { + var () + return &PostNotebooksParams{ + HTTPClient: client, + } +} + +/*PostNotebooksParams contains all the parameters to send to the API endpoint +for the post notebooks operation typically these are written to a http.Request +*/ +type PostNotebooksParams struct { + + /*NotebookRequest + An array of Notebook records + + */ + NotebookRequest *sf_gate_models.NotebookRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post notebooks params +func (o *PostNotebooksParams) WithTimeout(timeout time.Duration) *PostNotebooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post notebooks params +func (o *PostNotebooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post notebooks params +func (o *PostNotebooksParams) WithContext(ctx context.Context) *PostNotebooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post notebooks params +func (o *PostNotebooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post notebooks params +func (o *PostNotebooksParams) WithHTTPClient(client *http.Client) *PostNotebooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post notebooks params +func (o *PostNotebooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNotebookRequest adds the notebookRequest to the post notebooks params +func (o *PostNotebooksParams) WithNotebookRequest(notebookRequest *sf_gate_models.NotebookRequest) *PostNotebooksParams { + o.SetNotebookRequest(notebookRequest) + return o +} + +// SetNotebookRequest adds the notebookRequest to the post notebooks params +func (o *PostNotebooksParams) SetNotebookRequest(notebookRequest *sf_gate_models.NotebookRequest) { + o.NotebookRequest = notebookRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostNotebooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.NotebookRequest != nil { + if err := r.SetBodyParam(o.NotebookRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/notebooks/post_notebooks_responses.go b/api/sf-gate/sf_gate_client/notebooks/post_notebooks_responses.go new file mode 100644 index 0000000..f711c15 --- /dev/null +++ b/api/sf-gate/sf_gate_client/notebooks/post_notebooks_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebooks + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostNotebooksReader is a Reader for the PostNotebooks structure. +type PostNotebooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostNotebooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostNotebooksUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostNotebooksForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostNotebooksNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostNotebooksUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostNotebooksInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostNotebooksOK creates a PostNotebooksOK with default headers values +func NewPostNotebooksOK() *PostNotebooksOK { + return &PostNotebooksOK{} +} + +/*PostNotebooksOK handles this case with default header values. + +Taxnexus Response with Notebook objects +*/ +type PostNotebooksOK struct { + Payload *sf_gate_models.NotebookResponse +} + +func (o *PostNotebooksOK) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksOK %+v", 200, o.Payload) +} + +func (o *PostNotebooksOK) GetPayload() *sf_gate_models.NotebookResponse { + return o.Payload +} + +func (o *PostNotebooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.NotebookResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksUnauthorized creates a PostNotebooksUnauthorized with default headers values +func NewPostNotebooksUnauthorized() *PostNotebooksUnauthorized { + return &PostNotebooksUnauthorized{} +} + +/*PostNotebooksUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostNotebooksUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostNotebooksUnauthorized) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksUnauthorized %+v", 401, o.Payload) +} + +func (o *PostNotebooksUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostNotebooksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksForbidden creates a PostNotebooksForbidden with default headers values +func NewPostNotebooksForbidden() *PostNotebooksForbidden { + return &PostNotebooksForbidden{} +} + +/*PostNotebooksForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostNotebooksForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostNotebooksForbidden) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksForbidden %+v", 403, o.Payload) +} + +func (o *PostNotebooksForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostNotebooksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksNotFound creates a PostNotebooksNotFound with default headers values +func NewPostNotebooksNotFound() *PostNotebooksNotFound { + return &PostNotebooksNotFound{} +} + +/*PostNotebooksNotFound handles this case with default header values. + +Resource was not found +*/ +type PostNotebooksNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostNotebooksNotFound) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksNotFound %+v", 404, o.Payload) +} + +func (o *PostNotebooksNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostNotebooksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksUnprocessableEntity creates a PostNotebooksUnprocessableEntity with default headers values +func NewPostNotebooksUnprocessableEntity() *PostNotebooksUnprocessableEntity { + return &PostNotebooksUnprocessableEntity{} +} + +/*PostNotebooksUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostNotebooksUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PostNotebooksUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostNotebooksUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostNotebooksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostNotebooksInternalServerError creates a PostNotebooksInternalServerError with default headers values +func NewPostNotebooksInternalServerError() *PostNotebooksInternalServerError { + return &PostNotebooksInternalServerError{} +} + +/*PostNotebooksInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostNotebooksInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostNotebooksInternalServerError) Error() string { + return fmt.Sprintf("[POST /notebooks][%d] postNotebooksInternalServerError %+v", 500, o.Payload) +} + +func (o *PostNotebooksInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostNotebooksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/notebooks/put_notebooks_parameters.go b/api/sf-gate/sf_gate_client/notebooks/put_notebooks_parameters.go new file mode 100644 index 0000000..602fa2c --- /dev/null +++ b/api/sf-gate/sf_gate_client/notebooks/put_notebooks_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebooks + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutNotebooksParams creates a new PutNotebooksParams object +// with the default values initialized. +func NewPutNotebooksParams() *PutNotebooksParams { + var () + return &PutNotebooksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutNotebooksParamsWithTimeout creates a new PutNotebooksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutNotebooksParamsWithTimeout(timeout time.Duration) *PutNotebooksParams { + var () + return &PutNotebooksParams{ + + timeout: timeout, + } +} + +// NewPutNotebooksParamsWithContext creates a new PutNotebooksParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutNotebooksParamsWithContext(ctx context.Context) *PutNotebooksParams { + var () + return &PutNotebooksParams{ + + Context: ctx, + } +} + +// NewPutNotebooksParamsWithHTTPClient creates a new PutNotebooksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutNotebooksParamsWithHTTPClient(client *http.Client) *PutNotebooksParams { + var () + return &PutNotebooksParams{ + HTTPClient: client, + } +} + +/*PutNotebooksParams contains all the parameters to send to the API endpoint +for the put notebooks operation typically these are written to a http.Request +*/ +type PutNotebooksParams struct { + + /*NotebookRequest + An array of Notebook records + + */ + NotebookRequest *sf_gate_models.NotebookRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put notebooks params +func (o *PutNotebooksParams) WithTimeout(timeout time.Duration) *PutNotebooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put notebooks params +func (o *PutNotebooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put notebooks params +func (o *PutNotebooksParams) WithContext(ctx context.Context) *PutNotebooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put notebooks params +func (o *PutNotebooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put notebooks params +func (o *PutNotebooksParams) WithHTTPClient(client *http.Client) *PutNotebooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put notebooks params +func (o *PutNotebooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNotebookRequest adds the notebookRequest to the put notebooks params +func (o *PutNotebooksParams) WithNotebookRequest(notebookRequest *sf_gate_models.NotebookRequest) *PutNotebooksParams { + o.SetNotebookRequest(notebookRequest) + return o +} + +// SetNotebookRequest adds the notebookRequest to the put notebooks params +func (o *PutNotebooksParams) SetNotebookRequest(notebookRequest *sf_gate_models.NotebookRequest) { + o.NotebookRequest = notebookRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutNotebooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.NotebookRequest != nil { + if err := r.SetBodyParam(o.NotebookRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/notebooks/put_notebooks_responses.go b/api/sf-gate/sf_gate_client/notebooks/put_notebooks_responses.go new file mode 100644 index 0000000..5ac4e05 --- /dev/null +++ b/api/sf-gate/sf_gate_client/notebooks/put_notebooks_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package notebooks + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutNotebooksReader is a Reader for the PutNotebooks structure. +type PutNotebooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutNotebooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutNotebooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutNotebooksUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutNotebooksForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutNotebooksNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPutNotebooksUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutNotebooksInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutNotebooksOK creates a PutNotebooksOK with default headers values +func NewPutNotebooksOK() *PutNotebooksOK { + return &PutNotebooksOK{} +} + +/*PutNotebooksOK handles this case with default header values. + +Taxnexus Response with Notebook objects +*/ +type PutNotebooksOK struct { + Payload *sf_gate_models.NotebookResponse +} + +func (o *PutNotebooksOK) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksOK %+v", 200, o.Payload) +} + +func (o *PutNotebooksOK) GetPayload() *sf_gate_models.NotebookResponse { + return o.Payload +} + +func (o *PutNotebooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.NotebookResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksUnauthorized creates a PutNotebooksUnauthorized with default headers values +func NewPutNotebooksUnauthorized() *PutNotebooksUnauthorized { + return &PutNotebooksUnauthorized{} +} + +/*PutNotebooksUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutNotebooksUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutNotebooksUnauthorized) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksUnauthorized %+v", 401, o.Payload) +} + +func (o *PutNotebooksUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutNotebooksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksForbidden creates a PutNotebooksForbidden with default headers values +func NewPutNotebooksForbidden() *PutNotebooksForbidden { + return &PutNotebooksForbidden{} +} + +/*PutNotebooksForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutNotebooksForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutNotebooksForbidden) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksForbidden %+v", 403, o.Payload) +} + +func (o *PutNotebooksForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutNotebooksForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksNotFound creates a PutNotebooksNotFound with default headers values +func NewPutNotebooksNotFound() *PutNotebooksNotFound { + return &PutNotebooksNotFound{} +} + +/*PutNotebooksNotFound handles this case with default header values. + +Resource was not found +*/ +type PutNotebooksNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutNotebooksNotFound) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksNotFound %+v", 404, o.Payload) +} + +func (o *PutNotebooksNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutNotebooksNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksUnprocessableEntity creates a PutNotebooksUnprocessableEntity with default headers values +func NewPutNotebooksUnprocessableEntity() *PutNotebooksUnprocessableEntity { + return &PutNotebooksUnprocessableEntity{} +} + +/*PutNotebooksUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutNotebooksUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PutNotebooksUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutNotebooksUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutNotebooksUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutNotebooksInternalServerError creates a PutNotebooksInternalServerError with default headers values +func NewPutNotebooksInternalServerError() *PutNotebooksInternalServerError { + return &PutNotebooksInternalServerError{} +} + +/*PutNotebooksInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutNotebooksInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutNotebooksInternalServerError) Error() string { + return fmt.Sprintf("[PUT /notebooks][%d] putNotebooksInternalServerError %+v", 500, o.Payload) +} + +func (o *PutNotebooksInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutNotebooksInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/orders/get_orders_parameters.go b/api/sf-gate/sf_gate_client/orders/get_orders_parameters.go new file mode 100644 index 0000000..1ffe16e --- /dev/null +++ b/api/sf-gate/sf_gate_client/orders/get_orders_parameters.go @@ -0,0 +1,343 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package orders + +// 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" +) + +// NewGetOrdersParams creates a new GetOrdersParams object +// with the default values initialized. +func NewGetOrdersParams() *GetOrdersParams { + var () + return &GetOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetOrdersParamsWithTimeout creates a new GetOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetOrdersParamsWithTimeout(timeout time.Duration) *GetOrdersParams { + var () + return &GetOrdersParams{ + + timeout: timeout, + } +} + +// NewGetOrdersParamsWithContext creates a new GetOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetOrdersParamsWithContext(ctx context.Context) *GetOrdersParams { + var () + return &GetOrdersParams{ + + Context: ctx, + } +} + +// NewGetOrdersParamsWithHTTPClient creates a new GetOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetOrdersParamsWithHTTPClient(client *http.Client) *GetOrdersParams { + var () + return &GetOrdersParams{ + HTTPClient: client, + } +} + +/*GetOrdersParams contains all the parameters to send to the API endpoint +for the get orders operation typically these are written to a http.Request +*/ +type GetOrdersParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*AccountNumber + The Taxnexus Account Number of the Account to be used a record retrieval + + */ + AccountNumber *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*OrderID + Taxnexus Id of the Company to be retrieved + + */ + OrderID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get orders params +func (o *GetOrdersParams) WithTimeout(timeout time.Duration) *GetOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get orders params +func (o *GetOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get orders params +func (o *GetOrdersParams) WithContext(ctx context.Context) *GetOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get orders params +func (o *GetOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get orders params +func (o *GetOrdersParams) WithHTTPClient(client *http.Client) *GetOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get orders params +func (o *GetOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get orders params +func (o *GetOrdersParams) WithAccountID(accountID *string) *GetOrdersParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get orders params +func (o *GetOrdersParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithAccountNumber adds the accountNumber to the get orders params +func (o *GetOrdersParams) WithAccountNumber(accountNumber *string) *GetOrdersParams { + o.SetAccountNumber(accountNumber) + return o +} + +// SetAccountNumber adds the accountNumber to the get orders params +func (o *GetOrdersParams) SetAccountNumber(accountNumber *string) { + o.AccountNumber = accountNumber +} + +// WithActive adds the active to the get orders params +func (o *GetOrdersParams) WithActive(active *bool) *GetOrdersParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get orders params +func (o *GetOrdersParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get orders params +func (o *GetOrdersParams) WithCompanyID(companyID *string) *GetOrdersParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get orders params +func (o *GetOrdersParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get orders params +func (o *GetOrdersParams) WithLimit(limit *int64) *GetOrdersParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get orders params +func (o *GetOrdersParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get orders params +func (o *GetOrdersParams) WithOffset(offset *int64) *GetOrdersParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get orders params +func (o *GetOrdersParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithOrderID adds the orderID to the get orders params +func (o *GetOrdersParams) WithOrderID(orderID *string) *GetOrdersParams { + o.SetOrderID(orderID) + return o +} + +// SetOrderID adds the orderId to the get orders params +func (o *GetOrdersParams) SetOrderID(orderID *string) { + o.OrderID = orderID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOrdersParams) 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.AccountNumber != nil { + + // query param accountNumber + var qrAccountNumber string + if o.AccountNumber != nil { + qrAccountNumber = *o.AccountNumber + } + qAccountNumber := qrAccountNumber + if qAccountNumber != "" { + if err := r.SetQueryParam("accountNumber", qAccountNumber); 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.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.OrderID != nil { + + // query param orderId + var qrOrderID string + if o.OrderID != nil { + qrOrderID = *o.OrderID + } + qOrderID := qrOrderID + if qOrderID != "" { + if err := r.SetQueryParam("orderId", qOrderID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/orders/get_orders_responses.go b/api/sf-gate/sf_gate_client/orders/get_orders_responses.go new file mode 100644 index 0000000..0fb57c2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/orders/get_orders_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package orders + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetOrdersReader is a Reader for the GetOrders structure. +type GetOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetOrdersOK creates a GetOrdersOK with default headers values +func NewGetOrdersOK() *GetOrdersOK { + return &GetOrdersOK{} +} + +/*GetOrdersOK handles this case with default header values. + +An array of Order objects +*/ +type GetOrdersOK struct { + Payload *sf_gate_models.OrderResponse +} + +func (o *GetOrdersOK) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersOK %+v", 200, o.Payload) +} + +func (o *GetOrdersOK) GetPayload() *sf_gate_models.OrderResponse { + return o.Payload +} + +func (o *GetOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.OrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersUnauthorized creates a GetOrdersUnauthorized with default headers values +func NewGetOrdersUnauthorized() *GetOrdersUnauthorized { + return &GetOrdersUnauthorized{} +} + +/*GetOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetOrdersUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetOrdersUnauthorized) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *GetOrdersUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersForbidden creates a GetOrdersForbidden with default headers values +func NewGetOrdersForbidden() *GetOrdersForbidden { + return &GetOrdersForbidden{} +} + +/*GetOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetOrdersForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetOrdersForbidden) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersForbidden %+v", 403, o.Payload) +} + +func (o *GetOrdersForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersNotFound creates a GetOrdersNotFound with default headers values +func NewGetOrdersNotFound() *GetOrdersNotFound { + return &GetOrdersNotFound{} +} + +/*GetOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type GetOrdersNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetOrdersNotFound) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersNotFound %+v", 404, o.Payload) +} + +func (o *GetOrdersNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersUnprocessableEntity creates a GetOrdersUnprocessableEntity with default headers values +func NewGetOrdersUnprocessableEntity() *GetOrdersUnprocessableEntity { + return &GetOrdersUnprocessableEntity{} +} + +/*GetOrdersUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetOrdersUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetOrdersUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrdersInternalServerError creates a GetOrdersInternalServerError with default headers values +func NewGetOrdersInternalServerError() *GetOrdersInternalServerError { + return &GetOrdersInternalServerError{} +} + +/*GetOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetOrdersInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetOrdersInternalServerError) Error() string { + return fmt.Sprintf("[GET /orders][%d] getOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *GetOrdersInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/orders/orders_client.go b/api/sf-gate/sf_gate_client/orders/orders_client.go new file mode 100644 index 0000000..9a7b497 --- /dev/null +++ b/api/sf-gate/sf_gate_client/orders/orders_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package orders + +// 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 orders API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for orders API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetOrders(params *GetOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrdersOK, error) + + PostOrders(params *PostOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostOrdersOK, error) + + PutOrders(params *PutOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PutOrdersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetOrders gets a list of orders + + Return a list of Orders +*/ +func (a *Client) GetOrders(params *GetOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*GetOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getOrders", + Method: "GET", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetOrdersOK) + 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 getOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostOrders creates new orders + + Create new Orders +*/ +func (a *Client) PostOrders(params *PostOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PostOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postOrders", + Method: "POST", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostOrdersOK) + 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 postOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutOrders creates new orders + + Create new Orders +*/ +func (a *Client) PutOrders(params *PutOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PutOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutOrdersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putOrders", + Method: "PUT", + PathPattern: "/orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutOrdersReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutOrdersOK) + 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 putOrders: 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/sf-gate/sf_gate_client/orders/post_orders_parameters.go b/api/sf-gate/sf_gate_client/orders/post_orders_parameters.go new file mode 100644 index 0000000..7fdc7d7 --- /dev/null +++ b/api/sf-gate/sf_gate_client/orders/post_orders_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package orders + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostOrdersParams creates a new PostOrdersParams object +// with the default values initialized. +func NewPostOrdersParams() *PostOrdersParams { + var () + return &PostOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostOrdersParamsWithTimeout creates a new PostOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostOrdersParamsWithTimeout(timeout time.Duration) *PostOrdersParams { + var () + return &PostOrdersParams{ + + timeout: timeout, + } +} + +// NewPostOrdersParamsWithContext creates a new PostOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostOrdersParamsWithContext(ctx context.Context) *PostOrdersParams { + var () + return &PostOrdersParams{ + + Context: ctx, + } +} + +// NewPostOrdersParamsWithHTTPClient creates a new PostOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostOrdersParamsWithHTTPClient(client *http.Client) *PostOrdersParams { + var () + return &PostOrdersParams{ + HTTPClient: client, + } +} + +/*PostOrdersParams contains all the parameters to send to the API endpoint +for the post orders operation typically these are written to a http.Request +*/ +type PostOrdersParams struct { + + /*Order*/ + Order *sf_gate_models.OrderBasicRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post orders params +func (o *PostOrdersParams) WithTimeout(timeout time.Duration) *PostOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post orders params +func (o *PostOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post orders params +func (o *PostOrdersParams) WithContext(ctx context.Context) *PostOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post orders params +func (o *PostOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post orders params +func (o *PostOrdersParams) WithHTTPClient(client *http.Client) *PostOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post orders params +func (o *PostOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrder adds the order to the post orders params +func (o *PostOrdersParams) WithOrder(order *sf_gate_models.OrderBasicRequest) *PostOrdersParams { + o.SetOrder(order) + return o +} + +// SetOrder adds the order to the post orders params +func (o *PostOrdersParams) SetOrder(order *sf_gate_models.OrderBasicRequest) { + o.Order = order +} + +// WriteToRequest writes these params to a swagger request +func (o *PostOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Order != nil { + if err := r.SetBodyParam(o.Order); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/orders/post_orders_responses.go b/api/sf-gate/sf_gate_client/orders/post_orders_responses.go new file mode 100644 index 0000000..83b0c41 --- /dev/null +++ b/api/sf-gate/sf_gate_client/orders/post_orders_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package orders + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostOrdersReader is a Reader for the PostOrders structure. +type PostOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostOrdersOK creates a PostOrdersOK with default headers values +func NewPostOrdersOK() *PostOrdersOK { + return &PostOrdersOK{} +} + +/*PostOrdersOK handles this case with default header values. + +An array of Order objects +*/ +type PostOrdersOK struct { + Payload *sf_gate_models.OrderResponse +} + +func (o *PostOrdersOK) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersOK %+v", 200, o.Payload) +} + +func (o *PostOrdersOK) GetPayload() *sf_gate_models.OrderResponse { + return o.Payload +} + +func (o *PostOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.OrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersUnauthorized creates a PostOrdersUnauthorized with default headers values +func NewPostOrdersUnauthorized() *PostOrdersUnauthorized { + return &PostOrdersUnauthorized{} +} + +/*PostOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostOrdersUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostOrdersUnauthorized) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostOrdersUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersForbidden creates a PostOrdersForbidden with default headers values +func NewPostOrdersForbidden() *PostOrdersForbidden { + return &PostOrdersForbidden{} +} + +/*PostOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostOrdersForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostOrdersForbidden) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersForbidden %+v", 403, o.Payload) +} + +func (o *PostOrdersForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersNotFound creates a PostOrdersNotFound with default headers values +func NewPostOrdersNotFound() *PostOrdersNotFound { + return &PostOrdersNotFound{} +} + +/*PostOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type PostOrdersNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostOrdersNotFound) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersNotFound %+v", 404, o.Payload) +} + +func (o *PostOrdersNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrdersInternalServerError creates a PostOrdersInternalServerError with default headers values +func NewPostOrdersInternalServerError() *PostOrdersInternalServerError { + return &PostOrdersInternalServerError{} +} + +/*PostOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostOrdersInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostOrdersInternalServerError) Error() string { + return fmt.Sprintf("[POST /orders][%d] postOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostOrdersInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/orders/put_orders_parameters.go b/api/sf-gate/sf_gate_client/orders/put_orders_parameters.go new file mode 100644 index 0000000..027ef9f --- /dev/null +++ b/api/sf-gate/sf_gate_client/orders/put_orders_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package orders + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutOrdersParams creates a new PutOrdersParams object +// with the default values initialized. +func NewPutOrdersParams() *PutOrdersParams { + var () + return &PutOrdersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutOrdersParamsWithTimeout creates a new PutOrdersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutOrdersParamsWithTimeout(timeout time.Duration) *PutOrdersParams { + var () + return &PutOrdersParams{ + + timeout: timeout, + } +} + +// NewPutOrdersParamsWithContext creates a new PutOrdersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutOrdersParamsWithContext(ctx context.Context) *PutOrdersParams { + var () + return &PutOrdersParams{ + + Context: ctx, + } +} + +// NewPutOrdersParamsWithHTTPClient creates a new PutOrdersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutOrdersParamsWithHTTPClient(client *http.Client) *PutOrdersParams { + var () + return &PutOrdersParams{ + HTTPClient: client, + } +} + +/*PutOrdersParams contains all the parameters to send to the API endpoint +for the put orders operation typically these are written to a http.Request +*/ +type PutOrdersParams struct { + + /*Order*/ + Order *sf_gate_models.Order + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put orders params +func (o *PutOrdersParams) WithTimeout(timeout time.Duration) *PutOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put orders params +func (o *PutOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put orders params +func (o *PutOrdersParams) WithContext(ctx context.Context) *PutOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put orders params +func (o *PutOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put orders params +func (o *PutOrdersParams) WithHTTPClient(client *http.Client) *PutOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put orders params +func (o *PutOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrder adds the order to the put orders params +func (o *PutOrdersParams) WithOrder(order *sf_gate_models.Order) *PutOrdersParams { + o.SetOrder(order) + return o +} + +// SetOrder adds the order to the put orders params +func (o *PutOrdersParams) SetOrder(order *sf_gate_models.Order) { + o.Order = order +} + +// WriteToRequest writes these params to a swagger request +func (o *PutOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Order != nil { + if err := r.SetBodyParam(o.Order); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/orders/put_orders_responses.go b/api/sf-gate/sf_gate_client/orders/put_orders_responses.go new file mode 100644 index 0000000..21496c6 --- /dev/null +++ b/api/sf-gate/sf_gate_client/orders/put_orders_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package orders + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutOrdersReader is a Reader for the PutOrders structure. +type PutOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutOrdersOK creates a PutOrdersOK with default headers values +func NewPutOrdersOK() *PutOrdersOK { + return &PutOrdersOK{} +} + +/*PutOrdersOK handles this case with default header values. + +An array of Order objects +*/ +type PutOrdersOK struct { + Payload *sf_gate_models.OrderResponse +} + +func (o *PutOrdersOK) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersOK %+v", 200, o.Payload) +} + +func (o *PutOrdersOK) GetPayload() *sf_gate_models.OrderResponse { + return o.Payload +} + +func (o *PutOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.OrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersUnauthorized creates a PutOrdersUnauthorized with default headers values +func NewPutOrdersUnauthorized() *PutOrdersUnauthorized { + return &PutOrdersUnauthorized{} +} + +/*PutOrdersUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutOrdersUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutOrdersUnauthorized) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *PutOrdersUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersForbidden creates a PutOrdersForbidden with default headers values +func NewPutOrdersForbidden() *PutOrdersForbidden { + return &PutOrdersForbidden{} +} + +/*PutOrdersForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutOrdersForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutOrdersForbidden) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersForbidden %+v", 403, o.Payload) +} + +func (o *PutOrdersForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersNotFound creates a PutOrdersNotFound with default headers values +func NewPutOrdersNotFound() *PutOrdersNotFound { + return &PutOrdersNotFound{} +} + +/*PutOrdersNotFound handles this case with default header values. + +Resource was not found +*/ +type PutOrdersNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutOrdersNotFound) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersNotFound %+v", 404, o.Payload) +} + +func (o *PutOrdersNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutOrdersInternalServerError creates a PutOrdersInternalServerError with default headers values +func NewPutOrdersInternalServerError() *PutOrdersInternalServerError { + return &PutOrdersInternalServerError{} +} + +/*PutOrdersInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutOrdersInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutOrdersInternalServerError) Error() string { + return fmt.Sprintf("[PUT /orders][%d] putOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *PutOrdersInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/periods/get_periods_parameters.go b/api/sf-gate/sf_gate_client/periods/get_periods_parameters.go new file mode 100644 index 0000000..7a42f97 --- /dev/null +++ b/api/sf-gate/sf_gate_client/periods/get_periods_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package periods + +// 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" +) + +// NewGetPeriodsParams creates a new GetPeriodsParams object +// with the default values initialized. +func NewGetPeriodsParams() *GetPeriodsParams { + var () + return &GetPeriodsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPeriodsParamsWithTimeout creates a new GetPeriodsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPeriodsParamsWithTimeout(timeout time.Duration) *GetPeriodsParams { + var () + return &GetPeriodsParams{ + + timeout: timeout, + } +} + +// NewGetPeriodsParamsWithContext creates a new GetPeriodsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPeriodsParamsWithContext(ctx context.Context) *GetPeriodsParams { + var () + return &GetPeriodsParams{ + + Context: ctx, + } +} + +// NewGetPeriodsParamsWithHTTPClient creates a new GetPeriodsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPeriodsParamsWithHTTPClient(client *http.Client) *GetPeriodsParams { + var () + return &GetPeriodsParams{ + HTTPClient: client, + } +} + +/*GetPeriodsParams contains all the parameters to send to the API endpoint +for the get periods operation typically these are written to a http.Request +*/ +type GetPeriodsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*PeriodID + Taxnexus Id of the Period to be used a record retrieval + + */ + PeriodID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get periods params +func (o *GetPeriodsParams) WithTimeout(timeout time.Duration) *GetPeriodsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get periods params +func (o *GetPeriodsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get periods params +func (o *GetPeriodsParams) WithContext(ctx context.Context) *GetPeriodsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get periods params +func (o *GetPeriodsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get periods params +func (o *GetPeriodsParams) WithHTTPClient(client *http.Client) *GetPeriodsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get periods params +func (o *GetPeriodsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get periods params +func (o *GetPeriodsParams) WithAccountID(accountID *string) *GetPeriodsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get periods params +func (o *GetPeriodsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithLimit adds the limit to the get periods params +func (o *GetPeriodsParams) WithLimit(limit *int64) *GetPeriodsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get periods params +func (o *GetPeriodsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get periods params +func (o *GetPeriodsParams) WithOffset(offset *int64) *GetPeriodsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get periods params +func (o *GetPeriodsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPeriodID adds the periodID to the get periods params +func (o *GetPeriodsParams) WithPeriodID(periodID *string) *GetPeriodsParams { + o.SetPeriodID(periodID) + return o +} + +// SetPeriodID adds the periodId to the get periods params +func (o *GetPeriodsParams) SetPeriodID(periodID *string) { + o.PeriodID = periodID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPeriodsParams) 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.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.PeriodID != nil { + + // query param periodId + var qrPeriodID string + if o.PeriodID != nil { + qrPeriodID = *o.PeriodID + } + qPeriodID := qrPeriodID + if qPeriodID != "" { + if err := r.SetQueryParam("periodId", qPeriodID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/periods/get_periods_responses.go b/api/sf-gate/sf_gate_client/periods/get_periods_responses.go new file mode 100644 index 0000000..5b3339b --- /dev/null +++ b/api/sf-gate/sf_gate_client/periods/get_periods_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package periods + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetPeriodsReader is a Reader for the GetPeriods structure. +type GetPeriodsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPeriodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPeriodsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPeriodsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPeriodsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPeriodsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPeriodsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPeriodsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPeriodsOK creates a GetPeriodsOK with default headers values +func NewGetPeriodsOK() *GetPeriodsOK { + return &GetPeriodsOK{} +} + +/*GetPeriodsOK handles this case with default header values. + +Taxnexus Response with Period objects +*/ +type GetPeriodsOK struct { + Payload *sf_gate_models.PeriodResponse +} + +func (o *GetPeriodsOK) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsOK %+v", 200, o.Payload) +} + +func (o *GetPeriodsOK) GetPayload() *sf_gate_models.PeriodResponse { + return o.Payload +} + +func (o *GetPeriodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.PeriodResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsUnauthorized creates a GetPeriodsUnauthorized with default headers values +func NewGetPeriodsUnauthorized() *GetPeriodsUnauthorized { + return &GetPeriodsUnauthorized{} +} + +/*GetPeriodsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPeriodsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetPeriodsUnauthorized) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPeriodsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPeriodsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsForbidden creates a GetPeriodsForbidden with default headers values +func NewGetPeriodsForbidden() *GetPeriodsForbidden { + return &GetPeriodsForbidden{} +} + +/*GetPeriodsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPeriodsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetPeriodsForbidden) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsForbidden %+v", 403, o.Payload) +} + +func (o *GetPeriodsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPeriodsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsNotFound creates a GetPeriodsNotFound with default headers values +func NewGetPeriodsNotFound() *GetPeriodsNotFound { + return &GetPeriodsNotFound{} +} + +/*GetPeriodsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPeriodsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetPeriodsNotFound) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsNotFound %+v", 404, o.Payload) +} + +func (o *GetPeriodsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPeriodsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsUnprocessableEntity creates a GetPeriodsUnprocessableEntity with default headers values +func NewGetPeriodsUnprocessableEntity() *GetPeriodsUnprocessableEntity { + return &GetPeriodsUnprocessableEntity{} +} + +/*GetPeriodsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPeriodsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetPeriodsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPeriodsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPeriodsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPeriodsInternalServerError creates a GetPeriodsInternalServerError with default headers values +func NewGetPeriodsInternalServerError() *GetPeriodsInternalServerError { + return &GetPeriodsInternalServerError{} +} + +/*GetPeriodsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPeriodsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetPeriodsInternalServerError) Error() string { + return fmt.Sprintf("[GET /periods][%d] getPeriodsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPeriodsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPeriodsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/periods/periods_client.go b/api/sf-gate/sf_gate_client/periods/periods_client.go new file mode 100644 index 0000000..5f39b27 --- /dev/null +++ b/api/sf-gate/sf_gate_client/periods/periods_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package periods + +// 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 periods API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for periods API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPeriods(params *GetPeriodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPeriodsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPeriods gets a list of periods + + Return a list of Periods for an Account +*/ +func (a *Client) GetPeriods(params *GetPeriodsParams, authInfo runtime.ClientAuthInfoWriter) (*GetPeriodsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPeriodsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPeriods", + Method: "GET", + PathPattern: "/periods", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPeriodsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPeriodsOK) + 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 getPeriods: 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/sf-gate/sf_gate_client/places/get_places_parameters.go b/api/sf-gate/sf_gate_client/places/get_places_parameters.go new file mode 100644 index 0000000..c4935d3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/places/get_places_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package places + +// 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" +) + +// NewGetPlacesParams creates a new GetPlacesParams object +// with the default values initialized. +func NewGetPlacesParams() *GetPlacesParams { + var () + return &GetPlacesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPlacesParamsWithTimeout creates a new GetPlacesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPlacesParamsWithTimeout(timeout time.Duration) *GetPlacesParams { + var () + return &GetPlacesParams{ + + timeout: timeout, + } +} + +// NewGetPlacesParamsWithContext creates a new GetPlacesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPlacesParamsWithContext(ctx context.Context) *GetPlacesParams { + var () + return &GetPlacesParams{ + + Context: ctx, + } +} + +// NewGetPlacesParamsWithHTTPClient creates a new GetPlacesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPlacesParamsWithHTTPClient(client *http.Client) *GetPlacesParams { + var () + return &GetPlacesParams{ + HTTPClient: client, + } +} + +/*GetPlacesParams contains all the parameters to send to the API endpoint +for the get places operation typically these are written to a http.Request +*/ +type GetPlacesParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*PlaceID + The City name (must be accompanied by State) + + */ + PlaceID *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get places params +func (o *GetPlacesParams) WithTimeout(timeout time.Duration) *GetPlacesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get places params +func (o *GetPlacesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get places params +func (o *GetPlacesParams) WithContext(ctx context.Context) *GetPlacesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get places params +func (o *GetPlacesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get places params +func (o *GetPlacesParams) WithHTTPClient(client *http.Client) *GetPlacesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get places params +func (o *GetPlacesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get places params +func (o *GetPlacesParams) WithLimit(limit *int64) *GetPlacesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get places params +func (o *GetPlacesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get places params +func (o *GetPlacesParams) WithOffset(offset *int64) *GetPlacesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get places params +func (o *GetPlacesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlaceID adds the placeID to the get places params +func (o *GetPlacesParams) WithPlaceID(placeID *string) *GetPlacesParams { + o.SetPlaceID(placeID) + return o +} + +// SetPlaceID adds the placeId to the get places params +func (o *GetPlacesParams) SetPlaceID(placeID *string) { + o.PlaceID = placeID +} + +// WithState adds the state to the get places params +func (o *GetPlacesParams) WithState(state *string) *GetPlacesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get places params +func (o *GetPlacesParams) SetState(state *string) { + o.State = state +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPlacesParams) 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.PlaceID != nil { + + // query param placeId + var qrPlaceID string + if o.PlaceID != nil { + qrPlaceID = *o.PlaceID + } + qPlaceID := qrPlaceID + if qPlaceID != "" { + if err := r.SetQueryParam("placeId", qPlaceID); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/places/get_places_responses.go b/api/sf-gate/sf_gate_client/places/get_places_responses.go new file mode 100644 index 0000000..b3d53a3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/places/get_places_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package places + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetPlacesReader is a Reader for the GetPlaces structure. +type GetPlacesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPlacesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPlacesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPlacesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPlacesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPlacesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPlacesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPlacesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPlacesOK creates a GetPlacesOK with default headers values +func NewGetPlacesOK() *GetPlacesOK { + return &GetPlacesOK{} +} + +/*GetPlacesOK handles this case with default header values. + +Taxnexus Response with an array of Place objects +*/ +type GetPlacesOK struct { + Payload *sf_gate_models.PlaceResponse +} + +func (o *GetPlacesOK) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesOK %+v", 200, o.Payload) +} + +func (o *GetPlacesOK) GetPayload() *sf_gate_models.PlaceResponse { + return o.Payload +} + +func (o *GetPlacesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.PlaceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesUnauthorized creates a GetPlacesUnauthorized with default headers values +func NewGetPlacesUnauthorized() *GetPlacesUnauthorized { + return &GetPlacesUnauthorized{} +} + +/*GetPlacesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPlacesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetPlacesUnauthorized) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPlacesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPlacesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesForbidden creates a GetPlacesForbidden with default headers values +func NewGetPlacesForbidden() *GetPlacesForbidden { + return &GetPlacesForbidden{} +} + +/*GetPlacesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPlacesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetPlacesForbidden) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesForbidden %+v", 403, o.Payload) +} + +func (o *GetPlacesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPlacesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesNotFound creates a GetPlacesNotFound with default headers values +func NewGetPlacesNotFound() *GetPlacesNotFound { + return &GetPlacesNotFound{} +} + +/*GetPlacesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPlacesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetPlacesNotFound) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesNotFound %+v", 404, o.Payload) +} + +func (o *GetPlacesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPlacesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesUnprocessableEntity creates a GetPlacesUnprocessableEntity with default headers values +func NewGetPlacesUnprocessableEntity() *GetPlacesUnprocessableEntity { + return &GetPlacesUnprocessableEntity{} +} + +/*GetPlacesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPlacesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetPlacesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPlacesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPlacesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPlacesInternalServerError creates a GetPlacesInternalServerError with default headers values +func NewGetPlacesInternalServerError() *GetPlacesInternalServerError { + return &GetPlacesInternalServerError{} +} + +/*GetPlacesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPlacesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetPlacesInternalServerError) Error() string { + return fmt.Sprintf("[GET /places][%d] getPlacesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPlacesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPlacesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/places/places_client.go b/api/sf-gate/sf_gate_client/places/places_client.go new file mode 100644 index 0000000..6aa35f0 --- /dev/null +++ b/api/sf-gate/sf_gate_client/places/places_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package places + +// 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 places API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for places API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPlaces(params *GetPlacesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlacesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPlaces retrieves places + + Retrieve Places, filter with parameters +*/ +func (a *Client) GetPlaces(params *GetPlacesParams, authInfo runtime.ClientAuthInfoWriter) (*GetPlacesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPlacesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPlaces", + Method: "GET", + PathPattern: "/places", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPlacesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPlacesOK) + 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 getPlaces: 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/sf-gate/sf_gate_client/products/get_products_parameters.go b/api/sf-gate/sf_gate_client/products/get_products_parameters.go new file mode 100644 index 0000000..911d0cb --- /dev/null +++ b/api/sf-gate/sf_gate_client/products/get_products_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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" +) + +// NewGetProductsParams creates a new GetProductsParams object +// with the default values initialized. +func NewGetProductsParams() *GetProductsParams { + var () + return &GetProductsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetProductsParamsWithTimeout creates a new GetProductsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetProductsParamsWithTimeout(timeout time.Duration) *GetProductsParams { + var () + return &GetProductsParams{ + + timeout: timeout, + } +} + +// NewGetProductsParamsWithContext creates a new GetProductsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetProductsParamsWithContext(ctx context.Context) *GetProductsParams { + var () + return &GetProductsParams{ + + Context: ctx, + } +} + +// NewGetProductsParamsWithHTTPClient creates a new GetProductsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetProductsParamsWithHTTPClient(client *http.Client) *GetProductsParams { + var () + return &GetProductsParams{ + HTTPClient: client, + } +} + +/*GetProductsParams contains all the parameters to send to the API endpoint +for the get products operation typically these are written to a http.Request +*/ +type GetProductsParams struct { + + /*Active + Retrieve only active records? + + */ + Active *bool + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*ProductID + Taxnexus Id of the Account to be used a record retrieval + + */ + ProductID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get products params +func (o *GetProductsParams) WithTimeout(timeout time.Duration) *GetProductsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get products params +func (o *GetProductsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get products params +func (o *GetProductsParams) WithContext(ctx context.Context) *GetProductsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get products params +func (o *GetProductsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get products params +func (o *GetProductsParams) WithHTTPClient(client *http.Client) *GetProductsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get products params +func (o *GetProductsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get products params +func (o *GetProductsParams) WithActive(active *bool) *GetProductsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get products params +func (o *GetProductsParams) SetActive(active *bool) { + o.Active = active +} + +// WithLimit adds the limit to the get products params +func (o *GetProductsParams) WithLimit(limit *int64) *GetProductsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get products params +func (o *GetProductsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get products params +func (o *GetProductsParams) WithOffset(offset *int64) *GetProductsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get products params +func (o *GetProductsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithProductID adds the productID to the get products params +func (o *GetProductsParams) WithProductID(productID *string) *GetProductsParams { + o.SetProductID(productID) + return o +} + +// SetProductID adds the productId to the get products params +func (o *GetProductsParams) SetProductID(productID *string) { + o.ProductID = productID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetProductsParams) 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.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.ProductID != nil { + + // query param productId + var qrProductID string + if o.ProductID != nil { + qrProductID = *o.ProductID + } + qProductID := qrProductID + if qProductID != "" { + if err := r.SetQueryParam("productId", qProductID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/products/get_products_responses.go b/api/sf-gate/sf_gate_client/products/get_products_responses.go new file mode 100644 index 0000000..5802585 --- /dev/null +++ b/api/sf-gate/sf_gate_client/products/get_products_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetProductsReader is a Reader for the GetProducts structure. +type GetProductsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetProductsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetProductsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetProductsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetProductsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetProductsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetProductsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetProductsOK creates a GetProductsOK with default headers values +func NewGetProductsOK() *GetProductsOK { + return &GetProductsOK{} +} + +/*GetProductsOK handles this case with default header values. + +An array of Product objects +*/ +type GetProductsOK struct { + Payload *sf_gate_models.ProductResponse +} + +func (o *GetProductsOK) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsOK %+v", 200, o.Payload) +} + +func (o *GetProductsOK) GetPayload() *sf_gate_models.ProductResponse { + return o.Payload +} + +func (o *GetProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.ProductResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsUnauthorized creates a GetProductsUnauthorized with default headers values +func NewGetProductsUnauthorized() *GetProductsUnauthorized { + return &GetProductsUnauthorized{} +} + +/*GetProductsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetProductsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetProductsUnauthorized) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetProductsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetProductsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsForbidden creates a GetProductsForbidden with default headers values +func NewGetProductsForbidden() *GetProductsForbidden { + return &GetProductsForbidden{} +} + +/*GetProductsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetProductsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetProductsForbidden) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsForbidden %+v", 403, o.Payload) +} + +func (o *GetProductsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetProductsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsNotFound creates a GetProductsNotFound with default headers values +func NewGetProductsNotFound() *GetProductsNotFound { + return &GetProductsNotFound{} +} + +/*GetProductsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetProductsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetProductsNotFound) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsNotFound %+v", 404, o.Payload) +} + +func (o *GetProductsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetProductsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsUnprocessableEntity creates a GetProductsUnprocessableEntity with default headers values +func NewGetProductsUnprocessableEntity() *GetProductsUnprocessableEntity { + return &GetProductsUnprocessableEntity{} +} + +/*GetProductsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetProductsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetProductsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetProductsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetProductsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetProductsInternalServerError creates a GetProductsInternalServerError with default headers values +func NewGetProductsInternalServerError() *GetProductsInternalServerError { + return &GetProductsInternalServerError{} +} + +/*GetProductsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetProductsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetProductsInternalServerError) Error() string { + return fmt.Sprintf("[GET /products][%d] getProductsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetProductsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetProductsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/products/products_client.go b/api/sf-gate/sf_gate_client/products/products_client.go new file mode 100644 index 0000000..1fbdf22 --- /dev/null +++ b/api/sf-gate/sf_gate_client/products/products_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package products + +// 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 products API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for products API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetProducts gets a list of products + + Return a list of all available Products +*/ +func (a *Client) GetProducts(params *GetProductsParams, authInfo runtime.ClientAuthInfoWriter) (*GetProductsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetProductsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getProducts", + Method: "GET", + PathPattern: "/products", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetProductsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetProductsOK) + 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 getProducts: 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/sf-gate/sf_gate_client/purchase_orders/get_pos_parameters.go b/api/sf-gate/sf_gate_client/purchase_orders/get_pos_parameters.go new file mode 100644 index 0000000..c8aed95 --- /dev/null +++ b/api/sf-gate/sf_gate_client/purchase_orders/get_pos_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" +) + +// NewGetPosParams creates a new GetPosParams object +// with the default values initialized. +func NewGetPosParams() *GetPosParams { + var () + return &GetPosParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPosParamsWithTimeout creates a new GetPosParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPosParamsWithTimeout(timeout time.Duration) *GetPosParams { + var () + return &GetPosParams{ + + timeout: timeout, + } +} + +// NewGetPosParamsWithContext creates a new GetPosParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPosParamsWithContext(ctx context.Context) *GetPosParams { + var () + return &GetPosParams{ + + Context: ctx, + } +} + +// NewGetPosParamsWithHTTPClient creates a new GetPosParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPosParamsWithHTTPClient(client *http.Client) *GetPosParams { + var () + return &GetPosParams{ + HTTPClient: client, + } +} + +/*GetPosParams contains all the parameters to send to the API endpoint +for the get pos operation typically these are written to a http.Request +*/ +type GetPosParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*PoID + Taxnexus Id of the Purchase Order to be retrieved + + */ + PoID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get pos params +func (o *GetPosParams) WithTimeout(timeout time.Duration) *GetPosParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get pos params +func (o *GetPosParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get pos params +func (o *GetPosParams) WithContext(ctx context.Context) *GetPosParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get pos params +func (o *GetPosParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get pos params +func (o *GetPosParams) WithHTTPClient(client *http.Client) *GetPosParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get pos params +func (o *GetPosParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get pos params +func (o *GetPosParams) WithAccountID(accountID *string) *GetPosParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get pos params +func (o *GetPosParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get pos params +func (o *GetPosParams) WithActive(active *bool) *GetPosParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get pos params +func (o *GetPosParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get pos params +func (o *GetPosParams) WithCompanyID(companyID *string) *GetPosParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get pos params +func (o *GetPosParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get pos params +func (o *GetPosParams) WithLimit(limit *int64) *GetPosParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get pos params +func (o *GetPosParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get pos params +func (o *GetPosParams) WithOffset(offset *int64) *GetPosParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get pos params +func (o *GetPosParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPoID adds the poID to the get pos params +func (o *GetPosParams) WithPoID(poID *string) *GetPosParams { + o.SetPoID(poID) + return o +} + +// SetPoID adds the poId to the get pos params +func (o *GetPosParams) SetPoID(poID *string) { + o.PoID = poID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPosParams) 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.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.PoID != nil { + + // query param poId + var qrPoID string + if o.PoID != nil { + qrPoID = *o.PoID + } + qPoID := qrPoID + if qPoID != "" { + if err := r.SetQueryParam("poId", qPoID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/purchase_orders/get_pos_responses.go b/api/sf-gate/sf_gate_client/purchase_orders/get_pos_responses.go new file mode 100644 index 0000000..de79b23 --- /dev/null +++ b/api/sf-gate/sf_gate_client/purchase_orders/get_pos_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetPosReader is a Reader for the GetPos structure. +type GetPosReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPosReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPosOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPosUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPosForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPosNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPosUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPosInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPosOK creates a GetPosOK with default headers values +func NewGetPosOK() *GetPosOK { + return &GetPosOK{} +} + +/*GetPosOK handles this case with default header values. + +An array of Purchase Order objects +*/ +type GetPosOK struct { + Payload *sf_gate_models.PurchaseOrderResponse +} + +func (o *GetPosOK) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosOK %+v", 200, o.Payload) +} + +func (o *GetPosOK) GetPayload() *sf_gate_models.PurchaseOrderResponse { + return o.Payload +} + +func (o *GetPosOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.PurchaseOrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosUnauthorized creates a GetPosUnauthorized with default headers values +func NewGetPosUnauthorized() *GetPosUnauthorized { + return &GetPosUnauthorized{} +} + +/*GetPosUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPosUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetPosUnauthorized) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPosUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPosUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosForbidden creates a GetPosForbidden with default headers values +func NewGetPosForbidden() *GetPosForbidden { + return &GetPosForbidden{} +} + +/*GetPosForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPosForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetPosForbidden) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosForbidden %+v", 403, o.Payload) +} + +func (o *GetPosForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPosForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosNotFound creates a GetPosNotFound with default headers values +func NewGetPosNotFound() *GetPosNotFound { + return &GetPosNotFound{} +} + +/*GetPosNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPosNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetPosNotFound) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosNotFound %+v", 404, o.Payload) +} + +func (o *GetPosNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPosNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosUnprocessableEntity creates a GetPosUnprocessableEntity with default headers values +func NewGetPosUnprocessableEntity() *GetPosUnprocessableEntity { + return &GetPosUnprocessableEntity{} +} + +/*GetPosUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPosUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetPosUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPosUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPosUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosInternalServerError creates a GetPosInternalServerError with default headers values +func NewGetPosInternalServerError() *GetPosInternalServerError { + return &GetPosInternalServerError{} +} + +/*GetPosInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPosInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetPosInternalServerError) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPosInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetPosInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/purchase_orders/post_pos_parameters.go b/api/sf-gate/sf_gate_client/purchase_orders/post_pos_parameters.go new file mode 100644 index 0000000..d1bd5a2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/purchase_orders/post_pos_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostPosParams creates a new PostPosParams object +// with the default values initialized. +func NewPostPosParams() *PostPosParams { + var () + return &PostPosParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPosParamsWithTimeout creates a new PostPosParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPosParamsWithTimeout(timeout time.Duration) *PostPosParams { + var () + return &PostPosParams{ + + timeout: timeout, + } +} + +// NewPostPosParamsWithContext creates a new PostPosParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPosParamsWithContext(ctx context.Context) *PostPosParams { + var () + return &PostPosParams{ + + Context: ctx, + } +} + +// NewPostPosParamsWithHTTPClient creates a new PostPosParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPosParamsWithHTTPClient(client *http.Client) *PostPosParams { + var () + return &PostPosParams{ + HTTPClient: client, + } +} + +/*PostPosParams contains all the parameters to send to the API endpoint +for the post pos operation typically these are written to a http.Request +*/ +type PostPosParams struct { + + /*PurchaseOrderRequest*/ + PurchaseOrderRequest *sf_gate_models.PurchaseOrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post pos params +func (o *PostPosParams) WithTimeout(timeout time.Duration) *PostPosParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post pos params +func (o *PostPosParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post pos params +func (o *PostPosParams) WithContext(ctx context.Context) *PostPosParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post pos params +func (o *PostPosParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post pos params +func (o *PostPosParams) WithHTTPClient(client *http.Client) *PostPosParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post pos params +func (o *PostPosParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPurchaseOrderRequest adds the purchaseOrderRequest to the post pos params +func (o *PostPosParams) WithPurchaseOrderRequest(purchaseOrderRequest *sf_gate_models.PurchaseOrderRequest) *PostPosParams { + o.SetPurchaseOrderRequest(purchaseOrderRequest) + return o +} + +// SetPurchaseOrderRequest adds the purchaseOrderRequest to the post pos params +func (o *PostPosParams) SetPurchaseOrderRequest(purchaseOrderRequest *sf_gate_models.PurchaseOrderRequest) { + o.PurchaseOrderRequest = purchaseOrderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostPosParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PurchaseOrderRequest != nil { + if err := r.SetBodyParam(o.PurchaseOrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/purchase_orders/post_pos_responses.go b/api/sf-gate/sf_gate_client/purchase_orders/post_pos_responses.go new file mode 100644 index 0000000..e797123 --- /dev/null +++ b/api/sf-gate/sf_gate_client/purchase_orders/post_pos_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostPosReader is a Reader for the PostPos structure. +type PostPosReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostPosReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostPosOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostPosUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostPosForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostPosNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostPosInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostPosOK creates a PostPosOK with default headers values +func NewPostPosOK() *PostPosOK { + return &PostPosOK{} +} + +/*PostPosOK handles this case with default header values. + +An array of Purchase Order objects +*/ +type PostPosOK struct { + Payload *sf_gate_models.PurchaseOrderResponse +} + +func (o *PostPosOK) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPosOK %+v", 200, o.Payload) +} + +func (o *PostPosOK) GetPayload() *sf_gate_models.PurchaseOrderResponse { + return o.Payload +} + +func (o *PostPosOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.PurchaseOrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPosUnauthorized creates a PostPosUnauthorized with default headers values +func NewPostPosUnauthorized() *PostPosUnauthorized { + return &PostPosUnauthorized{} +} + +/*PostPosUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostPosUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostPosUnauthorized) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPosUnauthorized %+v", 401, o.Payload) +} + +func (o *PostPosUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostPosUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPosForbidden creates a PostPosForbidden with default headers values +func NewPostPosForbidden() *PostPosForbidden { + return &PostPosForbidden{} +} + +/*PostPosForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostPosForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostPosForbidden) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPosForbidden %+v", 403, o.Payload) +} + +func (o *PostPosForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostPosForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPosNotFound creates a PostPosNotFound with default headers values +func NewPostPosNotFound() *PostPosNotFound { + return &PostPosNotFound{} +} + +/*PostPosNotFound handles this case with default header values. + +Resource was not found +*/ +type PostPosNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostPosNotFound) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPosNotFound %+v", 404, o.Payload) +} + +func (o *PostPosNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostPosNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostPosInternalServerError creates a PostPosInternalServerError with default headers values +func NewPostPosInternalServerError() *PostPosInternalServerError { + return &PostPosInternalServerError{} +} + +/*PostPosInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostPosInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostPosInternalServerError) Error() string { + return fmt.Sprintf("[POST /pos][%d] postPosInternalServerError %+v", 500, o.Payload) +} + +func (o *PostPosInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostPosInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/purchase_orders/purchase_orders_client.go b/api/sf-gate/sf_gate_client/purchase_orders/purchase_orders_client.go new file mode 100644 index 0000000..72e1d2f --- /dev/null +++ b/api/sf-gate/sf_gate_client/purchase_orders/purchase_orders_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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 purchase orders API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for purchase orders API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPos(params *GetPosParams, authInfo runtime.ClientAuthInfoWriter) (*GetPosOK, error) + + PostPos(params *PostPosParams, authInfo runtime.ClientAuthInfoWriter) (*PostPosOK, error) + + PutPos(params *PutPosParams, authInfo runtime.ClientAuthInfoWriter) (*PutPosOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPos gets a list of purchase orders + + Return a list of available Purchase Orders +*/ +func (a *Client) GetPos(params *GetPosParams, authInfo runtime.ClientAuthInfoWriter) (*GetPosOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPosParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPos", + Method: "GET", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPosReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPosOK) + 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 getPos: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostPos creates a new purchase order + + Create New Purchase Order +*/ +func (a *Client) PostPos(params *PostPosParams, authInfo runtime.ClientAuthInfoWriter) (*PostPosOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPosParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postPos", + Method: "POST", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostPosReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostPosOK) + 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 postPos: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutPos upserts a list of purchase order + + Upsert a list of Purchase Order +*/ +func (a *Client) PutPos(params *PutPosParams, authInfo runtime.ClientAuthInfoWriter) (*PutPosOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutPosParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putPos", + Method: "PUT", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutPosReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutPosOK) + 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 putPos: 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/sf-gate/sf_gate_client/purchase_orders/put_pos_parameters.go b/api/sf-gate/sf_gate_client/purchase_orders/put_pos_parameters.go new file mode 100644 index 0000000..5dd7de2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/purchase_orders/put_pos_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutPosParams creates a new PutPosParams object +// with the default values initialized. +func NewPutPosParams() *PutPosParams { + var () + return &PutPosParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutPosParamsWithTimeout creates a new PutPosParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutPosParamsWithTimeout(timeout time.Duration) *PutPosParams { + var () + return &PutPosParams{ + + timeout: timeout, + } +} + +// NewPutPosParamsWithContext creates a new PutPosParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutPosParamsWithContext(ctx context.Context) *PutPosParams { + var () + return &PutPosParams{ + + Context: ctx, + } +} + +// NewPutPosParamsWithHTTPClient creates a new PutPosParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutPosParamsWithHTTPClient(client *http.Client) *PutPosParams { + var () + return &PutPosParams{ + HTTPClient: client, + } +} + +/*PutPosParams contains all the parameters to send to the API endpoint +for the put pos operation typically these are written to a http.Request +*/ +type PutPosParams struct { + + /*PurchaseOrderRequest*/ + PurchaseOrderRequest *sf_gate_models.PurchaseOrderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put pos params +func (o *PutPosParams) WithTimeout(timeout time.Duration) *PutPosParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put pos params +func (o *PutPosParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put pos params +func (o *PutPosParams) WithContext(ctx context.Context) *PutPosParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put pos params +func (o *PutPosParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put pos params +func (o *PutPosParams) WithHTTPClient(client *http.Client) *PutPosParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put pos params +func (o *PutPosParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPurchaseOrderRequest adds the purchaseOrderRequest to the put pos params +func (o *PutPosParams) WithPurchaseOrderRequest(purchaseOrderRequest *sf_gate_models.PurchaseOrderRequest) *PutPosParams { + o.SetPurchaseOrderRequest(purchaseOrderRequest) + return o +} + +// SetPurchaseOrderRequest adds the purchaseOrderRequest to the put pos params +func (o *PutPosParams) SetPurchaseOrderRequest(purchaseOrderRequest *sf_gate_models.PurchaseOrderRequest) { + o.PurchaseOrderRequest = purchaseOrderRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutPosParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.PurchaseOrderRequest != nil { + if err := r.SetBodyParam(o.PurchaseOrderRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/purchase_orders/put_pos_responses.go b/api/sf-gate/sf_gate_client/purchase_orders/put_pos_responses.go new file mode 100644 index 0000000..d5e62b5 --- /dev/null +++ b/api/sf-gate/sf_gate_client/purchase_orders/put_pos_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutPosReader is a Reader for the PutPos structure. +type PutPosReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutPosReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutPosOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutPosUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutPosForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutPosNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutPosInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutPosOK creates a PutPosOK with default headers values +func NewPutPosOK() *PutPosOK { + return &PutPosOK{} +} + +/*PutPosOK handles this case with default header values. + +An array of Purchase Order objects +*/ +type PutPosOK struct { + Payload *sf_gate_models.PurchaseOrderResponse +} + +func (o *PutPosOK) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPosOK %+v", 200, o.Payload) +} + +func (o *PutPosOK) GetPayload() *sf_gate_models.PurchaseOrderResponse { + return o.Payload +} + +func (o *PutPosOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.PurchaseOrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPosUnauthorized creates a PutPosUnauthorized with default headers values +func NewPutPosUnauthorized() *PutPosUnauthorized { + return &PutPosUnauthorized{} +} + +/*PutPosUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutPosUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutPosUnauthorized) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPosUnauthorized %+v", 401, o.Payload) +} + +func (o *PutPosUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutPosUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPosForbidden creates a PutPosForbidden with default headers values +func NewPutPosForbidden() *PutPosForbidden { + return &PutPosForbidden{} +} + +/*PutPosForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutPosForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutPosForbidden) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPosForbidden %+v", 403, o.Payload) +} + +func (o *PutPosForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutPosForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPosNotFound creates a PutPosNotFound with default headers values +func NewPutPosNotFound() *PutPosNotFound { + return &PutPosNotFound{} +} + +/*PutPosNotFound handles this case with default header values. + +Resource was not found +*/ +type PutPosNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutPosNotFound) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPosNotFound %+v", 404, o.Payload) +} + +func (o *PutPosNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutPosNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutPosInternalServerError creates a PutPosInternalServerError with default headers values +func NewPutPosInternalServerError() *PutPosInternalServerError { + return &PutPosInternalServerError{} +} + +/*PutPosInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutPosInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutPosInternalServerError) Error() string { + return fmt.Sprintf("[PUT /pos][%d] putPosInternalServerError %+v", 500, o.Payload) +} + +func (o *PutPosInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutPosInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/quotes/get_quotes_parameters.go b/api/sf-gate/sf_gate_client/quotes/get_quotes_parameters.go new file mode 100644 index 0000000..7536ddf --- /dev/null +++ b/api/sf-gate/sf_gate_client/quotes/get_quotes_parameters.go @@ -0,0 +1,343 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quotes + +// 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" +) + +// NewGetQuotesParams creates a new GetQuotesParams object +// with the default values initialized. +func NewGetQuotesParams() *GetQuotesParams { + var () + return &GetQuotesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetQuotesParamsWithTimeout creates a new GetQuotesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetQuotesParamsWithTimeout(timeout time.Duration) *GetQuotesParams { + var () + return &GetQuotesParams{ + + timeout: timeout, + } +} + +// NewGetQuotesParamsWithContext creates a new GetQuotesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetQuotesParamsWithContext(ctx context.Context) *GetQuotesParams { + var () + return &GetQuotesParams{ + + Context: ctx, + } +} + +// NewGetQuotesParamsWithHTTPClient creates a new GetQuotesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetQuotesParamsWithHTTPClient(client *http.Client) *GetQuotesParams { + var () + return &GetQuotesParams{ + HTTPClient: client, + } +} + +/*GetQuotesParams contains all the parameters to send to the API endpoint +for the get quotes operation typically these are written to a http.Request +*/ +type GetQuotesParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*AccountNumber + The Taxnexus Account Number of the Account to be used a record retrieval + + */ + AccountNumber *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*QuoteID + Taxnexus Id of the Company to be retrieved + + */ + QuoteID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get quotes params +func (o *GetQuotesParams) WithTimeout(timeout time.Duration) *GetQuotesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get quotes params +func (o *GetQuotesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get quotes params +func (o *GetQuotesParams) WithContext(ctx context.Context) *GetQuotesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get quotes params +func (o *GetQuotesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get quotes params +func (o *GetQuotesParams) WithHTTPClient(client *http.Client) *GetQuotesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get quotes params +func (o *GetQuotesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get quotes params +func (o *GetQuotesParams) WithAccountID(accountID *string) *GetQuotesParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get quotes params +func (o *GetQuotesParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithAccountNumber adds the accountNumber to the get quotes params +func (o *GetQuotesParams) WithAccountNumber(accountNumber *string) *GetQuotesParams { + o.SetAccountNumber(accountNumber) + return o +} + +// SetAccountNumber adds the accountNumber to the get quotes params +func (o *GetQuotesParams) SetAccountNumber(accountNumber *string) { + o.AccountNumber = accountNumber +} + +// WithActive adds the active to the get quotes params +func (o *GetQuotesParams) WithActive(active *bool) *GetQuotesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get quotes params +func (o *GetQuotesParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get quotes params +func (o *GetQuotesParams) WithCompanyID(companyID *string) *GetQuotesParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get quotes params +func (o *GetQuotesParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get quotes params +func (o *GetQuotesParams) WithLimit(limit *int64) *GetQuotesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get quotes params +func (o *GetQuotesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get quotes params +func (o *GetQuotesParams) WithOffset(offset *int64) *GetQuotesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get quotes params +func (o *GetQuotesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQuoteID adds the quoteID to the get quotes params +func (o *GetQuotesParams) WithQuoteID(quoteID *string) *GetQuotesParams { + o.SetQuoteID(quoteID) + return o +} + +// SetQuoteID adds the quoteId to the get quotes params +func (o *GetQuotesParams) SetQuoteID(quoteID *string) { + o.QuoteID = quoteID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetQuotesParams) 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.AccountNumber != nil { + + // query param accountNumber + var qrAccountNumber string + if o.AccountNumber != nil { + qrAccountNumber = *o.AccountNumber + } + qAccountNumber := qrAccountNumber + if qAccountNumber != "" { + if err := r.SetQueryParam("accountNumber", qAccountNumber); 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.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.QuoteID != nil { + + // query param quoteId + var qrQuoteID string + if o.QuoteID != nil { + qrQuoteID = *o.QuoteID + } + qQuoteID := qrQuoteID + if qQuoteID != "" { + if err := r.SetQueryParam("quoteId", qQuoteID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/quotes/get_quotes_responses.go b/api/sf-gate/sf_gate_client/quotes/get_quotes_responses.go new file mode 100644 index 0000000..157f9f8 --- /dev/null +++ b/api/sf-gate/sf_gate_client/quotes/get_quotes_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quotes + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetQuotesReader is a Reader for the GetQuotes structure. +type GetQuotesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetQuotesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetQuotesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetQuotesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetQuotesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetQuotesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetQuotesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetQuotesOK creates a GetQuotesOK with default headers values +func NewGetQuotesOK() *GetQuotesOK { + return &GetQuotesOK{} +} + +/*GetQuotesOK handles this case with default header values. + +An array of Quote objects +*/ +type GetQuotesOK struct { + Payload *sf_gate_models.QuoteResponse +} + +func (o *GetQuotesOK) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesOK %+v", 200, o.Payload) +} + +func (o *GetQuotesOK) GetPayload() *sf_gate_models.QuoteResponse { + return o.Payload +} + +func (o *GetQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.QuoteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesUnauthorized creates a GetQuotesUnauthorized with default headers values +func NewGetQuotesUnauthorized() *GetQuotesUnauthorized { + return &GetQuotesUnauthorized{} +} + +/*GetQuotesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetQuotesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetQuotesUnauthorized) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetQuotesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesForbidden creates a GetQuotesForbidden with default headers values +func NewGetQuotesForbidden() *GetQuotesForbidden { + return &GetQuotesForbidden{} +} + +/*GetQuotesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetQuotesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetQuotesForbidden) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesForbidden %+v", 403, o.Payload) +} + +func (o *GetQuotesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesNotFound creates a GetQuotesNotFound with default headers values +func NewGetQuotesNotFound() *GetQuotesNotFound { + return &GetQuotesNotFound{} +} + +/*GetQuotesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetQuotesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetQuotesNotFound) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesNotFound %+v", 404, o.Payload) +} + +func (o *GetQuotesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesUnprocessableEntity creates a GetQuotesUnprocessableEntity with default headers values +func NewGetQuotesUnprocessableEntity() *GetQuotesUnprocessableEntity { + return &GetQuotesUnprocessableEntity{} +} + +/*GetQuotesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetQuotesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetQuotesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetQuotesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetQuotesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetQuotesInternalServerError creates a GetQuotesInternalServerError with default headers values +func NewGetQuotesInternalServerError() *GetQuotesInternalServerError { + return &GetQuotesInternalServerError{} +} + +/*GetQuotesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetQuotesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetQuotesInternalServerError) Error() string { + return fmt.Sprintf("[GET /quotes][%d] getQuotesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetQuotesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/quotes/post_quotes_parameters.go b/api/sf-gate/sf_gate_client/quotes/post_quotes_parameters.go new file mode 100644 index 0000000..eeb07eb --- /dev/null +++ b/api/sf-gate/sf_gate_client/quotes/post_quotes_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quotes + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostQuotesParams creates a new PostQuotesParams object +// with the default values initialized. +func NewPostQuotesParams() *PostQuotesParams { + var () + return &PostQuotesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostQuotesParamsWithTimeout creates a new PostQuotesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostQuotesParamsWithTimeout(timeout time.Duration) *PostQuotesParams { + var () + return &PostQuotesParams{ + + timeout: timeout, + } +} + +// NewPostQuotesParamsWithContext creates a new PostQuotesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostQuotesParamsWithContext(ctx context.Context) *PostQuotesParams { + var () + return &PostQuotesParams{ + + Context: ctx, + } +} + +// NewPostQuotesParamsWithHTTPClient creates a new PostQuotesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostQuotesParamsWithHTTPClient(client *http.Client) *PostQuotesParams { + var () + return &PostQuotesParams{ + HTTPClient: client, + } +} + +/*PostQuotesParams contains all the parameters to send to the API endpoint +for the post quotes operation typically these are written to a http.Request +*/ +type PostQuotesParams struct { + + /*Order*/ + Order *sf_gate_models.Order + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post quotes params +func (o *PostQuotesParams) WithTimeout(timeout time.Duration) *PostQuotesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post quotes params +func (o *PostQuotesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post quotes params +func (o *PostQuotesParams) WithContext(ctx context.Context) *PostQuotesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post quotes params +func (o *PostQuotesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post quotes params +func (o *PostQuotesParams) WithHTTPClient(client *http.Client) *PostQuotesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post quotes params +func (o *PostQuotesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrder adds the order to the post quotes params +func (o *PostQuotesParams) WithOrder(order *sf_gate_models.Order) *PostQuotesParams { + o.SetOrder(order) + return o +} + +// SetOrder adds the order to the post quotes params +func (o *PostQuotesParams) SetOrder(order *sf_gate_models.Order) { + o.Order = order +} + +// WriteToRequest writes these params to a swagger request +func (o *PostQuotesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Order != nil { + if err := r.SetBodyParam(o.Order); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/quotes/post_quotes_responses.go b/api/sf-gate/sf_gate_client/quotes/post_quotes_responses.go new file mode 100644 index 0000000..6ad52b6 --- /dev/null +++ b/api/sf-gate/sf_gate_client/quotes/post_quotes_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quotes + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostQuotesReader is a Reader for the PostQuotes structure. +type PostQuotesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostQuotesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostQuotesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostQuotesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostQuotesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostQuotesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostQuotesOK creates a PostQuotesOK with default headers values +func NewPostQuotesOK() *PostQuotesOK { + return &PostQuotesOK{} +} + +/*PostQuotesOK handles this case with default header values. + +An array of Quote objects +*/ +type PostQuotesOK struct { + Payload *sf_gate_models.QuoteResponse +} + +func (o *PostQuotesOK) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesOK %+v", 200, o.Payload) +} + +func (o *PostQuotesOK) GetPayload() *sf_gate_models.QuoteResponse { + return o.Payload +} + +func (o *PostQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.QuoteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesUnauthorized creates a PostQuotesUnauthorized with default headers values +func NewPostQuotesUnauthorized() *PostQuotesUnauthorized { + return &PostQuotesUnauthorized{} +} + +/*PostQuotesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostQuotesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostQuotesUnauthorized) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostQuotesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesForbidden creates a PostQuotesForbidden with default headers values +func NewPostQuotesForbidden() *PostQuotesForbidden { + return &PostQuotesForbidden{} +} + +/*PostQuotesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostQuotesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostQuotesForbidden) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesForbidden %+v", 403, o.Payload) +} + +func (o *PostQuotesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesNotFound creates a PostQuotesNotFound with default headers values +func NewPostQuotesNotFound() *PostQuotesNotFound { + return &PostQuotesNotFound{} +} + +/*PostQuotesNotFound handles this case with default header values. + +Resource was not found +*/ +type PostQuotesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostQuotesNotFound) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesNotFound %+v", 404, o.Payload) +} + +func (o *PostQuotesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostQuotesInternalServerError creates a PostQuotesInternalServerError with default headers values +func NewPostQuotesInternalServerError() *PostQuotesInternalServerError { + return &PostQuotesInternalServerError{} +} + +/*PostQuotesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostQuotesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostQuotesInternalServerError) Error() string { + return fmt.Sprintf("[POST /quotes][%d] postQuotesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostQuotesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/quotes/put_quotes_parameters.go b/api/sf-gate/sf_gate_client/quotes/put_quotes_parameters.go new file mode 100644 index 0000000..fa86f15 --- /dev/null +++ b/api/sf-gate/sf_gate_client/quotes/put_quotes_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quotes + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutQuotesParams creates a new PutQuotesParams object +// with the default values initialized. +func NewPutQuotesParams() *PutQuotesParams { + var () + return &PutQuotesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutQuotesParamsWithTimeout creates a new PutQuotesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutQuotesParamsWithTimeout(timeout time.Duration) *PutQuotesParams { + var () + return &PutQuotesParams{ + + timeout: timeout, + } +} + +// NewPutQuotesParamsWithContext creates a new PutQuotesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutQuotesParamsWithContext(ctx context.Context) *PutQuotesParams { + var () + return &PutQuotesParams{ + + Context: ctx, + } +} + +// NewPutQuotesParamsWithHTTPClient creates a new PutQuotesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutQuotesParamsWithHTTPClient(client *http.Client) *PutQuotesParams { + var () + return &PutQuotesParams{ + HTTPClient: client, + } +} + +/*PutQuotesParams contains all the parameters to send to the API endpoint +for the put quotes operation typically these are written to a http.Request +*/ +type PutQuotesParams struct { + + /*Order*/ + Order *sf_gate_models.Order + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put quotes params +func (o *PutQuotesParams) WithTimeout(timeout time.Duration) *PutQuotesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put quotes params +func (o *PutQuotesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put quotes params +func (o *PutQuotesParams) WithContext(ctx context.Context) *PutQuotesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put quotes params +func (o *PutQuotesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put quotes params +func (o *PutQuotesParams) WithHTTPClient(client *http.Client) *PutQuotesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put quotes params +func (o *PutQuotesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOrder adds the order to the put quotes params +func (o *PutQuotesParams) WithOrder(order *sf_gate_models.Order) *PutQuotesParams { + o.SetOrder(order) + return o +} + +// SetOrder adds the order to the put quotes params +func (o *PutQuotesParams) SetOrder(order *sf_gate_models.Order) { + o.Order = order +} + +// WriteToRequest writes these params to a swagger request +func (o *PutQuotesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Order != nil { + if err := r.SetBodyParam(o.Order); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/quotes/put_quotes_responses.go b/api/sf-gate/sf_gate_client/quotes/put_quotes_responses.go new file mode 100644 index 0000000..e077896 --- /dev/null +++ b/api/sf-gate/sf_gate_client/quotes/put_quotes_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quotes + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutQuotesReader is a Reader for the PutQuotes structure. +type PutQuotesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutQuotesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutQuotesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutQuotesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutQuotesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutQuotesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutQuotesOK creates a PutQuotesOK with default headers values +func NewPutQuotesOK() *PutQuotesOK { + return &PutQuotesOK{} +} + +/*PutQuotesOK handles this case with default header values. + +An array of Quote objects +*/ +type PutQuotesOK struct { + Payload *sf_gate_models.QuoteResponse +} + +func (o *PutQuotesOK) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesOK %+v", 200, o.Payload) +} + +func (o *PutQuotesOK) GetPayload() *sf_gate_models.QuoteResponse { + return o.Payload +} + +func (o *PutQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.QuoteResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesUnauthorized creates a PutQuotesUnauthorized with default headers values +func NewPutQuotesUnauthorized() *PutQuotesUnauthorized { + return &PutQuotesUnauthorized{} +} + +/*PutQuotesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutQuotesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutQuotesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutQuotesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesForbidden creates a PutQuotesForbidden with default headers values +func NewPutQuotesForbidden() *PutQuotesForbidden { + return &PutQuotesForbidden{} +} + +/*PutQuotesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutQuotesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutQuotesForbidden) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesForbidden %+v", 403, o.Payload) +} + +func (o *PutQuotesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesNotFound creates a PutQuotesNotFound with default headers values +func NewPutQuotesNotFound() *PutQuotesNotFound { + return &PutQuotesNotFound{} +} + +/*PutQuotesNotFound handles this case with default header values. + +Resource was not found +*/ +type PutQuotesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutQuotesNotFound) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesNotFound %+v", 404, o.Payload) +} + +func (o *PutQuotesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutQuotesInternalServerError creates a PutQuotesInternalServerError with default headers values +func NewPutQuotesInternalServerError() *PutQuotesInternalServerError { + return &PutQuotesInternalServerError{} +} + +/*PutQuotesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutQuotesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutQuotesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /quotes][%d] putQuotesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutQuotesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/quotes/quotes_client.go b/api/sf-gate/sf_gate_client/quotes/quotes_client.go new file mode 100644 index 0000000..d01df83 --- /dev/null +++ b/api/sf-gate/sf_gate_client/quotes/quotes_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package quotes + +// 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 quotes API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for quotes API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetQuotes(params *GetQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*GetQuotesOK, error) + + PostQuotes(params *PostQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PostQuotesOK, error) + + PutQuotes(params *PutQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PutQuotesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetQuotes gets a list of quotes + + Return a list of available Taxnexus Quotes +*/ +func (a *Client) GetQuotes(params *GetQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*GetQuotesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetQuotesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getQuotes", + Method: "GET", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetQuotesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetQuotesOK) + 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 getQuotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostQuotes creates new quotes + + Create new Quotes +*/ +func (a *Client) PostQuotes(params *PostQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PostQuotesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostQuotesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postQuotes", + Method: "POST", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostQuotesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostQuotesOK) + 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 postQuotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutQuotes updates quotes + + Update QUotes +*/ +func (a *Client) PutQuotes(params *PutQuotesParams, authInfo runtime.ClientAuthInfoWriter) (*PutQuotesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutQuotesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putQuotes", + Method: "PUT", + PathPattern: "/quotes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutQuotesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutQuotesOK) + 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 putQuotes: 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/sf-gate/sf_gate_client/roles/get_roles_parameters.go b/api/sf-gate/sf_gate_client/roles/get_roles_parameters.go new file mode 100644 index 0000000..44be13d --- /dev/null +++ b/api/sf-gate/sf_gate_client/roles/get_roles_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package roles + +// 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" +) + +// NewGetRolesParams creates a new GetRolesParams object +// with the default values initialized. +func NewGetRolesParams() *GetRolesParams { + var () + return &GetRolesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetRolesParamsWithTimeout creates a new GetRolesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetRolesParamsWithTimeout(timeout time.Duration) *GetRolesParams { + var () + return &GetRolesParams{ + + timeout: timeout, + } +} + +// NewGetRolesParamsWithContext creates a new GetRolesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetRolesParamsWithContext(ctx context.Context) *GetRolesParams { + var () + return &GetRolesParams{ + + Context: ctx, + } +} + +// NewGetRolesParamsWithHTTPClient creates a new GetRolesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetRolesParamsWithHTTPClient(client *http.Client) *GetRolesParams { + var () + return &GetRolesParams{ + HTTPClient: client, + } +} + +/*GetRolesParams contains all the parameters to send to the API endpoint +for the get roles operation typically these are written to a http.Request +*/ +type GetRolesParams struct { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*RoleID + Taxnexus Id of the Role to be retrieved + + */ + RoleID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get roles params +func (o *GetRolesParams) WithTimeout(timeout time.Duration) *GetRolesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get roles params +func (o *GetRolesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get roles params +func (o *GetRolesParams) WithContext(ctx context.Context) *GetRolesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get roles params +func (o *GetRolesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get roles params +func (o *GetRolesParams) WithHTTPClient(client *http.Client) *GetRolesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get roles params +func (o *GetRolesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the get roles params +func (o *GetRolesParams) WithLimit(limit *int64) *GetRolesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get roles params +func (o *GetRolesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get roles params +func (o *GetRolesParams) WithOffset(offset *int64) *GetRolesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get roles params +func (o *GetRolesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithRoleID adds the roleID to the get roles params +func (o *GetRolesParams) WithRoleID(roleID *string) *GetRolesParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the get roles params +func (o *GetRolesParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRolesParams) 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.RoleID != nil { + + // query param roleId + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("roleId", qRoleID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/roles/get_roles_responses.go b/api/sf-gate/sf_gate_client/roles/get_roles_responses.go new file mode 100644 index 0000000..0541d1a --- /dev/null +++ b/api/sf-gate/sf_gate_client/roles/get_roles_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package roles + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetRolesReader is a Reader for the GetRoles structure. +type GetRolesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRolesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetRolesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetRolesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetRolesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetRolesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetRolesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetRolesOK creates a GetRolesOK with default headers values +func NewGetRolesOK() *GetRolesOK { + return &GetRolesOK{} +} + +/*GetRolesOK handles this case with default header values. + +Taxnexus Response with Role objects +*/ +type GetRolesOK struct { + Payload *sf_gate_models.RoleResponse +} + +func (o *GetRolesOK) Error() string { + return fmt.Sprintf("[GET /roles][%d] getRolesOK %+v", 200, o.Payload) +} + +func (o *GetRolesOK) GetPayload() *sf_gate_models.RoleResponse { + return o.Payload +} + +func (o *GetRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.RoleResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesUnauthorized creates a GetRolesUnauthorized with default headers values +func NewGetRolesUnauthorized() *GetRolesUnauthorized { + return &GetRolesUnauthorized{} +} + +/*GetRolesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetRolesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetRolesUnauthorized) Error() string { + return fmt.Sprintf("[GET /roles][%d] getRolesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetRolesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetRolesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesForbidden creates a GetRolesForbidden with default headers values +func NewGetRolesForbidden() *GetRolesForbidden { + return &GetRolesForbidden{} +} + +/*GetRolesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetRolesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetRolesForbidden) Error() string { + return fmt.Sprintf("[GET /roles][%d] getRolesForbidden %+v", 403, o.Payload) +} + +func (o *GetRolesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetRolesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesNotFound creates a GetRolesNotFound with default headers values +func NewGetRolesNotFound() *GetRolesNotFound { + return &GetRolesNotFound{} +} + +/*GetRolesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetRolesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetRolesNotFound) Error() string { + return fmt.Sprintf("[GET /roles][%d] getRolesNotFound %+v", 404, o.Payload) +} + +func (o *GetRolesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetRolesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesUnprocessableEntity creates a GetRolesUnprocessableEntity with default headers values +func NewGetRolesUnprocessableEntity() *GetRolesUnprocessableEntity { + return &GetRolesUnprocessableEntity{} +} + +/*GetRolesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetRolesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetRolesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /roles][%d] getRolesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetRolesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetRolesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetRolesInternalServerError creates a GetRolesInternalServerError with default headers values +func NewGetRolesInternalServerError() *GetRolesInternalServerError { + return &GetRolesInternalServerError{} +} + +/*GetRolesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetRolesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetRolesInternalServerError) Error() string { + return fmt.Sprintf("[GET /roles][%d] getRolesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetRolesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetRolesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/roles/roles_client.go b/api/sf-gate/sf_gate_client/roles/roles_client.go new file mode 100644 index 0000000..b61e8a6 --- /dev/null +++ b/api/sf-gate/sf_gate_client/roles/roles_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package roles + +// 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 roles API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for roles API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetRoles(params *GetRolesParams, authInfo runtime.ClientAuthInfoWriter) (*GetRolesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetRoles gets a list of roles + + Return a list of Roles +*/ +func (a *Client) GetRoles(params *GetRolesParams, authInfo runtime.ClientAuthInfoWriter) (*GetRolesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetRolesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getRoles", + Method: "GET", + PathPattern: "/roles", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetRolesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetRolesOK) + 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 getRoles: 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/sf-gate/sf_gate_client/services/get_services_parameters.go b/api/sf-gate/sf_gate_client/services/get_services_parameters.go new file mode 100644 index 0000000..89857c4 --- /dev/null +++ b/api/sf-gate/sf_gate_client/services/get_services_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package services + +// 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 values initialized. +func NewGetServicesParams() *GetServicesParams { + var () + return &GetServicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetServicesParamsWithTimeout creates a new GetServicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetServicesParamsWithTimeout(timeout time.Duration) *GetServicesParams { + var () + return &GetServicesParams{ + + timeout: timeout, + } +} + +// NewGetServicesParamsWithContext creates a new GetServicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetServicesParamsWithContext(ctx context.Context) *GetServicesParams { + var () + return &GetServicesParams{ + + Context: ctx, + } +} + +// NewGetServicesParamsWithHTTPClient creates a new GetServicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetServicesParamsWithHTTPClient(client *http.Client) *GetServicesParams { + var () + 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 + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*ServiceID + Service ID + + */ + ServiceID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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/sf-gate/sf_gate_client/services/get_services_responses.go b/api/sf-gate/sf_gate_client/services/get_services_responses.go new file mode 100644 index 0000000..ae2f6f5 --- /dev/null +++ b/api/sf-gate/sf_gate_client/services/get_services_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package services + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetServicesOK creates a GetServicesOK with default headers values +func NewGetServicesOK() *GetServicesOK { + return &GetServicesOK{} +} + +/*GetServicesOK handles this case with default header values. + +Taxnexus Response with Service objects +*/ +type GetServicesOK struct { + Payload *sf_gate_models.ServiceResponse +} + +func (o *GetServicesOK) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesOK %+v", 200, o.Payload) +} + +func (o *GetServicesOK) GetPayload() *sf_gate_models.ServiceResponse { + return o.Payload +} + +func (o *GetServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetServicesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetServicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetServicesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetServicesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetServicesForbidden) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesForbidden %+v", 403, o.Payload) +} + +func (o *GetServicesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetServicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetServicesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetServicesNotFound) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesNotFound %+v", 404, o.Payload) +} + +func (o *GetServicesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetServicesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetServicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetServicesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetServicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetServicesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetServicesInternalServerError) Error() string { + return fmt.Sprintf("[GET /services][%d] getServicesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetServicesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetServicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/services/post_services_parameters.go b/api/sf-gate/sf_gate_client/services/post_services_parameters.go new file mode 100644 index 0000000..ef6bbc5 --- /dev/null +++ b/api/sf-gate/sf_gate_client/services/post_services_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package services + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostServicesParams creates a new PostServicesParams object +// with the default values initialized. +func NewPostServicesParams() *PostServicesParams { + var () + return &PostServicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostServicesParamsWithTimeout creates a new PostServicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostServicesParamsWithTimeout(timeout time.Duration) *PostServicesParams { + var () + return &PostServicesParams{ + + timeout: timeout, + } +} + +// NewPostServicesParamsWithContext creates a new PostServicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostServicesParamsWithContext(ctx context.Context) *PostServicesParams { + var () + return &PostServicesParams{ + + Context: ctx, + } +} + +// NewPostServicesParamsWithHTTPClient creates a new PostServicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostServicesParamsWithHTTPClient(client *http.Client) *PostServicesParams { + var () + 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 *sf_gate_models.ServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.ServiceRequest) *PostServicesParams { + o.SetServiceRequest(serviceRequest) + return o +} + +// SetServiceRequest adds the serviceRequest to the post services params +func (o *PostServicesParams) SetServiceRequest(serviceRequest *sf_gate_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/sf-gate/sf_gate_client/services/post_services_responses.go b/api/sf-gate/sf_gate_client/services/post_services_responses.go new file mode 100644 index 0000000..bdfc39b --- /dev/null +++ b/api/sf-gate/sf_gate_client/services/post_services_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package services + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPostServicesOK creates a PostServicesOK with default headers values +func NewPostServicesOK() *PostServicesOK { + return &PostServicesOK{} +} + +/*PostServicesOK handles this case with default header values. + +Taxnexus Response with Service objects +*/ +type PostServicesOK struct { + Payload *sf_gate_models.ServiceResponse +} + +func (o *PostServicesOK) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesOK %+v", 200, o.Payload) +} + +func (o *PostServicesOK) GetPayload() *sf_gate_models.ServiceResponse { + return o.Payload +} + +func (o *PostServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostServicesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostServicesUnauthorized) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PostServicesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostServicesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostServicesForbidden) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesForbidden %+v", 403, o.Payload) +} + +func (o *PostServicesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostServicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PostServicesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostServicesNotFound) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesNotFound %+v", 404, o.Payload) +} + +func (o *PostServicesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostServicesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PostServicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostServicesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostServicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PostServicesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostServicesInternalServerError) Error() string { + return fmt.Sprintf("[POST /services][%d] postServicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PostServicesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostServicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/services/put_services_parameters.go b/api/sf-gate/sf_gate_client/services/put_services_parameters.go new file mode 100644 index 0000000..12a808a --- /dev/null +++ b/api/sf-gate/sf_gate_client/services/put_services_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package services + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutServicesParams creates a new PutServicesParams object +// with the default values initialized. +func NewPutServicesParams() *PutServicesParams { + var () + return &PutServicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutServicesParamsWithTimeout creates a new PutServicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutServicesParamsWithTimeout(timeout time.Duration) *PutServicesParams { + var () + return &PutServicesParams{ + + timeout: timeout, + } +} + +// NewPutServicesParamsWithContext creates a new PutServicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutServicesParamsWithContext(ctx context.Context) *PutServicesParams { + var () + return &PutServicesParams{ + + Context: ctx, + } +} + +// NewPutServicesParamsWithHTTPClient creates a new PutServicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutServicesParamsWithHTTPClient(client *http.Client) *PutServicesParams { + var () + 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 *sf_gate_models.ServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 *sf_gate_models.ServiceRequest) *PutServicesParams { + o.SetServiceRequest(serviceRequest) + return o +} + +// SetServiceRequest adds the serviceRequest to the put services params +func (o *PutServicesParams) SetServiceRequest(serviceRequest *sf_gate_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/sf-gate/sf_gate_client/services/put_services_responses.go b/api/sf-gate/sf_gate_client/services/put_services_responses.go new file mode 100644 index 0000000..7058c2a --- /dev/null +++ b/api/sf-gate/sf_gate_client/services/put_services_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package services + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPutServicesOK creates a PutServicesOK with default headers values +func NewPutServicesOK() *PutServicesOK { + return &PutServicesOK{} +} + +/*PutServicesOK handles this case with default header values. + +Taxnexus Response with Service objects +*/ +type PutServicesOK struct { + Payload *sf_gate_models.ServiceResponse +} + +func (o *PutServicesOK) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesOK %+v", 200, o.Payload) +} + +func (o *PutServicesOK) GetPayload() *sf_gate_models.ServiceResponse { + return o.Payload +} + +func (o *PutServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutServicesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutServicesUnauthorized) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesUnauthorized %+v", 401, o.Payload) +} + +func (o *PutServicesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutServicesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutServicesForbidden) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesForbidden %+v", 403, o.Payload) +} + +func (o *PutServicesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutServicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutServicesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutServicesNotFound) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesNotFound %+v", 404, o.Payload) +} + +func (o *PutServicesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutServicesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PutServicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutServicesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutServicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutServicesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutServicesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /services][%d] putServicesInternalServerError %+v", 500, o.Payload) +} + +func (o *PutServicesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutServicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/services/services_client.go b/api/sf-gate/sf_gate_client/services/services_client.go new file mode 100644 index 0000000..0862527 --- /dev/null +++ b/api/sf-gate/sf_gate_client/services/services_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package services + +// 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 services API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for services API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetServices(params *GetServicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetServicesOK, error) + + PostServices(params *PostServicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostServicesOK, error) + + PutServices(params *PutServicesParams, authInfo runtime.ClientAuthInfoWriter) (*PutServicesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetServices gets a list of services + + Return a list of Services records from the datastore +*/ +func (a *Client) GetServices(params *GetServicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServicesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PostServices creates new services + + Create Services in Taxnexus +*/ +func (a *Client) PostServices(params *PostServicesParams, authInfo runtime.ClientAuthInfoWriter) (*PostServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostServicesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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 Taxnexus +*/ +func (a *Client) PutServices(params *PutServicesParams, authInfo runtime.ClientAuthInfoWriter) (*PutServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutServicesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/sf_gate_client.go b/api/sf-gate/sf_gate_client/sf_gate_client.go new file mode 100644 index 0000000..4dea241 --- /dev/null +++ b/api/sf-gate/sf_gate_client/sf_gate_client.go @@ -0,0 +1,316 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/accounting_rules" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/accounting_rulesets" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/accounts" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/authorities" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/backends" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/cash_receipts" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/clusters" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/companies" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/contacts" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/counties" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/countries" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/databases" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/domains" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/filing_types" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/filings" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/gl_accounts" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/gl_balances" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/ingests" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/invoices" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/jobs" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/license_types" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/licenses" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/notebooks" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/orders" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/periods" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/places" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/products" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/purchase_orders" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/quotes" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/roles" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/services" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/statements" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/states" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/submissions" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/subscriptions" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/tax_type_accounts" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/tax_types" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/taxnexus_codes" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/templates" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/tenants" + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_client/users" +) + +// Default sf gate HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "sf-gate.fabric.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 sf gate HTTP client. +func NewHTTPClient(formats strfmt.Registry) *SfGate { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new sf gate HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *SfGate { + // 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 sf gate client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *SfGate { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(SfGate) + cli.Transport = transport + cli.AccountingRules = accounting_rules.New(transport, formats) + cli.AccountingRulesets = accounting_rulesets.New(transport, formats) + cli.Accounts = accounts.New(transport, formats) + cli.Authorities = authorities.New(transport, formats) + cli.Backends = backends.New(transport, formats) + cli.CashReceipts = cash_receipts.New(transport, formats) + cli.Clusters = clusters.New(transport, formats) + cli.Companies = companies.New(transport, formats) + cli.Contacts = contacts.New(transport, formats) + cli.Counties = counties.New(transport, formats) + cli.Countries = countries.New(transport, formats) + cli.Databases = databases.New(transport, formats) + cli.Domains = domains.New(transport, formats) + cli.FilingTypes = filing_types.New(transport, formats) + cli.Filings = filings.New(transport, formats) + cli.GlAccounts = gl_accounts.New(transport, formats) + cli.GlBalances = gl_balances.New(transport, formats) + cli.Ingests = ingests.New(transport, formats) + cli.Invoices = invoices.New(transport, formats) + cli.Jobs = jobs.New(transport, formats) + cli.LicenseTypes = license_types.New(transport, formats) + cli.Licenses = licenses.New(transport, formats) + cli.Notebooks = notebooks.New(transport, formats) + cli.Orders = orders.New(transport, formats) + cli.Periods = periods.New(transport, formats) + cli.Places = places.New(transport, formats) + cli.Products = products.New(transport, formats) + cli.PurchaseOrders = purchase_orders.New(transport, formats) + cli.Quotes = quotes.New(transport, formats) + cli.Roles = roles.New(transport, formats) + cli.Services = services.New(transport, formats) + cli.Statements = statements.New(transport, formats) + cli.States = states.New(transport, formats) + cli.Submissions = submissions.New(transport, formats) + cli.Subscriptions = subscriptions.New(transport, formats) + cli.TaxTypeAccounts = tax_type_accounts.New(transport, formats) + cli.TaxTypes = tax_types.New(transport, formats) + cli.TaxnexusCodes = taxnexus_codes.New(transport, formats) + cli.Templates = templates.New(transport, formats) + cli.Tenants = tenants.New(transport, formats) + cli.Users = users.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 +} + +// SfGate is a client for sf gate +type SfGate struct { + AccountingRules accounting_rules.ClientService + + AccountingRulesets accounting_rulesets.ClientService + + Accounts accounts.ClientService + + Authorities authorities.ClientService + + Backends backends.ClientService + + CashReceipts cash_receipts.ClientService + + Clusters clusters.ClientService + + Companies companies.ClientService + + Contacts contacts.ClientService + + Counties counties.ClientService + + Countries countries.ClientService + + Databases databases.ClientService + + Domains domains.ClientService + + FilingTypes filing_types.ClientService + + Filings filings.ClientService + + GlAccounts gl_accounts.ClientService + + GlBalances gl_balances.ClientService + + Ingests ingests.ClientService + + Invoices invoices.ClientService + + Jobs jobs.ClientService + + LicenseTypes license_types.ClientService + + Licenses licenses.ClientService + + Notebooks notebooks.ClientService + + Orders orders.ClientService + + Periods periods.ClientService + + Places places.ClientService + + Products products.ClientService + + PurchaseOrders purchase_orders.ClientService + + Quotes quotes.ClientService + + Roles roles.ClientService + + Services services.ClientService + + Statements statements.ClientService + + States states.ClientService + + Submissions submissions.ClientService + + Subscriptions subscriptions.ClientService + + TaxTypeAccounts tax_type_accounts.ClientService + + TaxTypes tax_types.ClientService + + TaxnexusCodes taxnexus_codes.ClientService + + Templates templates.ClientService + + Tenants tenants.ClientService + + Users users.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *SfGate) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.AccountingRules.SetTransport(transport) + c.AccountingRulesets.SetTransport(transport) + c.Accounts.SetTransport(transport) + c.Authorities.SetTransport(transport) + c.Backends.SetTransport(transport) + c.CashReceipts.SetTransport(transport) + c.Clusters.SetTransport(transport) + c.Companies.SetTransport(transport) + c.Contacts.SetTransport(transport) + c.Counties.SetTransport(transport) + c.Countries.SetTransport(transport) + c.Databases.SetTransport(transport) + c.Domains.SetTransport(transport) + c.FilingTypes.SetTransport(transport) + c.Filings.SetTransport(transport) + c.GlAccounts.SetTransport(transport) + c.GlBalances.SetTransport(transport) + c.Ingests.SetTransport(transport) + c.Invoices.SetTransport(transport) + c.Jobs.SetTransport(transport) + c.LicenseTypes.SetTransport(transport) + c.Licenses.SetTransport(transport) + c.Notebooks.SetTransport(transport) + c.Orders.SetTransport(transport) + c.Periods.SetTransport(transport) + c.Places.SetTransport(transport) + c.Products.SetTransport(transport) + c.PurchaseOrders.SetTransport(transport) + c.Quotes.SetTransport(transport) + c.Roles.SetTransport(transport) + c.Services.SetTransport(transport) + c.Statements.SetTransport(transport) + c.States.SetTransport(transport) + c.Submissions.SetTransport(transport) + c.Subscriptions.SetTransport(transport) + c.TaxTypeAccounts.SetTransport(transport) + c.TaxTypes.SetTransport(transport) + c.TaxnexusCodes.SetTransport(transport) + c.Templates.SetTransport(transport) + c.Tenants.SetTransport(transport) + c.Users.SetTransport(transport) +} diff --git a/api/sf-gate/sf_gate_client/statements/get_statements_parameters.go b/api/sf-gate/sf_gate_client/statements/get_statements_parameters.go new file mode 100644 index 0000000..7685036 --- /dev/null +++ b/api/sf-gate/sf_gate_client/statements/get_statements_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package statements + +// 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" +) + +// NewGetStatementsParams creates a new GetStatementsParams object +// with the default values initialized. +func NewGetStatementsParams() *GetStatementsParams { + var () + return &GetStatementsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetStatementsParamsWithTimeout creates a new GetStatementsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetStatementsParamsWithTimeout(timeout time.Duration) *GetStatementsParams { + var () + return &GetStatementsParams{ + + timeout: timeout, + } +} + +// NewGetStatementsParamsWithContext creates a new GetStatementsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetStatementsParamsWithContext(ctx context.Context) *GetStatementsParams { + var () + return &GetStatementsParams{ + + Context: ctx, + } +} + +// NewGetStatementsParamsWithHTTPClient creates a new GetStatementsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetStatementsParamsWithHTTPClient(client *http.Client) *GetStatementsParams { + var () + return &GetStatementsParams{ + HTTPClient: client, + } +} + +/*GetStatementsParams contains all the parameters to send to the API endpoint +for the get statements operation typically these are written to a http.Request +*/ +type GetStatementsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*AccountNumber + The Taxnexus Account Number of the Account to be used a record retrieval + + */ + AccountNumber *string + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*StatementID + Taxnexus Id of the Company to be retrieved + + */ + StatementID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get statements params +func (o *GetStatementsParams) WithTimeout(timeout time.Duration) *GetStatementsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get statements params +func (o *GetStatementsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get statements params +func (o *GetStatementsParams) WithContext(ctx context.Context) *GetStatementsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get statements params +func (o *GetStatementsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get statements params +func (o *GetStatementsParams) WithHTTPClient(client *http.Client) *GetStatementsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get statements params +func (o *GetStatementsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get statements params +func (o *GetStatementsParams) WithAccountID(accountID *string) *GetStatementsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get statements params +func (o *GetStatementsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithAccountNumber adds the accountNumber to the get statements params +func (o *GetStatementsParams) WithAccountNumber(accountNumber *string) *GetStatementsParams { + o.SetAccountNumber(accountNumber) + return o +} + +// SetAccountNumber adds the accountNumber to the get statements params +func (o *GetStatementsParams) SetAccountNumber(accountNumber *string) { + o.AccountNumber = accountNumber +} + +// WithCompanyID adds the companyID to the get statements params +func (o *GetStatementsParams) WithCompanyID(companyID *string) *GetStatementsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get statements params +func (o *GetStatementsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get statements params +func (o *GetStatementsParams) WithLimit(limit *int64) *GetStatementsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get statements params +func (o *GetStatementsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get statements params +func (o *GetStatementsParams) WithOffset(offset *int64) *GetStatementsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get statements params +func (o *GetStatementsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithStatementID adds the statementID to the get statements params +func (o *GetStatementsParams) WithStatementID(statementID *string) *GetStatementsParams { + o.SetStatementID(statementID) + return o +} + +// SetStatementID adds the statementId to the get statements params +func (o *GetStatementsParams) SetStatementID(statementID *string) { + o.StatementID = statementID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStatementsParams) 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.AccountNumber != nil { + + // query param accountNumber + var qrAccountNumber string + if o.AccountNumber != nil { + qrAccountNumber = *o.AccountNumber + } + qAccountNumber := qrAccountNumber + if qAccountNumber != "" { + if err := r.SetQueryParam("accountNumber", qAccountNumber); 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.StatementID != nil { + + // query param statementId + var qrStatementID string + if o.StatementID != nil { + qrStatementID = *o.StatementID + } + qStatementID := qrStatementID + if qStatementID != "" { + if err := r.SetQueryParam("statementId", qStatementID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/statements/get_statements_responses.go b/api/sf-gate/sf_gate_client/statements/get_statements_responses.go new file mode 100644 index 0000000..27d83a3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/statements/get_statements_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package statements + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetStatementsReader is a Reader for the GetStatements structure. +type GetStatementsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStatementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStatementsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetStatementsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetStatementsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetStatementsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetStatementsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetStatementsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetStatementsOK creates a GetStatementsOK with default headers values +func NewGetStatementsOK() *GetStatementsOK { + return &GetStatementsOK{} +} + +/*GetStatementsOK handles this case with default header values. + +An array of Statement objects +*/ +type GetStatementsOK struct { + Payload *sf_gate_models.StatementResponse +} + +func (o *GetStatementsOK) Error() string { + return fmt.Sprintf("[GET /statements][%d] getStatementsOK %+v", 200, o.Payload) +} + +func (o *GetStatementsOK) GetPayload() *sf_gate_models.StatementResponse { + return o.Payload +} + +func (o *GetStatementsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.StatementResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatementsUnauthorized creates a GetStatementsUnauthorized with default headers values +func NewGetStatementsUnauthorized() *GetStatementsUnauthorized { + return &GetStatementsUnauthorized{} +} + +/*GetStatementsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetStatementsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatementsUnauthorized) Error() string { + return fmt.Sprintf("[GET /statements][%d] getStatementsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetStatementsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatementsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatementsForbidden creates a GetStatementsForbidden with default headers values +func NewGetStatementsForbidden() *GetStatementsForbidden { + return &GetStatementsForbidden{} +} + +/*GetStatementsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetStatementsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatementsForbidden) Error() string { + return fmt.Sprintf("[GET /statements][%d] getStatementsForbidden %+v", 403, o.Payload) +} + +func (o *GetStatementsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatementsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatementsNotFound creates a GetStatementsNotFound with default headers values +func NewGetStatementsNotFound() *GetStatementsNotFound { + return &GetStatementsNotFound{} +} + +/*GetStatementsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetStatementsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatementsNotFound) Error() string { + return fmt.Sprintf("[GET /statements][%d] getStatementsNotFound %+v", 404, o.Payload) +} + +func (o *GetStatementsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatementsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatementsUnprocessableEntity creates a GetStatementsUnprocessableEntity with default headers values +func NewGetStatementsUnprocessableEntity() *GetStatementsUnprocessableEntity { + return &GetStatementsUnprocessableEntity{} +} + +/*GetStatementsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetStatementsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatementsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /statements][%d] getStatementsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetStatementsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatementsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatementsInternalServerError creates a GetStatementsInternalServerError with default headers values +func NewGetStatementsInternalServerError() *GetStatementsInternalServerError { + return &GetStatementsInternalServerError{} +} + +/*GetStatementsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetStatementsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatementsInternalServerError) Error() string { + return fmt.Sprintf("[GET /statements][%d] getStatementsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetStatementsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatementsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/statements/post_statements_parameters.go b/api/sf-gate/sf_gate_client/statements/post_statements_parameters.go new file mode 100644 index 0000000..1ad1d17 --- /dev/null +++ b/api/sf-gate/sf_gate_client/statements/post_statements_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package statements + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostStatementsParams creates a new PostStatementsParams object +// with the default values initialized. +func NewPostStatementsParams() *PostStatementsParams { + var () + return &PostStatementsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostStatementsParamsWithTimeout creates a new PostStatementsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostStatementsParamsWithTimeout(timeout time.Duration) *PostStatementsParams { + var () + return &PostStatementsParams{ + + timeout: timeout, + } +} + +// NewPostStatementsParamsWithContext creates a new PostStatementsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostStatementsParamsWithContext(ctx context.Context) *PostStatementsParams { + var () + return &PostStatementsParams{ + + Context: ctx, + } +} + +// NewPostStatementsParamsWithHTTPClient creates a new PostStatementsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostStatementsParamsWithHTTPClient(client *http.Client) *PostStatementsParams { + var () + return &PostStatementsParams{ + HTTPClient: client, + } +} + +/*PostStatementsParams contains all the parameters to send to the API endpoint +for the post statements operation typically these are written to a http.Request +*/ +type PostStatementsParams struct { + + /*StatementsRequest + An array of new Statement records + + */ + StatementsRequest *sf_gate_models.StatementRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post statements params +func (o *PostStatementsParams) WithTimeout(timeout time.Duration) *PostStatementsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post statements params +func (o *PostStatementsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post statements params +func (o *PostStatementsParams) WithContext(ctx context.Context) *PostStatementsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post statements params +func (o *PostStatementsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post statements params +func (o *PostStatementsParams) WithHTTPClient(client *http.Client) *PostStatementsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post statements params +func (o *PostStatementsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStatementsRequest adds the statementsRequest to the post statements params +func (o *PostStatementsParams) WithStatementsRequest(statementsRequest *sf_gate_models.StatementRequest) *PostStatementsParams { + o.SetStatementsRequest(statementsRequest) + return o +} + +// SetStatementsRequest adds the statementsRequest to the post statements params +func (o *PostStatementsParams) SetStatementsRequest(statementsRequest *sf_gate_models.StatementRequest) { + o.StatementsRequest = statementsRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostStatementsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StatementsRequest != nil { + if err := r.SetBodyParam(o.StatementsRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/statements/post_statements_responses.go b/api/sf-gate/sf_gate_client/statements/post_statements_responses.go new file mode 100644 index 0000000..bc84fe5 --- /dev/null +++ b/api/sf-gate/sf_gate_client/statements/post_statements_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package statements + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostStatementsReader is a Reader for the PostStatements structure. +type PostStatementsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostStatementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostStatementsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostStatementsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostStatementsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostStatementsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostStatementsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostStatementsOK creates a PostStatementsOK with default headers values +func NewPostStatementsOK() *PostStatementsOK { + return &PostStatementsOK{} +} + +/*PostStatementsOK handles this case with default header values. + +An array of Statement objects +*/ +type PostStatementsOK struct { + Payload *sf_gate_models.StatementResponse +} + +func (o *PostStatementsOK) Error() string { + return fmt.Sprintf("[POST /statements][%d] postStatementsOK %+v", 200, o.Payload) +} + +func (o *PostStatementsOK) GetPayload() *sf_gate_models.StatementResponse { + return o.Payload +} + +func (o *PostStatementsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.StatementResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatementsUnauthorized creates a PostStatementsUnauthorized with default headers values +func NewPostStatementsUnauthorized() *PostStatementsUnauthorized { + return &PostStatementsUnauthorized{} +} + +/*PostStatementsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostStatementsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostStatementsUnauthorized) Error() string { + return fmt.Sprintf("[POST /statements][%d] postStatementsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostStatementsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostStatementsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatementsForbidden creates a PostStatementsForbidden with default headers values +func NewPostStatementsForbidden() *PostStatementsForbidden { + return &PostStatementsForbidden{} +} + +/*PostStatementsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostStatementsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostStatementsForbidden) Error() string { + return fmt.Sprintf("[POST /statements][%d] postStatementsForbidden %+v", 403, o.Payload) +} + +func (o *PostStatementsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostStatementsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatementsNotFound creates a PostStatementsNotFound with default headers values +func NewPostStatementsNotFound() *PostStatementsNotFound { + return &PostStatementsNotFound{} +} + +/*PostStatementsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostStatementsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostStatementsNotFound) Error() string { + return fmt.Sprintf("[POST /statements][%d] postStatementsNotFound %+v", 404, o.Payload) +} + +func (o *PostStatementsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostStatementsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostStatementsInternalServerError creates a PostStatementsInternalServerError with default headers values +func NewPostStatementsInternalServerError() *PostStatementsInternalServerError { + return &PostStatementsInternalServerError{} +} + +/*PostStatementsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostStatementsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostStatementsInternalServerError) Error() string { + return fmt.Sprintf("[POST /statements][%d] postStatementsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostStatementsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostStatementsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/statements/statements_client.go b/api/sf-gate/sf_gate_client/statements/statements_client.go new file mode 100644 index 0000000..bfc882f --- /dev/null +++ b/api/sf-gate/sf_gate_client/statements/statements_client.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package statements + +// 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 statements API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for statements API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetStatements(params *GetStatementsParams, authInfo runtime.ClientAuthInfoWriter) (*GetStatementsOK, error) + + PostStatements(params *PostStatementsParams, authInfo runtime.ClientAuthInfoWriter) (*PostStatementsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetStatements gets a list of statements + + Return a list of all available Statements +*/ +func (a *Client) GetStatements(params *GetStatementsParams, authInfo runtime.ClientAuthInfoWriter) (*GetStatementsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetStatementsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getStatements", + Method: "GET", + PathPattern: "/statements", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetStatementsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetStatementsOK) + 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 getStatements: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostStatements creates new statements + + Create a new Statement for a particular Account with a Date Range +*/ +func (a *Client) PostStatements(params *PostStatementsParams, authInfo runtime.ClientAuthInfoWriter) (*PostStatementsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostStatementsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postStatements", + Method: "POST", + PathPattern: "/statements", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostStatementsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostStatementsOK) + 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 postStatements: 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/sf-gate/sf_gate_client/states/get_states_parameters.go b/api/sf-gate/sf_gate_client/states/get_states_parameters.go new file mode 100644 index 0000000..ae2c54c --- /dev/null +++ b/api/sf-gate/sf_gate_client/states/get_states_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package states + +// 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" +) + +// NewGetStatesParams creates a new GetStatesParams object +// with the default values initialized. +func NewGetStatesParams() *GetStatesParams { + var () + return &GetStatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetStatesParamsWithTimeout creates a new GetStatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetStatesParamsWithTimeout(timeout time.Duration) *GetStatesParams { + var () + return &GetStatesParams{ + + timeout: timeout, + } +} + +// NewGetStatesParamsWithContext creates a new GetStatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetStatesParamsWithContext(ctx context.Context) *GetStatesParams { + var () + return &GetStatesParams{ + + Context: ctx, + } +} + +// NewGetStatesParamsWithHTTPClient creates a new GetStatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetStatesParamsWithHTTPClient(client *http.Client) *GetStatesParams { + var () + return &GetStatesParams{ + HTTPClient: client, + } +} + +/*GetStatesParams contains all the parameters to send to the API endpoint +for the get states operation typically these are written to a http.Request +*/ +type GetStatesParams struct { + + /*Country + The Country abbreviation (2 char) + + */ + Country *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*StateID + The State or Province abbreviation (2 char) + + */ + StateID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get states params +func (o *GetStatesParams) WithTimeout(timeout time.Duration) *GetStatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get states params +func (o *GetStatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get states params +func (o *GetStatesParams) WithContext(ctx context.Context) *GetStatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get states params +func (o *GetStatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get states params +func (o *GetStatesParams) WithHTTPClient(client *http.Client) *GetStatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get states params +func (o *GetStatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCountry adds the country to the get states params +func (o *GetStatesParams) WithCountry(country *string) *GetStatesParams { + o.SetCountry(country) + return o +} + +// SetCountry adds the country to the get states params +func (o *GetStatesParams) SetCountry(country *string) { + o.Country = country +} + +// WithLimit adds the limit to the get states params +func (o *GetStatesParams) WithLimit(limit *int64) *GetStatesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get states params +func (o *GetStatesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get states params +func (o *GetStatesParams) WithOffset(offset *int64) *GetStatesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get states params +func (o *GetStatesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithStateID adds the stateID to the get states params +func (o *GetStatesParams) WithStateID(stateID *string) *GetStatesParams { + o.SetStateID(stateID) + return o +} + +// SetStateID adds the stateId to the get states params +func (o *GetStatesParams) SetStateID(stateID *string) { + o.StateID = stateID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Country != nil { + + // query param country + var qrCountry string + if o.Country != nil { + qrCountry = *o.Country + } + qCountry := qrCountry + if qCountry != "" { + if err := r.SetQueryParam("country", qCountry); 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.StateID != nil { + + // query param stateId + var qrStateID string + if o.StateID != nil { + qrStateID = *o.StateID + } + qStateID := qrStateID + if qStateID != "" { + if err := r.SetQueryParam("stateId", qStateID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/states/get_states_responses.go b/api/sf-gate/sf_gate_client/states/get_states_responses.go new file mode 100644 index 0000000..592ab9e --- /dev/null +++ b/api/sf-gate/sf_gate_client/states/get_states_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package states + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetStatesReader is a Reader for the GetStates structure. +type GetStatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetStatesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetStatesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetStatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetStatesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetStatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetStatesOK creates a GetStatesOK with default headers values +func NewGetStatesOK() *GetStatesOK { + return &GetStatesOK{} +} + +/*GetStatesOK handles this case with default header values. + +Taxnexus Response with an array of State objects +*/ +type GetStatesOK struct { + Payload *sf_gate_models.StateResponse +} + +func (o *GetStatesOK) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesOK %+v", 200, o.Payload) +} + +func (o *GetStatesOK) GetPayload() *sf_gate_models.StateResponse { + return o.Payload +} + +func (o *GetStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.StateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesUnauthorized creates a GetStatesUnauthorized with default headers values +func NewGetStatesUnauthorized() *GetStatesUnauthorized { + return &GetStatesUnauthorized{} +} + +/*GetStatesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetStatesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetStatesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesForbidden creates a GetStatesForbidden with default headers values +func NewGetStatesForbidden() *GetStatesForbidden { + return &GetStatesForbidden{} +} + +/*GetStatesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetStatesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatesForbidden) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesForbidden %+v", 403, o.Payload) +} + +func (o *GetStatesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesNotFound creates a GetStatesNotFound with default headers values +func NewGetStatesNotFound() *GetStatesNotFound { + return &GetStatesNotFound{} +} + +/*GetStatesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetStatesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatesNotFound) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesNotFound %+v", 404, o.Payload) +} + +func (o *GetStatesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesUnprocessableEntity creates a GetStatesUnprocessableEntity with default headers values +func NewGetStatesUnprocessableEntity() *GetStatesUnprocessableEntity { + return &GetStatesUnprocessableEntity{} +} + +/*GetStatesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetStatesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetStatesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetStatesInternalServerError creates a GetStatesInternalServerError with default headers values +func NewGetStatesInternalServerError() *GetStatesInternalServerError { + return &GetStatesInternalServerError{} +} + +/*GetStatesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetStatesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetStatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /states][%d] getStatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetStatesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetStatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/states/states_client.go b/api/sf-gate/sf_gate_client/states/states_client.go new file mode 100644 index 0000000..3cb5048 --- /dev/null +++ b/api/sf-gate/sf_gate_client/states/states_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package states + +// 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 states API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for states API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetStates(params *GetStatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetStatesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetStates retrieves states + + Retrieve States, filter with parameters +*/ +func (a *Client) GetStates(params *GetStatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetStatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetStatesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getStates", + Method: "GET", + PathPattern: "/states", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetStatesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetStatesOK) + 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 getStates: 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/sf-gate/sf_gate_client/submissions/get_submissions_parameters.go b/api/sf-gate/sf_gate_client/submissions/get_submissions_parameters.go new file mode 100644 index 0000000..251ec11 --- /dev/null +++ b/api/sf-gate/sf_gate_client/submissions/get_submissions_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submissions + +// 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" +) + +// NewGetSubmissionsParams creates a new GetSubmissionsParams object +// with the default values initialized. +func NewGetSubmissionsParams() *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubmissionsParamsWithTimeout creates a new GetSubmissionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSubmissionsParamsWithTimeout(timeout time.Duration) *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + + timeout: timeout, + } +} + +// NewGetSubmissionsParamsWithContext creates a new GetSubmissionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSubmissionsParamsWithContext(ctx context.Context) *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + + Context: ctx, + } +} + +// NewGetSubmissionsParamsWithHTTPClient creates a new GetSubmissionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSubmissionsParamsWithHTTPClient(client *http.Client) *GetSubmissionsParams { + var () + return &GetSubmissionsParams{ + HTTPClient: client, + } +} + +/*GetSubmissionsParams contains all the parameters to send to the API endpoint +for the get submissions operation typically these are written to a http.Request +*/ +type GetSubmissionsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*SubmissionID + Taxnexus Id of the Submisssion to be retrieved + + */ + SubmissionID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get submissions params +func (o *GetSubmissionsParams) WithTimeout(timeout time.Duration) *GetSubmissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get submissions params +func (o *GetSubmissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get submissions params +func (o *GetSubmissionsParams) WithContext(ctx context.Context) *GetSubmissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get submissions params +func (o *GetSubmissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get submissions params +func (o *GetSubmissionsParams) WithHTTPClient(client *http.Client) *GetSubmissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get submissions params +func (o *GetSubmissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get submissions params +func (o *GetSubmissionsParams) WithAccountID(accountID *string) *GetSubmissionsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get submissions params +func (o *GetSubmissionsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get submissions params +func (o *GetSubmissionsParams) WithActive(active *bool) *GetSubmissionsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get submissions params +func (o *GetSubmissionsParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get submissions params +func (o *GetSubmissionsParams) WithCompanyID(companyID *string) *GetSubmissionsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get submissions params +func (o *GetSubmissionsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get submissions params +func (o *GetSubmissionsParams) WithLimit(limit *int64) *GetSubmissionsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get submissions params +func (o *GetSubmissionsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get submissions params +func (o *GetSubmissionsParams) WithOffset(offset *int64) *GetSubmissionsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get submissions params +func (o *GetSubmissionsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSubmissionID adds the submissionID to the get submissions params +func (o *GetSubmissionsParams) WithSubmissionID(submissionID *string) *GetSubmissionsParams { + o.SetSubmissionID(submissionID) + return o +} + +// SetSubmissionID adds the submissionId to the get submissions params +func (o *GetSubmissionsParams) SetSubmissionID(submissionID *string) { + o.SubmissionID = submissionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubmissionsParams) 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.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.SubmissionID != nil { + + // query param submissionId + var qrSubmissionID string + if o.SubmissionID != nil { + qrSubmissionID = *o.SubmissionID + } + qSubmissionID := qrSubmissionID + if qSubmissionID != "" { + if err := r.SetQueryParam("submissionId", qSubmissionID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/submissions/get_submissions_responses.go b/api/sf-gate/sf_gate_client/submissions/get_submissions_responses.go new file mode 100644 index 0000000..030af45 --- /dev/null +++ b/api/sf-gate/sf_gate_client/submissions/get_submissions_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submissions + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetSubmissionsReader is a Reader for the GetSubmissions structure. +type GetSubmissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubmissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubmissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSubmissionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSubmissionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSubmissionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetSubmissionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSubmissionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSubmissionsOK creates a GetSubmissionsOK with default headers values +func NewGetSubmissionsOK() *GetSubmissionsOK { + return &GetSubmissionsOK{} +} + +/*GetSubmissionsOK handles this case with default header values. + +Taxnexus Response with Submission objects +*/ +type GetSubmissionsOK struct { + Payload *sf_gate_models.SubmissionResponse +} + +func (o *GetSubmissionsOK) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsOK %+v", 200, o.Payload) +} + +func (o *GetSubmissionsOK) GetPayload() *sf_gate_models.SubmissionResponse { + return o.Payload +} + +func (o *GetSubmissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.SubmissionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsUnauthorized creates a GetSubmissionsUnauthorized with default headers values +func NewGetSubmissionsUnauthorized() *GetSubmissionsUnauthorized { + return &GetSubmissionsUnauthorized{} +} + +/*GetSubmissionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetSubmissionsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubmissionsUnauthorized) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSubmissionsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubmissionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsForbidden creates a GetSubmissionsForbidden with default headers values +func NewGetSubmissionsForbidden() *GetSubmissionsForbidden { + return &GetSubmissionsForbidden{} +} + +/*GetSubmissionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSubmissionsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubmissionsForbidden) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsForbidden %+v", 403, o.Payload) +} + +func (o *GetSubmissionsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubmissionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsNotFound creates a GetSubmissionsNotFound with default headers values +func NewGetSubmissionsNotFound() *GetSubmissionsNotFound { + return &GetSubmissionsNotFound{} +} + +/*GetSubmissionsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSubmissionsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubmissionsNotFound) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsNotFound %+v", 404, o.Payload) +} + +func (o *GetSubmissionsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubmissionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsUnprocessableEntity creates a GetSubmissionsUnprocessableEntity with default headers values +func NewGetSubmissionsUnprocessableEntity() *GetSubmissionsUnprocessableEntity { + return &GetSubmissionsUnprocessableEntity{} +} + +/*GetSubmissionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetSubmissionsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubmissionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetSubmissionsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubmissionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubmissionsInternalServerError creates a GetSubmissionsInternalServerError with default headers values +func NewGetSubmissionsInternalServerError() *GetSubmissionsInternalServerError { + return &GetSubmissionsInternalServerError{} +} + +/*GetSubmissionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSubmissionsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubmissionsInternalServerError) Error() string { + return fmt.Sprintf("[GET /submissions][%d] getSubmissionsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSubmissionsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubmissionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/submissions/post_submissions_parameters.go b/api/sf-gate/sf_gate_client/submissions/post_submissions_parameters.go new file mode 100644 index 0000000..14ea10f --- /dev/null +++ b/api/sf-gate/sf_gate_client/submissions/post_submissions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submissions + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostSubmissionsParams creates a new PostSubmissionsParams object +// with the default values initialized. +func NewPostSubmissionsParams() *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSubmissionsParamsWithTimeout creates a new PostSubmissionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSubmissionsParamsWithTimeout(timeout time.Duration) *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + + timeout: timeout, + } +} + +// NewPostSubmissionsParamsWithContext creates a new PostSubmissionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSubmissionsParamsWithContext(ctx context.Context) *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + + Context: ctx, + } +} + +// NewPostSubmissionsParamsWithHTTPClient creates a new PostSubmissionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSubmissionsParamsWithHTTPClient(client *http.Client) *PostSubmissionsParams { + var () + return &PostSubmissionsParams{ + HTTPClient: client, + } +} + +/*PostSubmissionsParams contains all the parameters to send to the API endpoint +for the post submissions operation typically these are written to a http.Request +*/ +type PostSubmissionsParams struct { + + /*SubmisssionsRequest + An array of new Submission records + + */ + SubmisssionsRequest *sf_gate_models.SubmissionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post submissions params +func (o *PostSubmissionsParams) WithTimeout(timeout time.Duration) *PostSubmissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post submissions params +func (o *PostSubmissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post submissions params +func (o *PostSubmissionsParams) WithContext(ctx context.Context) *PostSubmissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post submissions params +func (o *PostSubmissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post submissions params +func (o *PostSubmissionsParams) WithHTTPClient(client *http.Client) *PostSubmissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post submissions params +func (o *PostSubmissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubmisssionsRequest adds the submisssionsRequest to the post submissions params +func (o *PostSubmissionsParams) WithSubmisssionsRequest(submisssionsRequest *sf_gate_models.SubmissionRequest) *PostSubmissionsParams { + o.SetSubmisssionsRequest(submisssionsRequest) + return o +} + +// SetSubmisssionsRequest adds the submisssionsRequest to the post submissions params +func (o *PostSubmissionsParams) SetSubmisssionsRequest(submisssionsRequest *sf_gate_models.SubmissionRequest) { + o.SubmisssionsRequest = submisssionsRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSubmissionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubmisssionsRequest != nil { + if err := r.SetBodyParam(o.SubmisssionsRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/submissions/post_submissions_responses.go b/api/sf-gate/sf_gate_client/submissions/post_submissions_responses.go new file mode 100644 index 0000000..2011347 --- /dev/null +++ b/api/sf-gate/sf_gate_client/submissions/post_submissions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submissions + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostSubmissionsReader is a Reader for the PostSubmissions structure. +type PostSubmissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSubmissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSubmissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostSubmissionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostSubmissionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostSubmissionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostSubmissionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostSubmissionsOK creates a PostSubmissionsOK with default headers values +func NewPostSubmissionsOK() *PostSubmissionsOK { + return &PostSubmissionsOK{} +} + +/*PostSubmissionsOK handles this case with default header values. + +Taxnexus Response with Submission objects +*/ +type PostSubmissionsOK struct { + Payload *sf_gate_models.SubmissionResponse +} + +func (o *PostSubmissionsOK) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsOK %+v", 200, o.Payload) +} + +func (o *PostSubmissionsOK) GetPayload() *sf_gate_models.SubmissionResponse { + return o.Payload +} + +func (o *PostSubmissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.SubmissionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsUnauthorized creates a PostSubmissionsUnauthorized with default headers values +func NewPostSubmissionsUnauthorized() *PostSubmissionsUnauthorized { + return &PostSubmissionsUnauthorized{} +} + +/*PostSubmissionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostSubmissionsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubmissionsUnauthorized) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostSubmissionsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubmissionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsForbidden creates a PostSubmissionsForbidden with default headers values +func NewPostSubmissionsForbidden() *PostSubmissionsForbidden { + return &PostSubmissionsForbidden{} +} + +/*PostSubmissionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostSubmissionsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubmissionsForbidden) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsForbidden %+v", 403, o.Payload) +} + +func (o *PostSubmissionsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubmissionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsNotFound creates a PostSubmissionsNotFound with default headers values +func NewPostSubmissionsNotFound() *PostSubmissionsNotFound { + return &PostSubmissionsNotFound{} +} + +/*PostSubmissionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostSubmissionsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubmissionsNotFound) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsNotFound %+v", 404, o.Payload) +} + +func (o *PostSubmissionsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubmissionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubmissionsInternalServerError creates a PostSubmissionsInternalServerError with default headers values +func NewPostSubmissionsInternalServerError() *PostSubmissionsInternalServerError { + return &PostSubmissionsInternalServerError{} +} + +/*PostSubmissionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostSubmissionsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubmissionsInternalServerError) Error() string { + return fmt.Sprintf("[POST /submissions][%d] postSubmissionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostSubmissionsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubmissionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/submissions/put_submissions_parameters.go b/api/sf-gate/sf_gate_client/submissions/put_submissions_parameters.go new file mode 100644 index 0000000..1c52ee5 --- /dev/null +++ b/api/sf-gate/sf_gate_client/submissions/put_submissions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submissions + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutSubmissionsParams creates a new PutSubmissionsParams object +// with the default values initialized. +func NewPutSubmissionsParams() *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutSubmissionsParamsWithTimeout creates a new PutSubmissionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutSubmissionsParamsWithTimeout(timeout time.Duration) *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + + timeout: timeout, + } +} + +// NewPutSubmissionsParamsWithContext creates a new PutSubmissionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutSubmissionsParamsWithContext(ctx context.Context) *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + + Context: ctx, + } +} + +// NewPutSubmissionsParamsWithHTTPClient creates a new PutSubmissionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutSubmissionsParamsWithHTTPClient(client *http.Client) *PutSubmissionsParams { + var () + return &PutSubmissionsParams{ + HTTPClient: client, + } +} + +/*PutSubmissionsParams contains all the parameters to send to the API endpoint +for the put submissions operation typically these are written to a http.Request +*/ +type PutSubmissionsParams struct { + + /*SubmisssionsRequest + An array of new Submission records + + */ + SubmisssionsRequest *sf_gate_models.SubmissionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put submissions params +func (o *PutSubmissionsParams) WithTimeout(timeout time.Duration) *PutSubmissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put submissions params +func (o *PutSubmissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put submissions params +func (o *PutSubmissionsParams) WithContext(ctx context.Context) *PutSubmissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put submissions params +func (o *PutSubmissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put submissions params +func (o *PutSubmissionsParams) WithHTTPClient(client *http.Client) *PutSubmissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put submissions params +func (o *PutSubmissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubmisssionsRequest adds the submisssionsRequest to the put submissions params +func (o *PutSubmissionsParams) WithSubmisssionsRequest(submisssionsRequest *sf_gate_models.SubmissionRequest) *PutSubmissionsParams { + o.SetSubmisssionsRequest(submisssionsRequest) + return o +} + +// SetSubmisssionsRequest adds the submisssionsRequest to the put submissions params +func (o *PutSubmissionsParams) SetSubmisssionsRequest(submisssionsRequest *sf_gate_models.SubmissionRequest) { + o.SubmisssionsRequest = submisssionsRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutSubmissionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubmisssionsRequest != nil { + if err := r.SetBodyParam(o.SubmisssionsRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/submissions/put_submissions_responses.go b/api/sf-gate/sf_gate_client/submissions/put_submissions_responses.go new file mode 100644 index 0000000..a03769a --- /dev/null +++ b/api/sf-gate/sf_gate_client/submissions/put_submissions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submissions + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutSubmissionsReader is a Reader for the PutSubmissions structure. +type PutSubmissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutSubmissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutSubmissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutSubmissionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutSubmissionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutSubmissionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutSubmissionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutSubmissionsOK creates a PutSubmissionsOK with default headers values +func NewPutSubmissionsOK() *PutSubmissionsOK { + return &PutSubmissionsOK{} +} + +/*PutSubmissionsOK handles this case with default header values. + +Taxnexus Response with Submission objects +*/ +type PutSubmissionsOK struct { + Payload *sf_gate_models.SubmissionResponse +} + +func (o *PutSubmissionsOK) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsOK %+v", 200, o.Payload) +} + +func (o *PutSubmissionsOK) GetPayload() *sf_gate_models.SubmissionResponse { + return o.Payload +} + +func (o *PutSubmissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.SubmissionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsUnauthorized creates a PutSubmissionsUnauthorized with default headers values +func NewPutSubmissionsUnauthorized() *PutSubmissionsUnauthorized { + return &PutSubmissionsUnauthorized{} +} + +/*PutSubmissionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutSubmissionsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubmissionsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutSubmissionsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubmissionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsForbidden creates a PutSubmissionsForbidden with default headers values +func NewPutSubmissionsForbidden() *PutSubmissionsForbidden { + return &PutSubmissionsForbidden{} +} + +/*PutSubmissionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutSubmissionsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubmissionsForbidden) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsForbidden %+v", 403, o.Payload) +} + +func (o *PutSubmissionsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubmissionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsNotFound creates a PutSubmissionsNotFound with default headers values +func NewPutSubmissionsNotFound() *PutSubmissionsNotFound { + return &PutSubmissionsNotFound{} +} + +/*PutSubmissionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutSubmissionsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubmissionsNotFound) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsNotFound %+v", 404, o.Payload) +} + +func (o *PutSubmissionsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubmissionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubmissionsInternalServerError creates a PutSubmissionsInternalServerError with default headers values +func NewPutSubmissionsInternalServerError() *PutSubmissionsInternalServerError { + return &PutSubmissionsInternalServerError{} +} + +/*PutSubmissionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutSubmissionsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubmissionsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /submissions][%d] putSubmissionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutSubmissionsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubmissionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/submissions/submissions_client.go b/api/sf-gate/sf_gate_client/submissions/submissions_client.go new file mode 100644 index 0000000..da58506 --- /dev/null +++ b/api/sf-gate/sf_gate_client/submissions/submissions_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package submissions + +// 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 submissions API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for submissions API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetSubmissions(params *GetSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubmissionsOK, error) + + PostSubmissions(params *PostSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubmissionsOK, error) + + PutSubmissions(params *PutSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubmissionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetSubmissions gets a list of submissions + + Return a list of available Submissions +*/ +func (a *Client) GetSubmissions(params *GetSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubmissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubmissionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSubmissions", + Method: "GET", + PathPattern: "/submissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSubmissionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSubmissionsOK) + 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 getSubmissions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostSubmissions adds new submissions + + Create new Sumissions +*/ +func (a *Client) PostSubmissions(params *PostSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubmissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSubmissionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postSubmissions", + Method: "POST", + PathPattern: "/submissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSubmissionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostSubmissionsOK) + 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 postSubmissions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutSubmissions updates a submission + + Update all the fields in a Submission record identified by Taxnexus Id +*/ +func (a *Client) PutSubmissions(params *PutSubmissionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubmissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutSubmissionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putSubmissions", + Method: "PUT", + PathPattern: "/submissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutSubmissionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutSubmissionsOK) + 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 putSubmissions: 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/sf-gate/sf_gate_client/subscriptions/get_subscriptions_parameters.go b/api/sf-gate/sf_gate_client/subscriptions/get_subscriptions_parameters.go new file mode 100644 index 0000000..da30568 --- /dev/null +++ b/api/sf-gate/sf_gate_client/subscriptions/get_subscriptions_parameters.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package subscriptions + +// 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" +) + +// NewGetSubscriptionsParams creates a new GetSubscriptionsParams object +// with the default values initialized. +func NewGetSubscriptionsParams() *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubscriptionsParamsWithTimeout creates a new GetSubscriptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSubscriptionsParamsWithTimeout(timeout time.Duration) *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + + timeout: timeout, + } +} + +// NewGetSubscriptionsParamsWithContext creates a new GetSubscriptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSubscriptionsParamsWithContext(ctx context.Context) *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + + Context: ctx, + } +} + +// NewGetSubscriptionsParamsWithHTTPClient creates a new GetSubscriptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSubscriptionsParamsWithHTTPClient(client *http.Client) *GetSubscriptionsParams { + var () + return &GetSubscriptionsParams{ + HTTPClient: client, + } +} + +/*GetSubscriptionsParams contains all the parameters to send to the API endpoint +for the get subscriptions operation typically these are written to a http.Request +*/ +type GetSubscriptionsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*SubscriptionID + Taxnexus Id of the Subscription to be retrieved + + */ + SubscriptionID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get subscriptions params +func (o *GetSubscriptionsParams) WithTimeout(timeout time.Duration) *GetSubscriptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get subscriptions params +func (o *GetSubscriptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get subscriptions params +func (o *GetSubscriptionsParams) WithContext(ctx context.Context) *GetSubscriptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get subscriptions params +func (o *GetSubscriptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get subscriptions params +func (o *GetSubscriptionsParams) WithHTTPClient(client *http.Client) *GetSubscriptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get subscriptions params +func (o *GetSubscriptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get subscriptions params +func (o *GetSubscriptionsParams) WithAccountID(accountID *string) *GetSubscriptionsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get subscriptions params +func (o *GetSubscriptionsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get subscriptions params +func (o *GetSubscriptionsParams) WithActive(active *bool) *GetSubscriptionsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get subscriptions params +func (o *GetSubscriptionsParams) SetActive(active *bool) { + o.Active = active +} + +// WithCompanyID adds the companyID to the get subscriptions params +func (o *GetSubscriptionsParams) WithCompanyID(companyID *string) *GetSubscriptionsParams { + o.SetCompanyID(companyID) + return o +} + +// SetCompanyID adds the companyId to the get subscriptions params +func (o *GetSubscriptionsParams) SetCompanyID(companyID *string) { + o.CompanyID = companyID +} + +// WithLimit adds the limit to the get subscriptions params +func (o *GetSubscriptionsParams) WithLimit(limit *int64) *GetSubscriptionsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get subscriptions params +func (o *GetSubscriptionsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get subscriptions params +func (o *GetSubscriptionsParams) WithOffset(offset *int64) *GetSubscriptionsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get subscriptions params +func (o *GetSubscriptionsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSubscriptionID adds the subscriptionID to the get subscriptions params +func (o *GetSubscriptionsParams) WithSubscriptionID(subscriptionID *string) *GetSubscriptionsParams { + o.SetSubscriptionID(subscriptionID) + return o +} + +// SetSubscriptionID adds the subscriptionId to the get subscriptions params +func (o *GetSubscriptionsParams) SetSubscriptionID(subscriptionID *string) { + o.SubscriptionID = subscriptionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubscriptionsParams) 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.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.SubscriptionID != nil { + + // query param subscriptionId + var qrSubscriptionID string + if o.SubscriptionID != nil { + qrSubscriptionID = *o.SubscriptionID + } + qSubscriptionID := qrSubscriptionID + if qSubscriptionID != "" { + if err := r.SetQueryParam("subscriptionId", qSubscriptionID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/subscriptions/get_subscriptions_responses.go b/api/sf-gate/sf_gate_client/subscriptions/get_subscriptions_responses.go new file mode 100644 index 0000000..0a6c5d3 --- /dev/null +++ b/api/sf-gate/sf_gate_client/subscriptions/get_subscriptions_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package subscriptions + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetSubscriptionsReader is a Reader for the GetSubscriptions structure. +type GetSubscriptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubscriptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSubscriptionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSubscriptionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSubscriptionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetSubscriptionsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSubscriptionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetSubscriptionsOK creates a GetSubscriptionsOK with default headers values +func NewGetSubscriptionsOK() *GetSubscriptionsOK { + return &GetSubscriptionsOK{} +} + +/*GetSubscriptionsOK handles this case with default header values. + +An array of Subscription Objects +*/ +type GetSubscriptionsOK struct { + Payload *sf_gate_models.SubscriptionResponse +} + +func (o *GetSubscriptionsOK) Error() string { + return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsOK %+v", 200, o.Payload) +} + +func (o *GetSubscriptionsOK) GetPayload() *sf_gate_models.SubscriptionResponse { + return o.Payload +} + +func (o *GetSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.SubscriptionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubscriptionsUnauthorized creates a GetSubscriptionsUnauthorized with default headers values +func NewGetSubscriptionsUnauthorized() *GetSubscriptionsUnauthorized { + return &GetSubscriptionsUnauthorized{} +} + +/*GetSubscriptionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetSubscriptionsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubscriptionsUnauthorized) Error() string { + return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSubscriptionsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubscriptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubscriptionsForbidden creates a GetSubscriptionsForbidden with default headers values +func NewGetSubscriptionsForbidden() *GetSubscriptionsForbidden { + return &GetSubscriptionsForbidden{} +} + +/*GetSubscriptionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetSubscriptionsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubscriptionsForbidden) Error() string { + return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsForbidden %+v", 403, o.Payload) +} + +func (o *GetSubscriptionsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubscriptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubscriptionsNotFound creates a GetSubscriptionsNotFound with default headers values +func NewGetSubscriptionsNotFound() *GetSubscriptionsNotFound { + return &GetSubscriptionsNotFound{} +} + +/*GetSubscriptionsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetSubscriptionsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubscriptionsNotFound) Error() string { + return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsNotFound %+v", 404, o.Payload) +} + +func (o *GetSubscriptionsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubscriptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubscriptionsUnprocessableEntity creates a GetSubscriptionsUnprocessableEntity with default headers values +func NewGetSubscriptionsUnprocessableEntity() *GetSubscriptionsUnprocessableEntity { + return &GetSubscriptionsUnprocessableEntity{} +} + +/*GetSubscriptionsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetSubscriptionsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubscriptionsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetSubscriptionsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubscriptionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSubscriptionsInternalServerError creates a GetSubscriptionsInternalServerError with default headers values +func NewGetSubscriptionsInternalServerError() *GetSubscriptionsInternalServerError { + return &GetSubscriptionsInternalServerError{} +} + +/*GetSubscriptionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetSubscriptionsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetSubscriptionsInternalServerError) Error() string { + return fmt.Sprintf("[GET /subscriptions][%d] getSubscriptionsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSubscriptionsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetSubscriptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/subscriptions/post_subscriptions_parameters.go b/api/sf-gate/sf_gate_client/subscriptions/post_subscriptions_parameters.go new file mode 100644 index 0000000..717d666 --- /dev/null +++ b/api/sf-gate/sf_gate_client/subscriptions/post_subscriptions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package subscriptions + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostSubscriptionsParams creates a new PostSubscriptionsParams object +// with the default values initialized. +func NewPostSubscriptionsParams() *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostSubscriptionsParamsWithTimeout creates a new PostSubscriptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostSubscriptionsParamsWithTimeout(timeout time.Duration) *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + + timeout: timeout, + } +} + +// NewPostSubscriptionsParamsWithContext creates a new PostSubscriptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostSubscriptionsParamsWithContext(ctx context.Context) *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + + Context: ctx, + } +} + +// NewPostSubscriptionsParamsWithHTTPClient creates a new PostSubscriptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostSubscriptionsParamsWithHTTPClient(client *http.Client) *PostSubscriptionsParams { + var () + return &PostSubscriptionsParams{ + HTTPClient: client, + } +} + +/*PostSubscriptionsParams contains all the parameters to send to the API endpoint +for the post subscriptions operation typically these are written to a http.Request +*/ +type PostSubscriptionsParams struct { + + /*SubscriptionRequest + A request with an array of Subscription Objects + + */ + SubscriptionRequest *sf_gate_models.SubscriptionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post subscriptions params +func (o *PostSubscriptionsParams) WithTimeout(timeout time.Duration) *PostSubscriptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post subscriptions params +func (o *PostSubscriptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post subscriptions params +func (o *PostSubscriptionsParams) WithContext(ctx context.Context) *PostSubscriptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post subscriptions params +func (o *PostSubscriptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post subscriptions params +func (o *PostSubscriptionsParams) WithHTTPClient(client *http.Client) *PostSubscriptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post subscriptions params +func (o *PostSubscriptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubscriptionRequest adds the subscriptionRequest to the post subscriptions params +func (o *PostSubscriptionsParams) WithSubscriptionRequest(subscriptionRequest *sf_gate_models.SubscriptionRequest) *PostSubscriptionsParams { + o.SetSubscriptionRequest(subscriptionRequest) + return o +} + +// SetSubscriptionRequest adds the subscriptionRequest to the post subscriptions params +func (o *PostSubscriptionsParams) SetSubscriptionRequest(subscriptionRequest *sf_gate_models.SubscriptionRequest) { + o.SubscriptionRequest = subscriptionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostSubscriptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubscriptionRequest != nil { + if err := r.SetBodyParam(o.SubscriptionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/subscriptions/post_subscriptions_responses.go b/api/sf-gate/sf_gate_client/subscriptions/post_subscriptions_responses.go new file mode 100644 index 0000000..7eaedcb --- /dev/null +++ b/api/sf-gate/sf_gate_client/subscriptions/post_subscriptions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package subscriptions + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostSubscriptionsReader is a Reader for the PostSubscriptions structure. +type PostSubscriptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostSubscriptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostSubscriptionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostSubscriptionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostSubscriptionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostSubscriptionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostSubscriptionsOK creates a PostSubscriptionsOK with default headers values +func NewPostSubscriptionsOK() *PostSubscriptionsOK { + return &PostSubscriptionsOK{} +} + +/*PostSubscriptionsOK handles this case with default header values. + +An array of Subscription Objects +*/ +type PostSubscriptionsOK struct { + Payload *sf_gate_models.SubscriptionResponse +} + +func (o *PostSubscriptionsOK) Error() string { + return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsOK %+v", 200, o.Payload) +} + +func (o *PostSubscriptionsOK) GetPayload() *sf_gate_models.SubscriptionResponse { + return o.Payload +} + +func (o *PostSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.SubscriptionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubscriptionsUnauthorized creates a PostSubscriptionsUnauthorized with default headers values +func NewPostSubscriptionsUnauthorized() *PostSubscriptionsUnauthorized { + return &PostSubscriptionsUnauthorized{} +} + +/*PostSubscriptionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostSubscriptionsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubscriptionsUnauthorized) Error() string { + return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostSubscriptionsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubscriptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubscriptionsForbidden creates a PostSubscriptionsForbidden with default headers values +func NewPostSubscriptionsForbidden() *PostSubscriptionsForbidden { + return &PostSubscriptionsForbidden{} +} + +/*PostSubscriptionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostSubscriptionsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubscriptionsForbidden) Error() string { + return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsForbidden %+v", 403, o.Payload) +} + +func (o *PostSubscriptionsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubscriptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubscriptionsNotFound creates a PostSubscriptionsNotFound with default headers values +func NewPostSubscriptionsNotFound() *PostSubscriptionsNotFound { + return &PostSubscriptionsNotFound{} +} + +/*PostSubscriptionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostSubscriptionsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubscriptionsNotFound) Error() string { + return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsNotFound %+v", 404, o.Payload) +} + +func (o *PostSubscriptionsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubscriptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostSubscriptionsInternalServerError creates a PostSubscriptionsInternalServerError with default headers values +func NewPostSubscriptionsInternalServerError() *PostSubscriptionsInternalServerError { + return &PostSubscriptionsInternalServerError{} +} + +/*PostSubscriptionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostSubscriptionsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostSubscriptionsInternalServerError) Error() string { + return fmt.Sprintf("[POST /subscriptions][%d] postSubscriptionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostSubscriptionsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostSubscriptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/subscriptions/put_subscriptions_parameters.go b/api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_parameters.go new file mode 100644 index 0000000..c5b0d9d --- /dev/null +++ b/api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package subscriptions + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutSubscriptionsParams creates a new PutSubscriptionsParams object +// with the default values initialized. +func NewPutSubscriptionsParams() *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutSubscriptionsParamsWithTimeout creates a new PutSubscriptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutSubscriptionsParamsWithTimeout(timeout time.Duration) *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + + timeout: timeout, + } +} + +// NewPutSubscriptionsParamsWithContext creates a new PutSubscriptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutSubscriptionsParamsWithContext(ctx context.Context) *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + + Context: ctx, + } +} + +// NewPutSubscriptionsParamsWithHTTPClient creates a new PutSubscriptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutSubscriptionsParamsWithHTTPClient(client *http.Client) *PutSubscriptionsParams { + var () + return &PutSubscriptionsParams{ + HTTPClient: client, + } +} + +/*PutSubscriptionsParams contains all the parameters to send to the API endpoint +for the put subscriptions operation typically these are written to a http.Request +*/ +type PutSubscriptionsParams struct { + + /*SubscriptionRequest + A request with an array of Subscription Objects + + */ + SubscriptionRequest *sf_gate_models.SubscriptionRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put subscriptions params +func (o *PutSubscriptionsParams) WithTimeout(timeout time.Duration) *PutSubscriptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put subscriptions params +func (o *PutSubscriptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put subscriptions params +func (o *PutSubscriptionsParams) WithContext(ctx context.Context) *PutSubscriptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put subscriptions params +func (o *PutSubscriptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put subscriptions params +func (o *PutSubscriptionsParams) WithHTTPClient(client *http.Client) *PutSubscriptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put subscriptions params +func (o *PutSubscriptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubscriptionRequest adds the subscriptionRequest to the put subscriptions params +func (o *PutSubscriptionsParams) WithSubscriptionRequest(subscriptionRequest *sf_gate_models.SubscriptionRequest) *PutSubscriptionsParams { + o.SetSubscriptionRequest(subscriptionRequest) + return o +} + +// SetSubscriptionRequest adds the subscriptionRequest to the put subscriptions params +func (o *PutSubscriptionsParams) SetSubscriptionRequest(subscriptionRequest *sf_gate_models.SubscriptionRequest) { + o.SubscriptionRequest = subscriptionRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PutSubscriptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SubscriptionRequest != nil { + if err := r.SetBodyParam(o.SubscriptionRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_responses.go b/api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_responses.go new file mode 100644 index 0000000..54c3636 --- /dev/null +++ b/api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package subscriptions + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutSubscriptionsReader is a Reader for the PutSubscriptions structure. +type PutSubscriptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutSubscriptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutSubscriptionsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutSubscriptionsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutSubscriptionsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutSubscriptionsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutSubscriptionsOK creates a PutSubscriptionsOK with default headers values +func NewPutSubscriptionsOK() *PutSubscriptionsOK { + return &PutSubscriptionsOK{} +} + +/*PutSubscriptionsOK handles this case with default header values. + +An array of Subscription Objects +*/ +type PutSubscriptionsOK struct { + Payload *sf_gate_models.SubscriptionResponse +} + +func (o *PutSubscriptionsOK) Error() string { + return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsOK %+v", 200, o.Payload) +} + +func (o *PutSubscriptionsOK) GetPayload() *sf_gate_models.SubscriptionResponse { + return o.Payload +} + +func (o *PutSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.SubscriptionResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubscriptionsUnauthorized creates a PutSubscriptionsUnauthorized with default headers values +func NewPutSubscriptionsUnauthorized() *PutSubscriptionsUnauthorized { + return &PutSubscriptionsUnauthorized{} +} + +/*PutSubscriptionsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutSubscriptionsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubscriptionsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutSubscriptionsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubscriptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubscriptionsForbidden creates a PutSubscriptionsForbidden with default headers values +func NewPutSubscriptionsForbidden() *PutSubscriptionsForbidden { + return &PutSubscriptionsForbidden{} +} + +/*PutSubscriptionsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutSubscriptionsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubscriptionsForbidden) Error() string { + return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsForbidden %+v", 403, o.Payload) +} + +func (o *PutSubscriptionsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubscriptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubscriptionsNotFound creates a PutSubscriptionsNotFound with default headers values +func NewPutSubscriptionsNotFound() *PutSubscriptionsNotFound { + return &PutSubscriptionsNotFound{} +} + +/*PutSubscriptionsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutSubscriptionsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubscriptionsNotFound) Error() string { + return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsNotFound %+v", 404, o.Payload) +} + +func (o *PutSubscriptionsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubscriptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutSubscriptionsInternalServerError creates a PutSubscriptionsInternalServerError with default headers values +func NewPutSubscriptionsInternalServerError() *PutSubscriptionsInternalServerError { + return &PutSubscriptionsInternalServerError{} +} + +/*PutSubscriptionsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutSubscriptionsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutSubscriptionsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutSubscriptionsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutSubscriptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/subscriptions/subscriptions_client.go b/api/sf-gate/sf_gate_client/subscriptions/subscriptions_client.go new file mode 100644 index 0000000..8a2cf32 --- /dev/null +++ b/api/sf-gate/sf_gate_client/subscriptions/subscriptions_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package subscriptions + +// 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 subscriptions API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for subscriptions API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetSubscriptions(params *GetSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionsOK, error) + + PostSubscriptions(params *PostSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubscriptionsOK, error) + + PutSubscriptions(params *PutSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubscriptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetSubscriptions gets a list of subscriptions + + Return a list of available Subscriptions +*/ +func (a *Client) GetSubscriptions(params *GetSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetSubscriptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubscriptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSubscriptions", + Method: "GET", + PathPattern: "/subscriptions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetSubscriptionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSubscriptionsOK) + 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 getSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostSubscriptions adds new subscriptions + + Create new Sumissions +*/ +func (a *Client) PostSubscriptions(params *PostSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PostSubscriptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostSubscriptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postSubscriptions", + Method: "POST", + PathPattern: "/subscriptions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostSubscriptionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostSubscriptionsOK) + 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 postSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutSubscriptions updates a subscription + + Update all the fields in a Subscription record identified by Taxnexus Id +*/ +func (a *Client) PutSubscriptions(params *PutSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter) (*PutSubscriptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutSubscriptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putSubscriptions", + Method: "PUT", + PathPattern: "/subscriptions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutSubscriptionsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutSubscriptionsOK) + 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 putSubscriptions: 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/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_parameters.go b/api/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_parameters.go new file mode 100644 index 0000000..fa8c880 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_parameters.go @@ -0,0 +1,407 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" +) + +// NewGetTaxTypeAccountsParams creates a new GetTaxTypeAccountsParams object +// with the default values initialized. +func NewGetTaxTypeAccountsParams() *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxTypeAccountsParamsWithTimeout creates a new GetTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxTypeAccountsParamsWithTimeout(timeout time.Duration) *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + + timeout: timeout, + } +} + +// NewGetTaxTypeAccountsParamsWithContext creates a new GetTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxTypeAccountsParamsWithContext(ctx context.Context) *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + + Context: ctx, + } +} + +// NewGetTaxTypeAccountsParamsWithHTTPClient creates a new GetTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxTypeAccountsParamsWithHTTPClient(client *http.Client) *GetTaxTypeAccountsParams { + var () + return &GetTaxTypeAccountsParams{ + HTTPClient: client, + } +} + +/*GetTaxTypeAccountsParams contains all the parameters to send to the API endpoint +for the get tax type accounts operation typically these are written to a http.Request +*/ +type GetTaxTypeAccountsParams struct { + + /*AccountID + Taxnexus Id of the Account to be used a record retrieval + + */ + AccountID *string + /*Active + Retrieve only active records? + + */ + Active *bool + /*Country + The Country abbreviation (2 char) + + */ + Country *string + /*County + The County Name + + */ + County *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*Place + The City name (must be accompanied by State) + + */ + Place *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + /*TaxtypeaccountID + Taxnexus Id of the Tax Type Account to be retrieved + + */ + TaxtypeaccountID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithTimeout(timeout time.Duration) *GetTaxTypeAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithContext(ctx context.Context) *GetTaxTypeAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithHTTPClient(client *http.Client) *GetTaxTypeAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccountID adds the accountID to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithAccountID(accountID *string) *GetTaxTypeAccountsParams { + o.SetAccountID(accountID) + return o +} + +// SetAccountID adds the accountId to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetAccountID(accountID *string) { + o.AccountID = accountID +} + +// WithActive adds the active to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithActive(active *bool) *GetTaxTypeAccountsParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetActive(active *bool) { + o.Active = active +} + +// WithCountry adds the country to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithCountry(country *string) *GetTaxTypeAccountsParams { + o.SetCountry(country) + return o +} + +// SetCountry adds the country to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetCountry(country *string) { + o.Country = country +} + +// WithCounty adds the county to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithCounty(county *string) *GetTaxTypeAccountsParams { + o.SetCounty(county) + return o +} + +// SetCounty adds the county to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetCounty(county *string) { + o.County = county +} + +// WithLimit adds the limit to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithLimit(limit *int64) *GetTaxTypeAccountsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithOffset(offset *int64) *GetTaxTypeAccountsParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlace adds the place to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithPlace(place *string) *GetTaxTypeAccountsParams { + o.SetPlace(place) + return o +} + +// SetPlace adds the place to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetPlace(place *string) { + o.Place = place +} + +// WithState adds the state to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithState(state *string) *GetTaxTypeAccountsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetState(state *string) { + o.State = state +} + +// WithTaxtypeaccountID adds the taxtypeaccountID to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) WithTaxtypeaccountID(taxtypeaccountID *string) *GetTaxTypeAccountsParams { + o.SetTaxtypeaccountID(taxtypeaccountID) + return o +} + +// SetTaxtypeaccountID adds the taxtypeaccountId to the get tax type accounts params +func (o *GetTaxTypeAccountsParams) SetTaxtypeaccountID(taxtypeaccountID *string) { + o.TaxtypeaccountID = taxtypeaccountID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxTypeAccountsParams) 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.Country != nil { + + // query param country + var qrCountry string + if o.Country != nil { + qrCountry = *o.Country + } + qCountry := qrCountry + if qCountry != "" { + if err := r.SetQueryParam("country", qCountry); err != nil { + return err + } + } + + } + + if o.County != nil { + + // query param county + var qrCounty string + if o.County != nil { + qrCounty = *o.County + } + qCounty := qrCounty + if qCounty != "" { + if err := r.SetQueryParam("county", qCounty); 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.Place != nil { + + // query param place + var qrPlace string + if o.Place != nil { + qrPlace = *o.Place + } + qPlace := qrPlace + if qPlace != "" { + if err := r.SetQueryParam("place", qPlace); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if o.TaxtypeaccountID != nil { + + // query param taxtypeaccountId + var qrTaxtypeaccountID string + if o.TaxtypeaccountID != nil { + qrTaxtypeaccountID = *o.TaxtypeaccountID + } + qTaxtypeaccountID := qrTaxtypeaccountID + if qTaxtypeaccountID != "" { + if err := r.SetQueryParam("taxtypeaccountId", qTaxtypeaccountID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_responses.go b/api/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_responses.go new file mode 100644 index 0000000..6f29ae2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_type_accounts/get_tax_type_accounts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetTaxTypeAccountsReader is a Reader for the GetTaxTypeAccounts structure. +type GetTaxTypeAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxTypeAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxTypeAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxTypeAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxTypeAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxTypeAccountsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxTypeAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxTypeAccountsOK creates a GetTaxTypeAccountsOK with default headers values +func NewGetTaxTypeAccountsOK() *GetTaxTypeAccountsOK { + return &GetTaxTypeAccountsOK{} +} + +/*GetTaxTypeAccountsOK handles this case with default header values. + +An array of TaxTypeAccount objects +*/ +type GetTaxTypeAccountsOK struct { + Payload *sf_gate_models.TaxTypeAccountResponse +} + +func (o *GetTaxTypeAccountsOK) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsOK %+v", 200, o.Payload) +} + +func (o *GetTaxTypeAccountsOK) GetPayload() *sf_gate_models.TaxTypeAccountResponse { + return o.Payload +} + +func (o *GetTaxTypeAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.TaxTypeAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsUnauthorized creates a GetTaxTypeAccountsUnauthorized with default headers values +func NewGetTaxTypeAccountsUnauthorized() *GetTaxTypeAccountsUnauthorized { + return &GetTaxTypeAccountsUnauthorized{} +} + +/*GetTaxTypeAccountsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxTypeAccountsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypeAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxTypeAccountsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsForbidden creates a GetTaxTypeAccountsForbidden with default headers values +func NewGetTaxTypeAccountsForbidden() *GetTaxTypeAccountsForbidden { + return &GetTaxTypeAccountsForbidden{} +} + +/*GetTaxTypeAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxTypeAccountsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypeAccountsForbidden) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxTypeAccountsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsNotFound creates a GetTaxTypeAccountsNotFound with default headers values +func NewGetTaxTypeAccountsNotFound() *GetTaxTypeAccountsNotFound { + return &GetTaxTypeAccountsNotFound{} +} + +/*GetTaxTypeAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxTypeAccountsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypeAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxTypeAccountsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsUnprocessableEntity creates a GetTaxTypeAccountsUnprocessableEntity with default headers values +func NewGetTaxTypeAccountsUnprocessableEntity() *GetTaxTypeAccountsUnprocessableEntity { + return &GetTaxTypeAccountsUnprocessableEntity{} +} + +/*GetTaxTypeAccountsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxTypeAccountsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypeAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxTypeAccountsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypeAccountsInternalServerError creates a GetTaxTypeAccountsInternalServerError with default headers values +func NewGetTaxTypeAccountsInternalServerError() *GetTaxTypeAccountsInternalServerError { + return &GetTaxTypeAccountsInternalServerError{} +} + +/*GetTaxTypeAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxTypeAccountsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypeAccountsInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxtypeaccounts][%d] getTaxTypeAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxTypeAccountsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypeAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_parameters.go b/api/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_parameters.go new file mode 100644 index 0000000..0ad834e --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPostTaxTypeAccountsParams creates a new PostTaxTypeAccountsParams object +// with the default values initialized. +func NewPostTaxTypeAccountsParams() *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostTaxTypeAccountsParamsWithTimeout creates a new PostTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostTaxTypeAccountsParamsWithTimeout(timeout time.Duration) *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + + timeout: timeout, + } +} + +// NewPostTaxTypeAccountsParamsWithContext creates a new PostTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostTaxTypeAccountsParamsWithContext(ctx context.Context) *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + + Context: ctx, + } +} + +// NewPostTaxTypeAccountsParamsWithHTTPClient creates a new PostTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostTaxTypeAccountsParamsWithHTTPClient(client *http.Client) *PostTaxTypeAccountsParams { + var () + return &PostTaxTypeAccountsParams{ + HTTPClient: client, + } +} + +/*PostTaxTypeAccountsParams contains all the parameters to send to the API endpoint +for the post tax type accounts operation typically these are written to a http.Request +*/ +type PostTaxTypeAccountsParams struct { + + /*Taxtypeaccount + The new Tax Type Account + + */ + Taxtypeaccount *sf_gate_models.TaxTypeAccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithTimeout(timeout time.Duration) *PostTaxTypeAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithContext(ctx context.Context) *PostTaxTypeAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithHTTPClient(client *http.Client) *PostTaxTypeAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaxtypeaccount adds the taxtypeaccount to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) WithTaxtypeaccount(taxtypeaccount *sf_gate_models.TaxTypeAccountRequest) *PostTaxTypeAccountsParams { + o.SetTaxtypeaccount(taxtypeaccount) + return o +} + +// SetTaxtypeaccount adds the taxtypeaccount to the post tax type accounts params +func (o *PostTaxTypeAccountsParams) SetTaxtypeaccount(taxtypeaccount *sf_gate_models.TaxTypeAccountRequest) { + o.Taxtypeaccount = taxtypeaccount +} + +// WriteToRequest writes these params to a swagger request +func (o *PostTaxTypeAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Taxtypeaccount != nil { + if err := r.SetBodyParam(o.Taxtypeaccount); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_responses.go b/api/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_responses.go new file mode 100644 index 0000000..8ab9561 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_type_accounts/post_tax_type_accounts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PostTaxTypeAccountsReader is a Reader for the PostTaxTypeAccounts structure. +type PostTaxTypeAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostTaxTypeAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostTaxTypeAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostTaxTypeAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostTaxTypeAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostTaxTypeAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostTaxTypeAccountsOK creates a PostTaxTypeAccountsOK with default headers values +func NewPostTaxTypeAccountsOK() *PostTaxTypeAccountsOK { + return &PostTaxTypeAccountsOK{} +} + +/*PostTaxTypeAccountsOK handles this case with default header values. + +An array of TaxTypeAccount objects +*/ +type PostTaxTypeAccountsOK struct { + Payload *sf_gate_models.TaxTypeAccountResponse +} + +func (o *PostTaxTypeAccountsOK) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsOK %+v", 200, o.Payload) +} + +func (o *PostTaxTypeAccountsOK) GetPayload() *sf_gate_models.TaxTypeAccountResponse { + return o.Payload +} + +func (o *PostTaxTypeAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.TaxTypeAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsUnauthorized creates a PostTaxTypeAccountsUnauthorized with default headers values +func NewPostTaxTypeAccountsUnauthorized() *PostTaxTypeAccountsUnauthorized { + return &PostTaxTypeAccountsUnauthorized{} +} + +/*PostTaxTypeAccountsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostTaxTypeAccountsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PostTaxTypeAccountsUnauthorized) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *PostTaxTypeAccountsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsForbidden creates a PostTaxTypeAccountsForbidden with default headers values +func NewPostTaxTypeAccountsForbidden() *PostTaxTypeAccountsForbidden { + return &PostTaxTypeAccountsForbidden{} +} + +/*PostTaxTypeAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PostTaxTypeAccountsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PostTaxTypeAccountsForbidden) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsForbidden %+v", 403, o.Payload) +} + +func (o *PostTaxTypeAccountsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsNotFound creates a PostTaxTypeAccountsNotFound with default headers values +func NewPostTaxTypeAccountsNotFound() *PostTaxTypeAccountsNotFound { + return &PostTaxTypeAccountsNotFound{} +} + +/*PostTaxTypeAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type PostTaxTypeAccountsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PostTaxTypeAccountsNotFound) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsNotFound %+v", 404, o.Payload) +} + +func (o *PostTaxTypeAccountsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostTaxTypeAccountsInternalServerError creates a PostTaxTypeAccountsInternalServerError with default headers values +func NewPostTaxTypeAccountsInternalServerError() *PostTaxTypeAccountsInternalServerError { + return &PostTaxTypeAccountsInternalServerError{} +} + +/*PostTaxTypeAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PostTaxTypeAccountsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PostTaxTypeAccountsInternalServerError) Error() string { + return fmt.Sprintf("[POST /taxtypeaccounts][%d] postTaxTypeAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *PostTaxTypeAccountsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PostTaxTypeAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_parameters.go b/api/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_parameters.go new file mode 100644 index 0000000..a534d88 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutTaxTypeAccountsParams creates a new PutTaxTypeAccountsParams object +// with the default values initialized. +func NewPutTaxTypeAccountsParams() *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutTaxTypeAccountsParamsWithTimeout creates a new PutTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutTaxTypeAccountsParamsWithTimeout(timeout time.Duration) *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + + timeout: timeout, + } +} + +// NewPutTaxTypeAccountsParamsWithContext creates a new PutTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutTaxTypeAccountsParamsWithContext(ctx context.Context) *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + + Context: ctx, + } +} + +// NewPutTaxTypeAccountsParamsWithHTTPClient creates a new PutTaxTypeAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutTaxTypeAccountsParamsWithHTTPClient(client *http.Client) *PutTaxTypeAccountsParams { + var () + return &PutTaxTypeAccountsParams{ + HTTPClient: client, + } +} + +/*PutTaxTypeAccountsParams contains all the parameters to send to the API endpoint +for the put tax type accounts operation typically these are written to a http.Request +*/ +type PutTaxTypeAccountsParams struct { + + /*Taxtypeaccount*/ + Taxtypeaccount *sf_gate_models.TaxTypeAccountRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithTimeout(timeout time.Duration) *PutTaxTypeAccountsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithContext(ctx context.Context) *PutTaxTypeAccountsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithHTTPClient(client *http.Client) *PutTaxTypeAccountsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaxtypeaccount adds the taxtypeaccount to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) WithTaxtypeaccount(taxtypeaccount *sf_gate_models.TaxTypeAccountRequest) *PutTaxTypeAccountsParams { + o.SetTaxtypeaccount(taxtypeaccount) + return o +} + +// SetTaxtypeaccount adds the taxtypeaccount to the put tax type accounts params +func (o *PutTaxTypeAccountsParams) SetTaxtypeaccount(taxtypeaccount *sf_gate_models.TaxTypeAccountRequest) { + o.Taxtypeaccount = taxtypeaccount +} + +// WriteToRequest writes these params to a swagger request +func (o *PutTaxTypeAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Taxtypeaccount != nil { + if err := r.SetBodyParam(o.Taxtypeaccount); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_responses.go b/api/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_responses.go new file mode 100644 index 0000000..67b4b39 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_type_accounts/put_tax_type_accounts_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// PutTaxTypeAccountsReader is a Reader for the PutTaxTypeAccounts structure. +type PutTaxTypeAccountsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutTaxTypeAccountsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPutTaxTypeAccountsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutTaxTypeAccountsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutTaxTypeAccountsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutTaxTypeAccountsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPutTaxTypeAccountsOK creates a PutTaxTypeAccountsOK with default headers values +func NewPutTaxTypeAccountsOK() *PutTaxTypeAccountsOK { + return &PutTaxTypeAccountsOK{} +} + +/*PutTaxTypeAccountsOK handles this case with default header values. + +An array of TaxTypeAccount objects +*/ +type PutTaxTypeAccountsOK struct { + Payload *sf_gate_models.TaxTypeAccountResponse +} + +func (o *PutTaxTypeAccountsOK) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsOK %+v", 200, o.Payload) +} + +func (o *PutTaxTypeAccountsOK) GetPayload() *sf_gate_models.TaxTypeAccountResponse { + return o.Payload +} + +func (o *PutTaxTypeAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.TaxTypeAccountResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsUnauthorized creates a PutTaxTypeAccountsUnauthorized with default headers values +func NewPutTaxTypeAccountsUnauthorized() *PutTaxTypeAccountsUnauthorized { + return &PutTaxTypeAccountsUnauthorized{} +} + +/*PutTaxTypeAccountsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutTaxTypeAccountsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutTaxTypeAccountsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutTaxTypeAccountsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsForbidden creates a PutTaxTypeAccountsForbidden with default headers values +func NewPutTaxTypeAccountsForbidden() *PutTaxTypeAccountsForbidden { + return &PutTaxTypeAccountsForbidden{} +} + +/*PutTaxTypeAccountsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutTaxTypeAccountsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutTaxTypeAccountsForbidden) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsForbidden %+v", 403, o.Payload) +} + +func (o *PutTaxTypeAccountsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsNotFound creates a PutTaxTypeAccountsNotFound with default headers values +func NewPutTaxTypeAccountsNotFound() *PutTaxTypeAccountsNotFound { + return &PutTaxTypeAccountsNotFound{} +} + +/*PutTaxTypeAccountsNotFound handles this case with default header values. + +Resource was not found +*/ +type PutTaxTypeAccountsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutTaxTypeAccountsNotFound) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsNotFound %+v", 404, o.Payload) +} + +func (o *PutTaxTypeAccountsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutTaxTypeAccountsInternalServerError creates a PutTaxTypeAccountsInternalServerError with default headers values +func NewPutTaxTypeAccountsInternalServerError() *PutTaxTypeAccountsInternalServerError { + return &PutTaxTypeAccountsInternalServerError{} +} + +/*PutTaxTypeAccountsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type PutTaxTypeAccountsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutTaxTypeAccountsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /taxtypeaccounts][%d] putTaxTypeAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutTaxTypeAccountsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTaxTypeAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/tax_type_accounts/tax_type_accounts_client.go b/api/sf-gate/sf_gate_client/tax_type_accounts/tax_type_accounts_client.go new file mode 100644 index 0000000..3a5c113 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_type_accounts/tax_type_accounts_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_type_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 tax type accounts API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax type accounts API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTaxTypeAccounts(params *GetTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypeAccountsOK, error) + + PostTaxTypeAccounts(params *PostTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxTypeAccountsOK, error) + + PutTaxTypeAccounts(params *PutTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTaxTypeAccountsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTaxTypeAccounts gets a list of tax type accounts + + Return a list of Tax Type Accounts +*/ +func (a *Client) GetTaxTypeAccounts(params *GetTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypeAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxTypeAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxTypeAccounts", + Method: "GET", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxTypeAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxTypeAccountsOK) + 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 getTaxTypeAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PostTaxTypeAccounts creates new tax type accounts + + Create a new Tax Type Account +*/ +func (a *Client) PostTaxTypeAccounts(params *PostTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PostTaxTypeAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostTaxTypeAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "postTaxTypeAccounts", + Method: "POST", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostTaxTypeAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostTaxTypeAccountsOK) + 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 postTaxTypeAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PutTaxTypeAccounts updates tax type accounts + + Update a TaxTypeAccount +*/ +func (a *Client) PutTaxTypeAccounts(params *PutTaxTypeAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTaxTypeAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutTaxTypeAccountsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "putTaxTypeAccounts", + Method: "PUT", + PathPattern: "/taxtypeaccounts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutTaxTypeAccountsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutTaxTypeAccountsOK) + 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 putTaxTypeAccounts: 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/sf-gate/sf_gate_client/tax_types/get_tax_types_parameters.go b/api/sf-gate/sf_gate_client/tax_types/get_tax_types_parameters.go new file mode 100644 index 0000000..c53d88b --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_types/get_tax_types_parameters.go @@ -0,0 +1,407 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_types + +// 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" +) + +// NewGetTaxTypesParams creates a new GetTaxTypesParams object +// with the default values initialized. +func NewGetTaxTypesParams() *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxTypesParamsWithTimeout creates a new GetTaxTypesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxTypesParamsWithTimeout(timeout time.Duration) *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + + timeout: timeout, + } +} + +// NewGetTaxTypesParamsWithContext creates a new GetTaxTypesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxTypesParamsWithContext(ctx context.Context) *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + + Context: ctx, + } +} + +// NewGetTaxTypesParamsWithHTTPClient creates a new GetTaxTypesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxTypesParamsWithHTTPClient(client *http.Client) *GetTaxTypesParams { + var () + return &GetTaxTypesParams{ + HTTPClient: client, + } +} + +/*GetTaxTypesParams contains all the parameters to send to the API endpoint +for the get tax types operation typically these are written to a http.Request +*/ +type GetTaxTypesParams struct { + + /*Active + Retrieve only active records? + + */ + Active *bool + /*Address + Postal Address URL encoded; partial addresses allowed + + */ + Address *string + /*Country + The Country abbreviation (2 char) + + */ + Country *string + /*County + The County Name + + */ + County *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*Place + The City name (must be accompanied by State) + + */ + Place *string + /*State + The State or Province abbreviation (2 char) + + */ + State *string + /*TaxtypeID + Taxnexus Id of the Tax Type to be retrieved + + */ + TaxtypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get tax types params +func (o *GetTaxTypesParams) WithTimeout(timeout time.Duration) *GetTaxTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get tax types params +func (o *GetTaxTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get tax types params +func (o *GetTaxTypesParams) WithContext(ctx context.Context) *GetTaxTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get tax types params +func (o *GetTaxTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get tax types params +func (o *GetTaxTypesParams) WithHTTPClient(client *http.Client) *GetTaxTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get tax types params +func (o *GetTaxTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get tax types params +func (o *GetTaxTypesParams) WithActive(active *bool) *GetTaxTypesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get tax types params +func (o *GetTaxTypesParams) SetActive(active *bool) { + o.Active = active +} + +// WithAddress adds the address to the get tax types params +func (o *GetTaxTypesParams) WithAddress(address *string) *GetTaxTypesParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the get tax types params +func (o *GetTaxTypesParams) SetAddress(address *string) { + o.Address = address +} + +// WithCountry adds the country to the get tax types params +func (o *GetTaxTypesParams) WithCountry(country *string) *GetTaxTypesParams { + o.SetCountry(country) + return o +} + +// SetCountry adds the country to the get tax types params +func (o *GetTaxTypesParams) SetCountry(country *string) { + o.Country = country +} + +// WithCounty adds the county to the get tax types params +func (o *GetTaxTypesParams) WithCounty(county *string) *GetTaxTypesParams { + o.SetCounty(county) + return o +} + +// SetCounty adds the county to the get tax types params +func (o *GetTaxTypesParams) SetCounty(county *string) { + o.County = county +} + +// WithLimit adds the limit to the get tax types params +func (o *GetTaxTypesParams) WithLimit(limit *int64) *GetTaxTypesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get tax types params +func (o *GetTaxTypesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get tax types params +func (o *GetTaxTypesParams) WithOffset(offset *int64) *GetTaxTypesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get tax types params +func (o *GetTaxTypesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlace adds the place to the get tax types params +func (o *GetTaxTypesParams) WithPlace(place *string) *GetTaxTypesParams { + o.SetPlace(place) + return o +} + +// SetPlace adds the place to the get tax types params +func (o *GetTaxTypesParams) SetPlace(place *string) { + o.Place = place +} + +// WithState adds the state to the get tax types params +func (o *GetTaxTypesParams) WithState(state *string) *GetTaxTypesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get tax types params +func (o *GetTaxTypesParams) SetState(state *string) { + o.State = state +} + +// WithTaxtypeID adds the taxtypeID to the get tax types params +func (o *GetTaxTypesParams) WithTaxtypeID(taxtypeID *string) *GetTaxTypesParams { + o.SetTaxtypeID(taxtypeID) + return o +} + +// SetTaxtypeID adds the taxtypeId to the get tax types params +func (o *GetTaxTypesParams) SetTaxtypeID(taxtypeID *string) { + o.TaxtypeID = taxtypeID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxTypesParams) 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.Address != nil { + + // query param address + var qrAddress string + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + + } + + if o.Country != nil { + + // query param country + var qrCountry string + if o.Country != nil { + qrCountry = *o.Country + } + qCountry := qrCountry + if qCountry != "" { + if err := r.SetQueryParam("country", qCountry); err != nil { + return err + } + } + + } + + if o.County != nil { + + // query param county + var qrCounty string + if o.County != nil { + qrCounty = *o.County + } + qCounty := qrCounty + if qCounty != "" { + if err := r.SetQueryParam("county", qCounty); 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.Place != nil { + + // query param place + var qrPlace string + if o.Place != nil { + qrPlace = *o.Place + } + qPlace := qrPlace + if qPlace != "" { + if err := r.SetQueryParam("place", qPlace); err != nil { + return err + } + } + + } + + if o.State != nil { + + // query param state + var qrState string + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + } + + if o.TaxtypeID != nil { + + // query param taxtypeId + var qrTaxtypeID string + if o.TaxtypeID != nil { + qrTaxtypeID = *o.TaxtypeID + } + qTaxtypeID := qrTaxtypeID + if qTaxtypeID != "" { + if err := r.SetQueryParam("taxtypeId", qTaxtypeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/tax_types/get_tax_types_responses.go b/api/sf-gate/sf_gate_client/tax_types/get_tax_types_responses.go new file mode 100644 index 0000000..75bb399 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_types/get_tax_types_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_types + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetTaxTypesReader is a Reader for the GetTaxTypes structure. +type GetTaxTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxTypesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxTypesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxTypesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxTypesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxTypesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxTypesOK creates a GetTaxTypesOK with default headers values +func NewGetTaxTypesOK() *GetTaxTypesOK { + return &GetTaxTypesOK{} +} + +/*GetTaxTypesOK handles this case with default header values. + +Taxnexus Response with an array of Tax Type objects +*/ +type GetTaxTypesOK struct { + Payload *sf_gate_models.TaxTypeResponse +} + +func (o *GetTaxTypesOK) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesOK %+v", 200, o.Payload) +} + +func (o *GetTaxTypesOK) GetPayload() *sf_gate_models.TaxTypeResponse { + return o.Payload +} + +func (o *GetTaxTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.TaxTypeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesUnauthorized creates a GetTaxTypesUnauthorized with default headers values +func NewGetTaxTypesUnauthorized() *GetTaxTypesUnauthorized { + return &GetTaxTypesUnauthorized{} +} + +/*GetTaxTypesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxTypesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypesUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxTypesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesForbidden creates a GetTaxTypesForbidden with default headers values +func NewGetTaxTypesForbidden() *GetTaxTypesForbidden { + return &GetTaxTypesForbidden{} +} + +/*GetTaxTypesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxTypesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypesForbidden) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxTypesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesNotFound creates a GetTaxTypesNotFound with default headers values +func NewGetTaxTypesNotFound() *GetTaxTypesNotFound { + return &GetTaxTypesNotFound{} +} + +/*GetTaxTypesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxTypesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypesNotFound) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxTypesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesUnprocessableEntity creates a GetTaxTypesUnprocessableEntity with default headers values +func NewGetTaxTypesUnprocessableEntity() *GetTaxTypesUnprocessableEntity { + return &GetTaxTypesUnprocessableEntity{} +} + +/*GetTaxTypesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxTypesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxTypesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxTypesInternalServerError creates a GetTaxTypesInternalServerError with default headers values +func NewGetTaxTypesInternalServerError() *GetTaxTypesInternalServerError { + return &GetTaxTypesInternalServerError{} +} + +/*GetTaxTypesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxTypesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxTypesInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxTypesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxTypesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/tax_types/tax_types_client.go b/api/sf-gate/sf_gate_client/tax_types/tax_types_client.go new file mode 100644 index 0000000..339eb88 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tax_types/tax_types_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tax_types + +// 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 tax types API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tax types API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTaxTypes(params *GetTaxTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTaxTypes gets a list of tax types + + Return a complete list of all the tax types handled by Taxnexus; use the lat long parameters to retrieve a Situs lookup +*/ +func (a *Client) GetTaxTypes(params *GetTaxTypesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxTypesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxTypes", + Method: "GET", + PathPattern: "/taxtypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxTypesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxTypesOK) + 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 getTaxTypes: 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/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_parameters.go b/api/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_parameters.go new file mode 100644 index 0000000..030ad02 --- /dev/null +++ b/api/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_codes + +// 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" +) + +// NewGetTaxnexusCodesParams creates a new GetTaxnexusCodesParams object +// with the default values initialized. +func NewGetTaxnexusCodesParams() *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaxnexusCodesParamsWithTimeout creates a new GetTaxnexusCodesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTaxnexusCodesParamsWithTimeout(timeout time.Duration) *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + + timeout: timeout, + } +} + +// NewGetTaxnexusCodesParamsWithContext creates a new GetTaxnexusCodesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTaxnexusCodesParamsWithContext(ctx context.Context) *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + + Context: ctx, + } +} + +// NewGetTaxnexusCodesParamsWithHTTPClient creates a new GetTaxnexusCodesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTaxnexusCodesParamsWithHTTPClient(client *http.Client) *GetTaxnexusCodesParams { + var () + return &GetTaxnexusCodesParams{ + HTTPClient: client, + } +} + +/*GetTaxnexusCodesParams contains all the parameters to send to the API endpoint +for the get taxnexus codes operation typically these are written to a http.Request +*/ +type GetTaxnexusCodesParams struct { + + /*Active + Retrieve only active records? + + */ + Active *bool + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TaxnexuscodeID + Taxnexus Id of the Taxnexus Code to be retrieved + + */ + TaxnexuscodeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithTimeout(timeout time.Duration) *GetTaxnexusCodesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithContext(ctx context.Context) *GetTaxnexusCodesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithHTTPClient(client *http.Client) *GetTaxnexusCodesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithActive(active *bool) *GetTaxnexusCodesParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetActive(active *bool) { + o.Active = active +} + +// WithLimit adds the limit to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithLimit(limit *int64) *GetTaxnexusCodesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithOffset(offset *int64) *GetTaxnexusCodesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithTaxnexuscodeID adds the taxnexuscodeID to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) WithTaxnexuscodeID(taxnexuscodeID *string) *GetTaxnexusCodesParams { + o.SetTaxnexuscodeID(taxnexuscodeID) + return o +} + +// SetTaxnexuscodeID adds the taxnexuscodeId to the get taxnexus codes params +func (o *GetTaxnexusCodesParams) SetTaxnexuscodeID(taxnexuscodeID *string) { + o.TaxnexuscodeID = taxnexuscodeID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaxnexusCodesParams) 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.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.TaxnexuscodeID != nil { + + // query param taxnexuscodeId + var qrTaxnexuscodeID string + if o.TaxnexuscodeID != nil { + qrTaxnexuscodeID = *o.TaxnexuscodeID + } + qTaxnexuscodeID := qrTaxnexuscodeID + if qTaxnexuscodeID != "" { + if err := r.SetQueryParam("taxnexuscodeId", qTaxnexuscodeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_responses.go b/api/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_responses.go new file mode 100644 index 0000000..28fcf45 --- /dev/null +++ b/api/sf-gate/sf_gate_client/taxnexus_codes/get_taxnexus_codes_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_codes + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// GetTaxnexusCodesReader is a Reader for the GetTaxnexusCodes structure. +type GetTaxnexusCodesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaxnexusCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaxnexusCodesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetTaxnexusCodesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetTaxnexusCodesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetTaxnexusCodesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetTaxnexusCodesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetTaxnexusCodesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetTaxnexusCodesOK creates a GetTaxnexusCodesOK with default headers values +func NewGetTaxnexusCodesOK() *GetTaxnexusCodesOK { + return &GetTaxnexusCodesOK{} +} + +/*GetTaxnexusCodesOK handles this case with default header values. + +Taxnexus Response with an array of Taxnexus Code objects +*/ +type GetTaxnexusCodesOK struct { + Payload *sf_gate_models.TaxnexusCodeResponse +} + +func (o *GetTaxnexusCodesOK) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesOK %+v", 200, o.Payload) +} + +func (o *GetTaxnexusCodesOK) GetPayload() *sf_gate_models.TaxnexusCodeResponse { + return o.Payload +} + +func (o *GetTaxnexusCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.TaxnexusCodeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesUnauthorized creates a GetTaxnexusCodesUnauthorized with default headers values +func NewGetTaxnexusCodesUnauthorized() *GetTaxnexusCodesUnauthorized { + return &GetTaxnexusCodesUnauthorized{} +} + +/*GetTaxnexusCodesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTaxnexusCodesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxnexusCodesUnauthorized) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTaxnexusCodesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesForbidden creates a GetTaxnexusCodesForbidden with default headers values +func NewGetTaxnexusCodesForbidden() *GetTaxnexusCodesForbidden { + return &GetTaxnexusCodesForbidden{} +} + +/*GetTaxnexusCodesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTaxnexusCodesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxnexusCodesForbidden) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesForbidden %+v", 403, o.Payload) +} + +func (o *GetTaxnexusCodesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesNotFound creates a GetTaxnexusCodesNotFound with default headers values +func NewGetTaxnexusCodesNotFound() *GetTaxnexusCodesNotFound { + return &GetTaxnexusCodesNotFound{} +} + +/*GetTaxnexusCodesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetTaxnexusCodesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxnexusCodesNotFound) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesNotFound %+v", 404, o.Payload) +} + +func (o *GetTaxnexusCodesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesUnprocessableEntity creates a GetTaxnexusCodesUnprocessableEntity with default headers values +func NewGetTaxnexusCodesUnprocessableEntity() *GetTaxnexusCodesUnprocessableEntity { + return &GetTaxnexusCodesUnprocessableEntity{} +} + +/*GetTaxnexusCodesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTaxnexusCodesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxnexusCodesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTaxnexusCodesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTaxnexusCodesInternalServerError creates a GetTaxnexusCodesInternalServerError with default headers values +func NewGetTaxnexusCodesInternalServerError() *GetTaxnexusCodesInternalServerError { + return &GetTaxnexusCodesInternalServerError{} +} + +/*GetTaxnexusCodesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetTaxnexusCodesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetTaxnexusCodesInternalServerError) Error() string { + return fmt.Sprintf("[GET /taxnexuscodes][%d] getTaxnexusCodesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTaxnexusCodesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTaxnexusCodesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/taxnexus_codes/taxnexus_codes_client.go b/api/sf-gate/sf_gate_client/taxnexus_codes/taxnexus_codes_client.go new file mode 100644 index 0000000..00c0fd0 --- /dev/null +++ b/api/sf-gate/sf_gate_client/taxnexus_codes/taxnexus_codes_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package taxnexus_codes + +// 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 taxnexus codes API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for taxnexus codes API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTaxnexusCodes(params *GetTaxnexusCodesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxnexusCodesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTaxnexusCodes gets a list of taxnexus codes + + Return a list of TaxnexusCodes +*/ +func (a *Client) GetTaxnexusCodes(params *GetTaxnexusCodesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTaxnexusCodesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTaxnexusCodesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getTaxnexusCodes", + Method: "GET", + PathPattern: "/taxnexuscodes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetTaxnexusCodesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetTaxnexusCodesOK) + 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 getTaxnexusCodes: 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/sf-gate/sf_gate_client/templates/get_templates_parameters.go b/api/sf-gate/sf_gate_client/templates/get_templates_parameters.go new file mode 100644 index 0000000..6891f7c --- /dev/null +++ b/api/sf-gate/sf_gate_client/templates/get_templates_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package templates + +// 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 values initialized. +func NewGetTemplatesParams() *GetTemplatesParams { + var () + return &GetTemplatesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTemplatesParamsWithTimeout creates a new GetTemplatesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTemplatesParamsWithTimeout(timeout time.Duration) *GetTemplatesParams { + var () + return &GetTemplatesParams{ + + timeout: timeout, + } +} + +// NewGetTemplatesParamsWithContext creates a new GetTemplatesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTemplatesParamsWithContext(ctx context.Context) *GetTemplatesParams { + var () + return &GetTemplatesParams{ + + Context: ctx, + } +} + +// NewGetTemplatesParamsWithHTTPClient creates a new GetTemplatesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTemplatesParamsWithHTTPClient(client *http.Client) *GetTemplatesParams { + var () + 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 { + + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TemplateID + Taxnexus Record Id of a Template + + */ + TemplateID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// 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 +} + +// 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.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.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/sf-gate/sf_gate_client/templates/get_templates_responses.go b/api/sf-gate/sf_gate_client/templates/get_templates_responses.go new file mode 100644 index 0000000..2d95821 --- /dev/null +++ b/api/sf-gate/sf_gate_client/templates/get_templates_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package templates + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetTemplatesOK creates a GetTemplatesOK with default headers values +func NewGetTemplatesOK() *GetTemplatesOK { + return &GetTemplatesOK{} +} + +/*GetTemplatesOK handles this case with default header values. + +Taxnexus Response with Template objects +*/ +type GetTemplatesOK struct { + Payload *sf_gate_models.TemplateResponse +} + +func (o *GetTemplatesOK) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesOK %+v", 200, o.Payload) +} + +func (o *GetTemplatesOK) GetPayload() *sf_gate_models.TemplateResponse { + return o.Payload +} + +func (o *GetTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTemplatesUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetTemplatesUnauthorized) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTemplatesUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTemplatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTemplatesForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetTemplatesForbidden) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesForbidden %+v", 403, o.Payload) +} + +func (o *GetTemplatesForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTemplatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetTemplatesNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetTemplatesNotFound) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesNotFound %+v", 404, o.Payload) +} + +func (o *GetTemplatesNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTemplatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTemplatesUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetTemplatesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTemplatesUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTemplatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetTemplatesInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetTemplatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /templates][%d] getTemplatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTemplatesInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTemplatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/templates/templates_client.go b/api/sf-gate/sf_gate_client/templates/templates_client.go new file mode 100644 index 0000000..e028d19 --- /dev/null +++ b/api/sf-gate/sf_gate_client/templates/templates_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package templates + +// 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 templates API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for templates API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetTemplates(params *GetTemplatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplatesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetTemplates gets p d f rendering templates + + Returns the PDF rendering template, or a link to where to get the template +*/ +func (a *Client) GetTemplates(params *GetTemplatesParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTemplatesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/sf-gate/sf_gate_client/tenants/get_tenants_parameters.go b/api/sf-gate/sf_gate_client/tenants/get_tenants_parameters.go new file mode 100644 index 0000000..64f4634 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tenants/get_tenants_parameters.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenants + +// 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 values initialized. +func NewGetTenantsParams() *GetTenantsParams { + var () + return &GetTenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetTenantsParamsWithTimeout creates a new GetTenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetTenantsParamsWithTimeout(timeout time.Duration) *GetTenantsParams { + var () + return &GetTenantsParams{ + + timeout: timeout, + } +} + +// NewGetTenantsParamsWithContext creates a new GetTenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetTenantsParamsWithContext(ctx context.Context) *GetTenantsParams { + var () + return &GetTenantsParams{ + + Context: ctx, + } +} + +// NewGetTenantsParamsWithHTTPClient creates a new GetTenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetTenantsParamsWithHTTPClient(client *http.Client) *GetTenantsParams { + var () + 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 { + + /*CompanyID + Taxnexus Id of the Company to be retrieved + + */ + CompanyID *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*TenantID + Taxnexus Record Id of a Tenant + + */ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// 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.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/sf-gate/sf_gate_client/tenants/get_tenants_responses.go b/api/sf-gate/sf_gate_client/tenants/get_tenants_responses.go new file mode 100644 index 0000000..f89d3da --- /dev/null +++ b/api/sf-gate/sf_gate_client/tenants/get_tenants_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenants + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetTenantsOK creates a GetTenantsOK with default headers values +func NewGetTenantsOK() *GetTenantsOK { + return &GetTenantsOK{} +} + +/*GetTenantsOK handles this case with default header values. + +Taxnexus Response with Tenant objects +*/ +type GetTenantsOK struct { + Payload *sf_gate_models.TenantResponse +} + +func (o *GetTenantsOK) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsOK %+v", 200, o.Payload) +} + +func (o *GetTenantsOK) GetPayload() *sf_gate_models.TenantResponse { + return o.Payload +} + +func (o *GetTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetTenantsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetTenantsUnauthorized) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetTenantsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTenantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetTenantsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetTenantsForbidden) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsForbidden %+v", 403, o.Payload) +} + +func (o *GetTenantsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTenantsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetTenantsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetTenantsNotFound) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsNotFound %+v", 404, o.Payload) +} + +func (o *GetTenantsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTenantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetTenantsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetTenantsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetTenantsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTenantsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetTenantsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetTenantsInternalServerError) Error() string { + return fmt.Sprintf("[GET /tenants][%d] getTenantsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTenantsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetTenantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/tenants/put_tenants_parameters.go b/api/sf-gate/sf_gate_client/tenants/put_tenants_parameters.go new file mode 100644 index 0000000..bc4e1a7 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tenants/put_tenants_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenants + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewPutTenantsParams creates a new PutTenantsParams object +// with the default values initialized. +func NewPutTenantsParams() *PutTenantsParams { + var () + return &PutTenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutTenantsParamsWithTimeout creates a new PutTenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutTenantsParamsWithTimeout(timeout time.Duration) *PutTenantsParams { + var () + return &PutTenantsParams{ + + timeout: timeout, + } +} + +// NewPutTenantsParamsWithContext creates a new PutTenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutTenantsParamsWithContext(ctx context.Context) *PutTenantsParams { + var () + return &PutTenantsParams{ + + Context: ctx, + } +} + +// NewPutTenantsParamsWithHTTPClient creates a new PutTenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutTenantsParamsWithHTTPClient(client *http.Client) *PutTenantsParams { + var () + 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 { + + /*CTenantRequest + An array of Tenant records + + */ + CTenantRequest *sf_gate_models.TenantRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithCTenantRequest adds the cTenantRequest to the put tenants params +func (o *PutTenantsParams) WithCTenantRequest(cTenantRequest *sf_gate_models.TenantRequest) *PutTenantsParams { + o.SetCTenantRequest(cTenantRequest) + return o +} + +// SetCTenantRequest adds the cTenantRequest to the put tenants params +func (o *PutTenantsParams) SetCTenantRequest(cTenantRequest *sf_gate_models.TenantRequest) { + o.CTenantRequest = cTenantRequest +} + +// 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.CTenantRequest != nil { + if err := r.SetBodyParam(o.CTenantRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/tenants/put_tenants_responses.go b/api/sf-gate/sf_gate_client/tenants/put_tenants_responses.go new file mode 100644 index 0000000..f7db014 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tenants/put_tenants_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenants + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewPutTenantsOK creates a PutTenantsOK with default headers values +func NewPutTenantsOK() *PutTenantsOK { + return &PutTenantsOK{} +} + +/*PutTenantsOK handles this case with default header values. + +Taxnexus Response with Tenant objects +*/ +type PutTenantsOK struct { + Payload *sf_gate_models.TenantResponse +} + +func (o *PutTenantsOK) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsOK %+v", 200, o.Payload) +} + +func (o *PutTenantsOK) GetPayload() *sf_gate_models.TenantResponse { + return o.Payload +} + +func (o *PutTenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PutTenantsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *PutTenantsUnauthorized) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsUnauthorized %+v", 401, o.Payload) +} + +func (o *PutTenantsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTenantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type PutTenantsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *PutTenantsForbidden) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsForbidden %+v", 403, o.Payload) +} + +func (o *PutTenantsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTenantsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type PutTenantsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *PutTenantsNotFound) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsNotFound %+v", 404, o.Payload) +} + +func (o *PutTenantsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTenantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PutTenantsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *PutTenantsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PutTenantsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTenantsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type PutTenantsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *PutTenantsInternalServerError) Error() string { + return fmt.Sprintf("[PUT /tenants][%d] putTenantsInternalServerError %+v", 500, o.Payload) +} + +func (o *PutTenantsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *PutTenantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/tenants/tenants_client.go b/api/sf-gate/sf_gate_client/tenants/tenants_client.go new file mode 100644 index 0000000..e1ffec5 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tenants/tenants_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenants + +// 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 tenants API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tenants API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + Tenants(params *TenantsParams, authInfo runtime.ClientAuthInfoWriter) (*TenantsOK, error) + + GetTenants(params *GetTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*GetTenantsOK, error) + + PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTenantsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + Tenants creates new tenants + + Create Tenants in Taxnexus +*/ +func (a *Client) Tenants(params *TenantsParams, authInfo runtime.ClientAuthInfoWriter) (*TenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenantsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Tenants", + Method: "POST", + PathPattern: "/tenants", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenantsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TenantsOK) + 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 Tenants: 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) (*GetTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTenantsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) +} + +/* + PutTenants updates tenants + + Update Tenant in Taxnexus +*/ +func (a *Client) PutTenants(params *PutTenantsParams, authInfo runtime.ClientAuthInfoWriter) (*PutTenantsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutTenantsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_client/tenants/tenants_parameters.go b/api/sf-gate/sf_gate_client/tenants/tenants_parameters.go new file mode 100644 index 0000000..7715a80 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tenants/tenants_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenants + +// 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// NewTenantsParams creates a new TenantsParams object +// with the default values initialized. +func NewTenantsParams() *TenantsParams { + var () + return &TenantsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenantsParamsWithTimeout creates a new TenantsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenantsParamsWithTimeout(timeout time.Duration) *TenantsParams { + var () + return &TenantsParams{ + + timeout: timeout, + } +} + +// NewTenantsParamsWithContext creates a new TenantsParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenantsParamsWithContext(ctx context.Context) *TenantsParams { + var () + return &TenantsParams{ + + Context: ctx, + } +} + +// NewTenantsParamsWithHTTPClient creates a new TenantsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenantsParamsWithHTTPClient(client *http.Client) *TenantsParams { + var () + return &TenantsParams{ + HTTPClient: client, + } +} + +/*TenantsParams contains all the parameters to send to the API endpoint +for the tenants operation typically these are written to a http.Request +*/ +type TenantsParams struct { + + /*CTenantRequest + An array of Tenant records + + */ + CTenantRequest *sf_gate_models.TenantRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenants params +func (o *TenantsParams) WithTimeout(timeout time.Duration) *TenantsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenants params +func (o *TenantsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenants params +func (o *TenantsParams) WithContext(ctx context.Context) *TenantsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenants params +func (o *TenantsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenants params +func (o *TenantsParams) WithHTTPClient(client *http.Client) *TenantsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenants params +func (o *TenantsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCTenantRequest adds the cTenantRequest to the tenants params +func (o *TenantsParams) WithCTenantRequest(cTenantRequest *sf_gate_models.TenantRequest) *TenantsParams { + o.SetCTenantRequest(cTenantRequest) + return o +} + +// SetCTenantRequest adds the cTenantRequest to the tenants params +func (o *TenantsParams) SetCTenantRequest(cTenantRequest *sf_gate_models.TenantRequest) { + o.CTenantRequest = cTenantRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *TenantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CTenantRequest != nil { + if err := r.SetBodyParam(o.CTenantRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/tenants/tenants_responses.go b/api/sf-gate/sf_gate_client/tenants/tenants_responses.go new file mode 100644 index 0000000..fd86a77 --- /dev/null +++ b/api/sf-gate/sf_gate_client/tenants/tenants_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package tenants + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models" +) + +// TenantsReader is a Reader for the Tenants structure. +type TenantsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenantsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewTenantsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewTenantsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewTenantsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewTenantsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewTenantsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewTenantsOK creates a TenantsOK with default headers values +func NewTenantsOK() *TenantsOK { + return &TenantsOK{} +} + +/*TenantsOK handles this case with default header values. + +Taxnexus Response with Tenant objects +*/ +type TenantsOK struct { + Payload *sf_gate_models.TenantResponse +} + +func (o *TenantsOK) Error() string { + return fmt.Sprintf("[POST /tenants][%d] tenantsOK %+v", 200, o.Payload) +} + +func (o *TenantsOK) GetPayload() *sf_gate_models.TenantResponse { + return o.Payload +} + +func (o *TenantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.TenantResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTenantsUnauthorized creates a TenantsUnauthorized with default headers values +func NewTenantsUnauthorized() *TenantsUnauthorized { + return &TenantsUnauthorized{} +} + +/*TenantsUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type TenantsUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *TenantsUnauthorized) Error() string { + return fmt.Sprintf("[POST /tenants][%d] tenantsUnauthorized %+v", 401, o.Payload) +} + +func (o *TenantsUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *TenantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTenantsForbidden creates a TenantsForbidden with default headers values +func NewTenantsForbidden() *TenantsForbidden { + return &TenantsForbidden{} +} + +/*TenantsForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type TenantsForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *TenantsForbidden) Error() string { + return fmt.Sprintf("[POST /tenants][%d] tenantsForbidden %+v", 403, o.Payload) +} + +func (o *TenantsForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *TenantsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTenantsNotFound creates a TenantsNotFound with default headers values +func NewTenantsNotFound() *TenantsNotFound { + return &TenantsNotFound{} +} + +/*TenantsNotFound handles this case with default header values. + +Resource was not found +*/ +type TenantsNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *TenantsNotFound) Error() string { + return fmt.Sprintf("[POST /tenants][%d] tenantsNotFound %+v", 404, o.Payload) +} + +func (o *TenantsNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *TenantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTenantsUnprocessableEntity creates a TenantsUnprocessableEntity with default headers values +func NewTenantsUnprocessableEntity() *TenantsUnprocessableEntity { + return &TenantsUnprocessableEntity{} +} + +/*TenantsUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type TenantsUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *TenantsUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /tenants][%d] tenantsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *TenantsUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *TenantsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTenantsInternalServerError creates a TenantsInternalServerError with default headers values +func NewTenantsInternalServerError() *TenantsInternalServerError { + return &TenantsInternalServerError{} +} + +/*TenantsInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type TenantsInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *TenantsInternalServerError) Error() string { + return fmt.Sprintf("[POST /tenants][%d] tenantsInternalServerError %+v", 500, o.Payload) +} + +func (o *TenantsInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *TenantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/users/get_users_parameters.go b/api/sf-gate/sf_gate_client/users/get_users_parameters.go new file mode 100644 index 0000000..806bc24 --- /dev/null +++ b/api/sf-gate/sf_gate_client/users/get_users_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package users + +// 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 values initialized. +func NewGetUsersParams() *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetUsersParamsWithTimeout creates a new GetUsersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams { + var () + return &GetUsersParams{ + + timeout: timeout, + } +} + +// NewGetUsersParamsWithContext creates a new GetUsersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams { + var () + return &GetUsersParams{ + + Context: ctx, + } +} + +// NewGetUsersParamsWithHTTPClient creates a new GetUsersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetUsersParamsWithHTTPClient(client *http.Client) *GetUsersParams { + var () + 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 { + + /*Active + Retrieve only active records? + + */ + Active *bool + /*Apikey + Taxnexus Id of the User to be retrieved + + */ + Apikey *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip? (default 0) + + */ + Offset *int64 + /*UserID + Taxnexus Id of the User to be retrieved + + */ + UserID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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 +} + +// 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.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.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 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sf-gate/sf_gate_client/users/get_users_responses.go b/api/sf-gate/sf_gate_client/users/get_users_responses.go new file mode 100644 index 0000000..5185ad2 --- /dev/null +++ b/api/sf-gate/sf_gate_client/users/get_users_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package users + +// 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" + + "github.com/taxnexus/go/lib/api/sf-gate/sf_gate_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("unknown error", response, response.Code()) + } +} + +// NewGetUsersOK creates a GetUsersOK with default headers values +func NewGetUsersOK() *GetUsersOK { + return &GetUsersOK{} +} + +/*GetUsersOK handles this case with default header values. + +Taxnexus Response with User objects +*/ +type GetUsersOK struct { + Payload *sf_gate_models.UserResponse +} + +func (o *GetUsersOK) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload) +} + +func (o *GetUsersOK) GetPayload() *sf_gate_models.UserResponse { + return o.Payload +} + +func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetUsersUnauthorized struct { + Payload *sf_gate_models.Error +} + +func (o *GetUsersUnauthorized) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload) +} + +func (o *GetUsersUnauthorized) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetUsersForbidden struct { + Payload *sf_gate_models.Error +} + +func (o *GetUsersForbidden) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload) +} + +func (o *GetUsersForbidden) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Resource was not found +*/ +type GetUsersNotFound struct { + Payload *sf_gate_models.Error +} + +func (o *GetUsersNotFound) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload) +} + +func (o *GetUsersNotFound) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetUsersUnprocessableEntity struct { + Payload *sf_gate_models.Error +} + +func (o *GetUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetUsersUnprocessableEntity) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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 handles this case with default header values. + +Server Internal Error +*/ +type GetUsersInternalServerError struct { + Payload *sf_gate_models.Error +} + +func (o *GetUsersInternalServerError) Error() string { + return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload) +} + +func (o *GetUsersInternalServerError) GetPayload() *sf_gate_models.Error { + return o.Payload +} + +func (o *GetUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sf_gate_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/sf-gate/sf_gate_client/users/users_client.go b/api/sf-gate/sf_gate_client/users/users_client.go new file mode 100644 index 0000000..9862faa --- /dev/null +++ b/api/sf-gate/sf_gate_client/users/users_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package users + +// 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 users API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for users API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetUsers gets a list users + + Return a list of User records from the datastore +*/ +func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter) (*GetUsersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetUsersParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/sf-gate/sf_gate_models/account.go b/api/sf-gate/sf_gate_models/account.go new file mode 100644 index 0000000..be041de --- /dev/null +++ b/api/sf-gate/sf_gate_models/account.go @@ -0,0 +1,402 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // billingaddress + Billingaddress *Address `json:"billingaddress,omitempty"` + + // Contact ID + Billingcontactid string `json:"billingcontactid,omitempty"` + + // Billing Preference + Billingpreference string `json:"billingpreference,omitempty"` + + // businessaddress + 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"` + + // D-n-B Company + Dandbcompanyid string `json:"dandbcompanyid,omitempty"` + + // This Account's 'Doing Business As' name + Dba string `json:"dba,omitempty"` + + // defaultaddress + 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"` + + // D-U-N-S Number + Dunsnumber string `json:"dunsnumber,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"` + + // Taxnexus Account Id + ID string `json:"id,omitempty"` + + // Industry + Industry string `json:"industry,omitempty"` + + // Customer Portal Account + Iscustomerportal bool `json:"iscustomerportal,omitempty"` + + // Partner Account + Ispartner bool `json:"ispartner,omitempty"` + + // ISP Customer? + Ispcustomer bool `json:"ispcustomer,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"` + + // shippingaddress + Shippingaddress *Address `json:"shippingaddress,omitempty"` + + // Shipping Census Tract + Shippingcensustract string `json:"shippingcensustract,omitempty"` + + // Shipping Contact ID + Shippingcontactid string `json:"shippingcontactid,omitempty"` + + // Shipping County + Shippingcounty string `json:"shippingcounty,omitempty"` + + // SIC Code + Sic string `json:"sic,omitempty"` + + // SIC Description + Sicdesc string `json:"sicdesc,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"` + + // Website + Website string `json:"website,omitempty"` + + // WHMCS Client ID + Whmcsclientid int64 `json:"whmcsclientid,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 +} + +// 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/sf-gate/sf_gate_models/account_request.go b/api/sf-gate/sf_gate_models/account_request.go new file mode 100644 index 0000000..68747a3 --- /dev/null +++ b/api/sf-gate/sf_gate_models/account_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountRequest account request +// +// swagger:model AccountRequest +type AccountRequest struct { + + // data + Data []*Account `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// 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 err := m.validateMeta(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 +} + +func (m *AccountRequest) 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 +} + +// 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/sf-gate/sf_gate_models/account_response.go b/api/sf-gate/sf_gate_models/account_response.go new file mode 100644 index 0000000..c0c355f --- /dev/null +++ b/api/sf-gate/sf_gate_models/account_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountResponse An array of Account objects +// +// 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 +} + +// 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/sf-gate/sf_gate_models/accounting_rule.go b/api/sf-gate/sf_gate_models/accounting_rule.go new file mode 100644 index 0000000..2e96bb7 --- /dev/null +++ b/api/sf-gate/sf_gate_models/accounting_rule.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRule accounting rule +// +// swagger:model AccountingRule +type AccountingRule struct { + + // The Account for whom this Account Rule exists + Accountid string `json:"accountid,omitempty"` + + // The Code used for Accounting Rule Lookups + Code string `json:"code,omitempty"` + + // The Cost of Goods Sold account to be used for this Accounting Rule + Cogsaccountid string `json:"cogsaccountid,omitempty"` + + // COGS Account Name + Cogsaccountname string `json:"cogsaccountname,omitempty"` + + // Created By + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // The GL Account that is the Credit Account to be used in this Accounting Rule + Creditaccountid string `json:"creditaccountid,omitempty"` + + // Credit Account Name + Creditaccountname string `json:"creditaccountname,omitempty"` + + // The GL Account that is the Debit Account to be used in this Accounting Rule + Debitaccountid string `json:"debitaccountid,omitempty"` + + // Debit Account Name + Debitaccountname string `json:"debitaccountname,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // The GL Account that is the Inventory Account to be used in this Accounting Rule + Inventoryaccountid string `json:"inventoryaccountid,omitempty"` + + // Inventory Account Name + Inventoryaccountname string `json:"inventoryaccountname,omitempty"` + + // Is this a deferred tax, not to be charged on the invoice? + Isdeferred bool `json:"isdeferred,omitempty"` + + // Last Modified By + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Parent Foreign Key + Parentfk string `json:"parentfk,omitempty"` + + // The Proportion of Revenue which is governed by this Accounting Rule; used for proportional taxing of products and services + Proportion float64 `json:"proportion,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this accounting rule +func (m *AccountingRule) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AccountingRule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRule) UnmarshalBinary(b []byte) error { + var res AccountingRule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/accounting_rule_request.go b/api/sf-gate/sf_gate_models/accounting_rule_request.go new file mode 100644 index 0000000..ce133a1 --- /dev/null +++ b/api/sf-gate/sf_gate_models/accounting_rule_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRuleRequest accounting rule request +// +// swagger:model AccountingRuleRequest +type AccountingRuleRequest struct { + + // data + Data []*AccountingRule `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this accounting rule request +func (m *AccountingRuleRequest) 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 *AccountingRuleRequest) 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 *AccountingRuleRequest) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRuleRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRuleRequest) UnmarshalBinary(b []byte) error { + var res AccountingRuleRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/accounting_rule_response.go b/api/sf-gate/sf_gate_models/accounting_rule_response.go new file mode 100644 index 0000000..2ba71c0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/accounting_rule_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRuleResponse accounting rule response +// +// swagger:model AccountingRuleResponse +type AccountingRuleResponse struct { + + // data + Data []*AccountingRule `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this accounting rule response +func (m *AccountingRuleResponse) 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 *AccountingRuleResponse) 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 *AccountingRuleResponse) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRuleResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRuleResponse) UnmarshalBinary(b []byte) error { + var res AccountingRuleResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/accounting_ruleset.go b/api/sf-gate/sf_gate_models/accounting_ruleset.go new file mode 100644 index 0000000..e450317 --- /dev/null +++ b/api/sf-gate/sf_gate_models/accounting_ruleset.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRuleset accounting ruleset +// +// swagger:model AccountingRuleset +type AccountingRuleset struct { + + // Taxnexus Account ID + Accountid string `json:"accountid,omitempty"` + + // Accounting Ruleset Code + Code string `json:"code,omitempty"` + + // Created By + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // Ruleset Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // items + Items []*AccountingRulesetItem `json:"items"` + + // Last Modified By + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Taxnexus Ruleset Number + Number string `json:"number,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this accounting ruleset +func (m *AccountingRuleset) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountingRuleset) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AccountingRuleset) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRuleset) UnmarshalBinary(b []byte) error { + var res AccountingRuleset + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/accounting_ruleset_item.go b/api/sf-gate/sf_gate_models/accounting_ruleset_item.go new file mode 100644 index 0000000..ebb29db --- /dev/null +++ b/api/sf-gate/sf_gate_models/accounting_ruleset_item.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRulesetItem accounting ruleset item +// +// swagger:model AccountingRulesetItem +type AccountingRulesetItem struct { + + // The code of the rule in this ruleset + Accountingrulecode string `json:"accountingrulecode,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this accounting ruleset item +func (m *AccountingRulesetItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AccountingRulesetItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRulesetItem) UnmarshalBinary(b []byte) error { + var res AccountingRulesetItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/accounting_ruleset_request.go b/api/sf-gate/sf_gate_models/accounting_ruleset_request.go new file mode 100644 index 0000000..7dc548d --- /dev/null +++ b/api/sf-gate/sf_gate_models/accounting_ruleset_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRulesetRequest accounting ruleset request +// +// swagger:model AccountingRulesetRequest +type AccountingRulesetRequest struct { + + // data + Data []*AccountingRuleset `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this accounting ruleset request +func (m *AccountingRulesetRequest) 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 *AccountingRulesetRequest) 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 *AccountingRulesetRequest) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRulesetRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRulesetRequest) UnmarshalBinary(b []byte) error { + var res AccountingRulesetRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/accounting_ruleset_response.go b/api/sf-gate/sf_gate_models/accounting_ruleset_response.go new file mode 100644 index 0000000..ecd9441 --- /dev/null +++ b/api/sf-gate/sf_gate_models/accounting_ruleset_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountingRulesetResponse accounting ruleset response +// +// swagger:model AccountingRulesetResponse +type AccountingRulesetResponse struct { + + // data + Data []*AccountingRuleset `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this accounting ruleset response +func (m *AccountingRulesetResponse) 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 *AccountingRulesetResponse) 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 *AccountingRulesetResponse) 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 +} + +// MarshalBinary interface implementation +func (m *AccountingRulesetResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AccountingRulesetResponse) UnmarshalBinary(b []byte) error { + var res AccountingRulesetResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/address.go b/api/sf-gate/sf_gate_models/address.go new file mode 100644 index 0000000..8bb8f25 --- /dev/null +++ b/api/sf-gate/sf_gate_models/address.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Address address +// +// swagger:model Address +type Address struct { + + // City + // Required: true + City *string `json:"city"` + + // 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 + // Required: true + Statecode *string `json:"statecode"` + + // Street number and name + Street string `json:"street,omitempty"` +} + +// Validate validates this address +func (m *Address) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatecode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Address) validateCity(formats strfmt.Registry) error { + + if err := validate.Required("city", "body", m.City); err != nil { + return err + } + + return nil +} + +func (m *Address) validateStatecode(formats strfmt.Registry) error { + + if err := validate.Required("statecode", "body", m.Statecode); err != nil { + return err + } + + 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/sf-gate/sf_gate_models/authority.go b/api/sf-gate/sf_gate_models/authority.go new file mode 100644 index 0000000..cb305b3 --- /dev/null +++ b/api/sf-gate/sf_gate_models/authority.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 ID + 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"` + + // date + Date string `json:"date,omitempty"` + + // Date Approved + Dateapproved string `json:"dateapproved,omitempty"` + + // Taxnexus 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 ID + Opportunityid string `json:"opportunityid,omitempty"` + + // Order ID + 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 ID + 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"` + + // tenant identifier + 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 +} + +// 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/sf-gate/sf_gate_models/authority_request.go b/api/sf-gate/sf_gate_models/authority_request.go new file mode 100644 index 0000000..a91ac1a --- /dev/null +++ b/api/sf-gate/sf_gate_models/authority_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// 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 err := m.validateMeta(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 +} + +func (m *AuthorityRequest) 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 +} + +// 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/sf-gate/sf_gate_models/authority_response.go b/api/sf-gate/sf_gate_models/authority_response.go new file mode 100644 index 0000000..9999a84 --- /dev/null +++ b/api/sf-gate/sf_gate_models/authority_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AuthorityResponse authority response +// +// 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 +} + +// 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/sf-gate/sf_gate_models/backend.go b/api/sf-gate/sf_gate_models/backend.go new file mode 100644 index 0000000..fe575f4 --- /dev/null +++ b/api/sf-gate/sf_gate_models/backend.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Backend backend +// +// swagger:model Backend +type Backend struct { + + // The Account that owns this Backend + Accountid string `json:"accountid,omitempty"` + + // Active + Active bool `json:"active,omitempty"` + + // apikey + Apikey string `json:"apikey,omitempty"` + + // Used to identify the State were required + Applicationname string `json:"applicationname,omitempty"` + + // Authentication Type + Authtype string `json:"authtype,omitempty"` + + // Backend Name + Backendname string `json:"backendname,omitempty"` + + // base_url + Baseurl string `json:"baseurl,omitempty"` + + // callback_url + Callbackurl string `json:"callbackurl,omitempty"` + + // client_id + Clientid string `json:"clientid,omitempty"` + + // client_secret + Clientsecret string `json:"clientsecret,omitempty"` + + // Company + Companyid string `json:"companyid,omitempty"` + + // Created By + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Last Modified By + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // login_url + Loginurl string `json:"loginurl,omitempty"` + + // Management Password + Managementpassword string `json:"managementpassword,omitempty"` + + // Management URL + Managementurl string `json:"managementurl,omitempty"` + + // Management Username + Managementusername string `json:"managementusername,omitempty"` + + // MetrcLicense + Metrclicense string `json:"metrclicense,omitempty"` + + // MetrcState + Metrcstate string `json:"metrcstate,omitempty"` + + // Ownerid + Ownerid string `json:"ownerid,omitempty"` + + // password + Password string `json:"password,omitempty"` + + // Production + Production bool `json:"production,omitempty"` + + // project_id + Projectid string `json:"projectid,omitempty"` + + // Provider Credentials + Providercredentials string `json:"providercredentials,omitempty"` + + // realm + Realm string `json:"realm,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Resellerbackendid + Resellerbackendid string `json:"resellerbackendid,omitempty"` + + // security_token + Securitytoken string `json:"securitytoken,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Timeout + Timeout int64 `json:"timeout,omitempty"` + + // token_uri + Tokenuri string `json:"tokenuri,omitempty"` + + // Type + Type string `json:"type,omitempty"` + + // username + Username string `json:"username,omitempty"` + + // Backend Vendor Name + Vendor string `json:"vendor,omitempty"` +} + +// Validate validates this backend +func (m *Backend) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Backend) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Backend) UnmarshalBinary(b []byte) error { + var res Backend + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/backend_request.go b/api/sf-gate/sf_gate_models/backend_request.go new file mode 100644 index 0000000..e1d0e90 --- /dev/null +++ b/api/sf-gate/sf_gate_models/backend_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackendRequest backend request +// +// swagger:model BackendRequest +type BackendRequest struct { + + // data + Data []*Backend `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this backend request +func (m *BackendRequest) 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 *BackendRequest) 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 *BackendRequest) 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 +} + +// MarshalBinary interface implementation +func (m *BackendRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackendRequest) UnmarshalBinary(b []byte) error { + var res BackendRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/backend_response.go b/api/sf-gate/sf_gate_models/backend_response.go new file mode 100644 index 0000000..6e82c8b --- /dev/null +++ b/api/sf-gate/sf_gate_models/backend_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackendResponse backend response +// +// swagger:model BackendResponse +type BackendResponse struct { + + // data + Data []*Backend `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this backend response +func (m *BackendResponse) 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 *BackendResponse) 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 *BackendResponse) 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 +} + +// MarshalBinary interface implementation +func (m *BackendResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackendResponse) UnmarshalBinary(b []byte) error { + var res BackendResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/cash_receipt.go b/api/sf-gate/sf_gate_models/cash_receipt.go new file mode 100644 index 0000000..2cb0e77 --- /dev/null +++ b/api/sf-gate/sf_gate_models/cash_receipt.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CashReceipt Cash Receipt tracks all cash transactions in and out of the enterprise +// +// swagger:model CashReceipt +type CashReceipt struct { + + // Account Balance + Accountbalance float64 `json:"accountbalance,omitempty"` + + // Account + Accountid string `json:"accountid,omitempty"` + + // Account Name + Accountname string `json:"accountname,omitempty"` + + // Amount + Amount float64 `json:"amount,omitempty"` + + // Applied Amount + Appliedamount float64 `json:"appliedamount,omitempty"` + + // Attempt Number + AttemptNumber float64 `json:"attempt_number,omitempty"` + + // Audit Trail Message + Auditmessage string `json:"auditmessage,omitempty"` + + // Autopay? + Autopay bool `json:"autopay,omitempty"` + + // Billing Contact + Billingcontactid string `json:"billingcontactid,omitempty"` + + // Billing Run + Billingrunid string `json:"billingrunid,omitempty"` + + // Created By + Createdbyid string `json:"createdbyid,omitempty"` + + // Customer Id + Customerid string `json:"customerid,omitempty"` + + // Journal Date + Date string `json:"date,omitempty"` + + // Memo + Description string `json:"description,omitempty"` + + // Gateway + Gateway string `json:"gateway,omitempty"` + + // Gateway Key + Gatewaykey string `json:"gatewaykey,omitempty"` + + // Gateway Message + Gatewaymessage string `json:"gatewaymessage,omitempty"` + + // GatewayTxn? + Gatewaytxn bool `json:"gatewaytxn,omitempty"` + + // Taxnexus Record ID + ID string `json:"id,omitempty"` + + // Invoice + Invoiceid string `json:"invoiceid,omitempty"` + + // Is Valid? + Isvalid bool `json:"isvalid,omitempty"` + + // Last Modified By + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Payment Number + Name string `json:"name,omitempty"` + + // Parent Foreign Key + Parentfk string `json:"parentfk,omitempty"` + + // Partner Account + Partneraccountid string `json:"partneraccountid,omitempty"` + + // Payment Method + PaymentMethod string `json:"payment_method,omitempty"` + + // Pending? + Pending bool `json:"pending,omitempty"` + + // Period + Periodid string `json:"periodid,omitempty"` + + // Picklist Value + Picklistvalue string `json:"picklistvalue,omitempty"` + + // Posted + Posted bool `json:"posted,omitempty"` + + // Processed + Processed bool `json:"processed,omitempty"` + + // Processing + Processing bool `json:"processing,omitempty"` + + // Record Type + Recordtypeid string `json:"recordtypeid,omitempty"` + + // External Reference + Ref string `json:"ref,omitempty"` + + // Reference + Reference string `json:"reference,omitempty"` + + // Reference Number + Referencenumber float64 `json:"referencenumber,omitempty"` + + // Rejected? + Rejected bool `json:"rejected,omitempty"` + + // Source Payment Method + Sourceid string `json:"sourceid,omitempty"` + + // Statement Item Type + Statementitemtype string `json:"statementitemtype,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Type + Type string `json:"type,omitempty"` + + // Unapplied Amount + Unappliedamount float64 `json:"unappliedamount,omitempty"` + + // Valid Payment? + Validpayment bool `json:"validpayment,omitempty"` + + // Xero Credit Note Id + Xeroid string `json:"xeroid,omitempty"` +} + +// Validate validates this cash receipt +func (m *CashReceipt) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CashReceipt) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CashReceipt) UnmarshalBinary(b []byte) error { + var res CashReceipt + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/cash_receipt_request.go b/api/sf-gate/sf_gate_models/cash_receipt_request.go new file mode 100644 index 0000000..731873d --- /dev/null +++ b/api/sf-gate/sf_gate_models/cash_receipt_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CashReceiptRequest cash receipt request +// +// swagger:model CashReceiptRequest +type CashReceiptRequest struct { + + // data + Data []*CashReceipt `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this cash receipt request +func (m *CashReceiptRequest) 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 *CashReceiptRequest) 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 *CashReceiptRequest) 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 +} + +// MarshalBinary interface implementation +func (m *CashReceiptRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CashReceiptRequest) UnmarshalBinary(b []byte) error { + var res CashReceiptRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/cash_receipt_response.go b/api/sf-gate/sf_gate_models/cash_receipt_response.go new file mode 100644 index 0000000..189056c --- /dev/null +++ b/api/sf-gate/sf_gate_models/cash_receipt_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CashReceiptResponse cash receipt response +// +// swagger:model CashReceiptResponse +type CashReceiptResponse struct { + + // data + Data []*CashReceipt `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this cash receipt response +func (m *CashReceiptResponse) 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 *CashReceiptResponse) 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 *CashReceiptResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CashReceiptResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CashReceiptResponse) UnmarshalBinary(b []byte) error { + var res CashReceiptResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/cluster.go b/api/sf-gate/sf_gate_models/cluster.go new file mode 100644 index 0000000..ae26475 --- /dev/null +++ b/api/sf-gate/sf_gate_models/cluster.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // IP Address + IPAddress string `json:"ip_address,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"` + + // tenantid + 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 +} + +// 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/sf-gate/sf_gate_models/cluster_request.go b/api/sf-gate/sf_gate_models/cluster_request.go new file mode 100644 index 0000000..f5b2fd2 --- /dev/null +++ b/api/sf-gate/sf_gate_models/cluster_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClusterRequest cluster request +// +// swagger:model ClusterRequest +type ClusterRequest struct { + + // data + // Required: true + Data []*Cluster `json:"data"` + + // meta + // Required: true + Meta *RequestMeta `json:"meta"` +} + +// 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 err := m.validateMeta(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 err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + 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 *ClusterRequest) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + 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 +} + +// 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/sf-gate/sf_gate_models/cluster_response.go b/api/sf-gate/sf_gate_models/cluster_response.go new file mode 100644 index 0000000..5320eed --- /dev/null +++ b/api/sf-gate/sf_gate_models/cluster_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/company.go b/api/sf-gate/sf_gate_models/company.go new file mode 100644 index 0000000..a904dd0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/company.go @@ -0,0 +1,214 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Company company +// +// swagger:model Company +type Company struct { + + // Taxnexus ID of the Account that owns this Company + Accountid string `json:"accountid,omitempty"` + + // Account Number Prefix + Accountnumberprefix string `json:"accountnumberprefix,omitempty"` + + // The next period to be used in periodic billing + Advancedperiodid string `json:"advancedperiodid,omitempty"` + + // billingaddress + 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"` + + // The last closed period + Closedperiodid string `json:"closedperiodid,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"` + + // The current period + Currentperiodid string `json:"currentperiodid,omitempty"` + + // The current period's status value + Currentperiodstatus string `json:"currentperiodstatus,omitempty"` + + // User ID of default Customer Success user + Customersuccessid string `json:"customersuccessid,omitempty"` + + // Date Closed + Dateclosed string `json:"dateclosed,omitempty"` + + // defaultaddress + 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"` + + // Taxnexus 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 +} + +// 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/sf-gate/sf_gate_models/company_response.go b/api/sf-gate/sf_gate_models/company_response.go new file mode 100644 index 0000000..4683d44 --- /dev/null +++ b/api/sf-gate/sf_gate_models/company_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/contact.go b/api/sf-gate/sf_gate_models/contact.go new file mode 100644 index 0000000..fc71e5e --- /dev/null +++ b/api/sf-gate/sf_gate_models/contact.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 + Emailbounceddate string `json:"emailbounceddate,omitempty"` + + // Email Bounce Reason + Emailbouncedreason string `json:"emailbouncedreason,omitempty"` + + // Taxnexus 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"` + + // Taxnexus 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"` + + // mailingaddress + 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"` + + // otheraddress + 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 +} + +// 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/sf-gate/sf_gate_models/contact_request.go b/api/sf-gate/sf_gate_models/contact_request.go new file mode 100644 index 0000000..971e405 --- /dev/null +++ b/api/sf-gate/sf_gate_models/contact_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ContactRequest contact request +// +// swagger:model ContactRequest +type ContactRequest struct { + + // data + // Required: true + Data []*Contact `json:"data"` + + // meta + // Required: true + Meta *RequestMeta `json:"meta"` +} + +// 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 err := m.validateMeta(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 err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + 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 *ContactRequest) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + 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 +} + +// 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/sf-gate/sf_gate_models/contact_response.go b/api/sf-gate/sf_gate_models/contact_response.go new file mode 100644 index 0000000..82582d3 --- /dev/null +++ b/api/sf-gate/sf_gate_models/contact_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/contract_basic.go b/api/sf-gate/sf_gate_models/contract_basic.go new file mode 100644 index 0000000..b3a2fae --- /dev/null +++ b/api/sf-gate/sf_gate_models/contract_basic.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ContractBasic contract basic +// +// swagger:model ContractBasic +type ContractBasic struct { + + // Description + Description string `json:"description,omitempty"` + + // Contract End Date + Enddate string `json:"enddate,omitempty"` + + // Hourly Rate + Hourlyrate float64 `json:"hourlyrate,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Is Active? + Isactive bool `json:"isactive,omitempty"` + + // Contract Name + Name string `json:"name,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Payment Terms + Paymentterms string `json:"paymentterms,omitempty"` + + // Price Book + Pricebook2id string `json:"pricebook2id,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Contract Start Date + Startdate string `json:"startdate,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Contract Type + Type string `json:"type,omitempty"` +} + +// Validate validates this contract basic +func (m *ContractBasic) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ContractBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContractBasic) UnmarshalBinary(b []byte) error { + var res ContractBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/country.go b/api/sf-gate/sf_gate_models/country.go new file mode 100644 index 0000000..3be4b88 --- /dev/null +++ b/api/sf-gate/sf_gate_models/country.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Country country +// +// swagger:model Country +type Country struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Rollup Amount + Amount float64 `json:"amount,omitempty"` + + // Code + Code string `json:"code,omitempty"` + + // Contact + Contactid string `json:"contactid,omitempty"` + + // Enrollment Status + Enrollmentstatus string `json:"enrollmentstatus,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Interest + Interest float64 `json:"interest,omitempty"` + + // latitude + Latitude float64 `json:"latitude,omitempty"` + + // longitude + Longitude float64 `json:"longitude,omitempty"` + + // Country Name + Name string `json:"name,omitempty"` + + // Penalty + Penalty float64 `json:"penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Reported Adjustments + Reportedadjustments float64 `json:"reportedadjustments,omitempty"` + + // Reported Deductions + Reporteddeductions float64 `json:"reporteddeductions,omitempty"` + + // Reported Net Revenue + Reportednetrevenue float64 `json:"reportednetrevenue,omitempty"` + + // Reported Rate + Reportedrate float64 `json:"reportedrate,omitempty"` + + // Reported Revenue + Reportedrevenue float64 `json:"reportedrevenue,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"` + + // Document Status + Status string `json:"status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"subtotal,omitempty"` + + // taxinstances + Taxinstances []*TaxInstance `json:"taxinstances"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // Total Amount + Totalamount float64 `json:"totalamount,omitempty"` + + // Unit Base + Unitbase float64 `json:"unitbase,omitempty"` +} + +// Validate validates this country +func (m *Country) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxinstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Country) validateTaxinstances(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxinstances) { // not required + return nil + } + + for i := 0; i < len(m.Taxinstances); i++ { + if swag.IsZero(m.Taxinstances[i]) { // not required + continue + } + + if m.Taxinstances[i] != nil { + if err := m.Taxinstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxinstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Country) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Country) UnmarshalBinary(b []byte) error { + var res Country + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/country_response.go b/api/sf-gate/sf_gate_models/country_response.go new file mode 100644 index 0000000..df37bb3 --- /dev/null +++ b/api/sf-gate/sf_gate_models/country_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CountryResponse An array of Country objects +// +// swagger:model CountryResponse +type CountryResponse struct { + + // data + Data []*Country `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this country response +func (m *CountryResponse) 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 *CountryResponse) 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 *CountryResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CountryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CountryResponse) UnmarshalBinary(b []byte) error { + var res CountryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/county.go b/api/sf-gate/sf_gate_models/county.go new file mode 100644 index 0000000..ffce0cd --- /dev/null +++ b/api/sf-gate/sf_gate_models/county.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// County county +// +// swagger:model County +type County struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Rollup Amount + Amount float64 `json:"amount,omitempty"` + + // AreaDescription + Areadescription string `json:"areadescription,omitempty"` + + // Contact + Contactid string `json:"contactid,omitempty"` + + // Country Taxnexus ID + Countryid string `json:"countryid,omitempty"` + + // Enrollment Status + Enrollmentstatus string `json:"enrollmentstatus,omitempty"` + + // FIPS + Fips string `json:"fips,omitempty"` + + // FIPS Class + Fipsclass string `json:"fipsclass,omitempty"` + + // Functional Status + Functionalstatus string `json:"functionalstatus,omitempty"` + + // Geocode + Geocode string `json:"geocode,omitempty"` + + // GNIS Code + Gnis int64 `json:"gnis,omitempty"` + + // True if this Place has District Sales taxes + Hasdistricttaxes bool `json:"hasdistricttaxes,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Interest + Interest float64 `json:"interest,omitempty"` + + // Land Area + Landarea int64 `json:"landarea,omitempty"` + + // latitude + Latitude float64 `json:"latitude,omitempty"` + + // Legal Name + Legalname string `json:"legalname,omitempty"` + + // longitude + Longitude float64 `json:"longitude,omitempty"` + + // County Name + Name string `json:"name,omitempty"` + + // Penalty + Penalty float64 `json:"penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Reported Adjustments + Reportedadjustments float64 `json:"reportedadjustments,omitempty"` + + // Reported Deductions + Reporteddeductions float64 `json:"reporteddeductions,omitempty"` + + // Reported Net Revenue + Reportednetrevenue float64 `json:"reportednetrevenue,omitempty"` + + // Reported Rate + Reportedrate float64 `json:"reportedrate,omitempty"` + + // Reported Revenue + Reportedrevenue float64 `json:"reportedrevenue,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"` + + // State + Stateid string `json:"stateid,omitempty"` + + // Document Status + Status string `json:"status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"subtotal,omitempty"` + + // taxinstances + Taxinstances []*TaxInstance `json:"taxinstances"` + + // Print Template ID + Templateid string `json:"templateid,omitempty"` + + // Total Amount + Totalamount float64 `json:"totalamount,omitempty"` + + // Total Area + Totalarea int64 `json:"totalarea,omitempty"` + + // Unit Base + Unitbase float64 `json:"unitbase,omitempty"` + + // Water Area + Waterarea int64 `json:"waterarea,omitempty"` +} + +// Validate validates this county +func (m *County) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxinstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *County) validateTaxinstances(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxinstances) { // not required + return nil + } + + for i := 0; i < len(m.Taxinstances); i++ { + if swag.IsZero(m.Taxinstances[i]) { // not required + continue + } + + if m.Taxinstances[i] != nil { + if err := m.Taxinstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxinstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *County) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *County) UnmarshalBinary(b []byte) error { + var res County + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/county_response.go b/api/sf-gate/sf_gate_models/county_response.go new file mode 100644 index 0000000..8678c97 --- /dev/null +++ b/api/sf-gate/sf_gate_models/county_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CountyResponse An array of County objects +// +// swagger:model CountyResponse +type CountyResponse struct { + + // data + Data []*County `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this county response +func (m *CountyResponse) 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 *CountyResponse) 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 *CountyResponse) 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 +} + +// MarshalBinary interface implementation +func (m *CountyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CountyResponse) UnmarshalBinary(b []byte) error { + var res CountyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/credit_card.go b/api/sf-gate/sf_gate_models/credit_card.go new file mode 100644 index 0000000..db4652a --- /dev/null +++ b/api/sf-gate/sf_gate_models/credit_card.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreditCard credit card +// +// swagger:model CreditCard +type CreditCard struct { + + // Active + Active bool `json:"active,omitempty"` + + // Billing City + Billingcity string `json:"billingcity,omitempty"` + + // Billing State + Billingstate string `json:"billingstate,omitempty"` + + // Billing Street + Billingstreet string `json:"billingstreet,omitempty"` + + // Billing Zip + Billingzip string `json:"billingzip,omitempty"` + + // CC CID + CcCid string `json:"cc_cid,omitempty"` + + // CC Number + CcNumber string `json:"cc_number,omitempty"` + + // CC_Print + CcPrint string `json:"cc_print,omitempty"` + + // CC Type + CcType string `json:"cc_type,omitempty"` + + // Company + Companyid string `json:"companyid,omitempty"` + + // Exp Month + Expmonth string `json:"expmonth,omitempty"` + + // Exp Year + Expyear string `json:"expyear,omitempty"` + + // Record Id + ID string `json:"id,omitempty"` + + // CC Name + Name string `json:"name,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this credit card +func (m *CreditCard) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreditCard) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreditCard) UnmarshalBinary(b []byte) error { + var res CreditCard + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/database.go b/api/sf-gate/sf_gate_models/database.go new file mode 100644 index 0000000..8db96c0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/database.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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"` + + // The name of the physical database in the cluster + Databasename string `json:"databasename,omitempty"` + + // Database connection string + Dsn string `json:"dsn,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 Taxnexus 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 +} + +// 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/sf-gate/sf_gate_models/database_request.go b/api/sf-gate/sf_gate_models/database_request.go new file mode 100644 index 0000000..7ed4224 --- /dev/null +++ b/api/sf-gate/sf_gate_models/database_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// 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 err := m.validateMeta(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 +} + +func (m *DatabaseRequest) 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 +} + +// 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/sf-gate/sf_gate_models/database_response.go b/api/sf-gate/sf_gate_models/database_response.go new file mode 100644 index 0000000..f0b5cda --- /dev/null +++ b/api/sf-gate/sf_gate_models/database_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/domain.go b/api/sf-gate/sf_gate_models/domain.go new file mode 100644 index 0000000..c01a477 --- /dev/null +++ b/api/sf-gate/sf_gate_models/domain.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Domain domain +// +// swagger:model Domain +type Domain struct { + + // Active + Active bool `json:"active,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Name + Name string `json:"name,omitempty"` +} + +// Validate validates this domain +func (m *Domain) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Domain) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Domain) UnmarshalBinary(b []byte) error { + var res Domain + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/domain_response.go b/api/sf-gate/sf_gate_models/domain_response.go new file mode 100644 index 0000000..d5178e1 --- /dev/null +++ b/api/sf-gate/sf_gate_models/domain_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DomainResponse An array of Domain objects +// +// swagger:model DomainResponse +type DomainResponse struct { + + // data + Data []*Domain `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this domain response +func (m *DomainResponse) 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 *DomainResponse) 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 *DomainResponse) 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 +} + +// MarshalBinary interface implementation +func (m *DomainResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DomainResponse) UnmarshalBinary(b []byte) error { + var res DomainResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/error.go b/api/sf-gate/sf_gate_models/error.go new file mode 100644 index 0000000..ffd458f --- /dev/null +++ b/api/sf-gate/sf_gate_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/sf-gate/sf_gate_models/filing.go b/api/sf-gate/sf_gate_models/filing.go new file mode 100644 index 0000000..5c8a4d5 --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Filing filing +// +// swagger:model Filing +type Filing struct { + + // accountid + Accountid string `json:"accountid,omitempty"` + + // Account Name on Filing + Accountname string `json:"accountname,omitempty"` + + // The amount of tax to be paid with this filing + Amount float64 `json:"amount,omitempty"` + + // authorityid + Authorityid string `json:"authorityid,omitempty"` + + // Billing Contact + Contactid string `json:"contactid,omitempty"` + + // Created By User ID + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // Filing Date + Date string `json:"date,omitempty"` + + // Due Date + Duedate string `json:"duedate,omitempty"` + + // Due Date + Filingnumber string `json:"filingnumber,omitempty"` + + // The ID of the Filing Type for this Filing + Filingtypeid string `json:"filingtypeid,omitempty"` + + // Due Date + Frequency string `json:"frequency,omitempty"` + + // Record Id + ID string `json:"id,omitempty"` + + // Interest + Interest float64 `json:"interest,omitempty"` + + // Interest + Interestrate float64 `json:"interestrate,omitempty"` + + // Last Modified By User ID + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // The number of the Month of the filing + Monthnumber int64 `json:"monthnumber,omitempty"` + + // Taxneuxs ID of the User who owns this record + Ownerid string `json:"ownerid,omitempty"` + + // Penalty + Penalty float64 `json:"penalty,omitempty"` + + // Penalty Days + Penaltydays float64 `json:"penaltydays,omitempty"` + + // Penalty Days + Penaltyrate float64 `json:"penaltyrate,omitempty"` + + // Period + Periodid string `json:"periodid,omitempty"` + + // Taxnexus ID of the Contact who prepared this filing + Preparerid string `json:"preparerid,omitempty"` + + // The number of the Month of the filing + Quarternumber int64 `json:"quarternumber,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Reported Adjustments + Reportedadjustments float64 `json:"reportedadjustments,omitempty"` + + // Reported Deductions + Reporteddeductions float64 `json:"reporteddeductions,omitempty"` + + // Reported Net Revenue + Reportednetrevenue float64 `json:"reportednetrevenue,omitempty"` + + // Reported Rate + Reportedrate float64 `json:"reportedrate,omitempty"` + + // Reported Revenue + Reportedrevenue float64 `json:"reportedrevenue,omitempty"` + + // Revenue Base + Revenuebase float64 `json:"revenuebase,omitempty"` + + // Revenue Net + Revenuenet float64 `json:"revenuenet,omitempty"` + + // Revenue Not Taxable + Revenuenottaxable float64 `json:"revenuenottaxable,omitempty"` + + // The number of the Month of the filing + Semiannualnumber int64 `json:"semiannualnumber,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Taxnexus ID of the Submission that owns this Filing + Submissionid string `json:"submissionid,omitempty"` + + // Reported Tax + Subtotal float64 `json:"subtotal,omitempty"` + + // Tax On Tax + Taxontax float64 `json:"taxontax,omitempty"` + + // The TaxType Account for which this Filing is paying remittance + Taxtypeaccountid string `json:"taxtypeaccountid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Amount + Totalamount float64 `json:"totalamount,omitempty"` + + // Unit Base + Unitbase float64 `json:"unitbase,omitempty"` + + // The number of the Month of the filing + Yearnumber int64 `json:"yearnumber,omitempty"` +} + +// Validate validates this filing +func (m *Filing) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Filing) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Filing) UnmarshalBinary(b []byte) error { + var res Filing + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/filing_due_date.go b/api/sf-gate/sf_gate_models/filing_due_date.go new file mode 100644 index 0000000..e1fdd9b --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing_due_date.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingDueDate Dates when this FilingType is due for filing +// +// swagger:model FilingDueDate +type FilingDueDate struct { + + // description + Description string `json:"description,omitempty"` + + // duedate + Duedate string `json:"duedate,omitempty"` +} + +// Validate validates this filing due date +func (m *FilingDueDate) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FilingDueDate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingDueDate) UnmarshalBinary(b []byte) error { + var res FilingDueDate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/filing_request.go b/api/sf-gate/sf_gate_models/filing_request.go new file mode 100644 index 0000000..72f16b6 --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingRequest filing request +// +// swagger:model FilingRequest +type FilingRequest struct { + + // data + Data []*Filing `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this filing request +func (m *FilingRequest) 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 *FilingRequest) 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 *FilingRequest) 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 +} + +// MarshalBinary interface implementation +func (m *FilingRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingRequest) UnmarshalBinary(b []byte) error { + var res FilingRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/filing_response.go b/api/sf-gate/sf_gate_models/filing_response.go new file mode 100644 index 0000000..f277cc0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingResponse An array of Filing Objects +// +// swagger:model FilingResponse +type FilingResponse struct { + + // data + Data []*Filing `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this filing response +func (m *FilingResponse) 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 *FilingResponse) 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 *FilingResponse) 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 +} + +// MarshalBinary interface implementation +func (m *FilingResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingResponse) UnmarshalBinary(b []byte) error { + var res FilingResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/filing_type.go b/api/sf-gate/sf_gate_models/filing_type.go new file mode 100644 index 0000000..a685848 --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing_type.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingType An array of FilingType Objects +// +// swagger:model FilingType +type FilingType struct { + + // Tax Authority + 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"` + + // duedates + Duedates []*FilingDueDate `json:"duedates"` + + // Filing City + Filingcity string `json:"filingcity,omitempty"` + + // Filing Country + Filingcountry string `json:"filingcountry,omitempty"` + + // Filing Postal Code + Filingpostalcode string `json:"filingpostalcode,omitempty"` + + // Filing State + Filingstate string `json:"filingstate,omitempty"` + + // Filing Street + Filingstreet string `json:"filingstreet,omitempty"` + + // Form Name + Formname string `json:"formname,omitempty"` + + // Form Version + Formversion string `json:"formversion,omitempty"` + + // Frequency + Frequency string `json:"frequency,omitempty"` + + // Filing Full Name + Fullname string `json:"fullname,omitempty"` + + // Record Id + ID string `json:"id,omitempty"` + + // instances + Instances []*FilingTypeInstance `json:"instances"` + + // Last Modified By + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modifed Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Jurisdictional Level + Level string `json:"level,omitempty"` + + // Name + Name string `json:"name,omitempty"` + + // Owner + Ownerid string `json:"ownerid,omitempty"` + + // Saga Type + Sagatype string `json:"sagatype,omitempty"` + + // Submission Method + Submissionmethod string `json:"submissionmethod,omitempty"` + + // Instructions Template + Templateinstructionsid string `json:"templateinstructionsid,omitempty"` + + // Return Template + Templatereturnid string `json:"templatereturnid,omitempty"` +} + +// Validate validates this filing type +func (m *FilingType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDuedates(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FilingType) validateDuedates(formats strfmt.Registry) error { + + if swag.IsZero(m.Duedates) { // not required + return nil + } + + for i := 0; i < len(m.Duedates); i++ { + if swag.IsZero(m.Duedates[i]) { // not required + continue + } + + if m.Duedates[i] != nil { + if err := m.Duedates[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("duedates" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FilingType) validateInstances(formats strfmt.Registry) error { + + if swag.IsZero(m.Instances) { // not required + return nil + } + + for i := 0; i < len(m.Instances); i++ { + if swag.IsZero(m.Instances[i]) { // not required + continue + } + + if m.Instances[i] != nil { + if err := m.Instances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("instances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FilingType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingType) UnmarshalBinary(b []byte) error { + var res FilingType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/filing_type_instance.go b/api/sf-gate/sf_gate_models/filing_type_instance.go new file mode 100644 index 0000000..fb6d1fc --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing_type_instance.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingTypeInstance A list of jurisdictions that use this Filing Type +// +// swagger:model FilingTypeInstance +type FilingTypeInstance struct { + + // Country Id + Countryid string `json:"countryid,omitempty"` + + // County ID + Countyid string `json:"countyid,omitempty"` + + // The ID of the Filing Type for this Filing + Filingtypeid string `json:"filingtypeid,omitempty"` + + // The type of object that owns this FilingType instance + Objecttype string `json:"objecttype,omitempty"` + + // Place ID + Placeid string `json:"placeid,omitempty"` + + // StateID + Stateid string `json:"stateid,omitempty"` +} + +// Validate validates this filing type instance +func (m *FilingTypeInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FilingTypeInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingTypeInstance) UnmarshalBinary(b []byte) error { + var res FilingTypeInstance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/filing_type_request.go b/api/sf-gate/sf_gate_models/filing_type_request.go new file mode 100644 index 0000000..8bf4599 --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing_type_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FilingTypeRequest filing type request +// +// swagger:model FilingTypeRequest +type FilingTypeRequest struct { + + // data + // Required: true + Data []*FilingType `json:"data"` + + // meta + // Required: true + Meta *RequestMeta `json:"meta"` +} + +// Validate validates this filing type request +func (m *FilingTypeRequest) 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 *FilingTypeRequest) validateData(formats strfmt.Registry) error { + + if err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + 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 *FilingTypeRequest) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + 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 +} + +// MarshalBinary interface implementation +func (m *FilingTypeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingTypeRequest) UnmarshalBinary(b []byte) error { + var res FilingTypeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/filing_type_response.go b/api/sf-gate/sf_gate_models/filing_type_response.go new file mode 100644 index 0000000..efc77ed --- /dev/null +++ b/api/sf-gate/sf_gate_models/filing_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FilingTypeResponse An array of Filing Objects +// +// swagger:model FilingTypeResponse +type FilingTypeResponse struct { + + // data + Data []*FilingType `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this filing type response +func (m *FilingTypeResponse) 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 *FilingTypeResponse) 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 *FilingTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *FilingTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FilingTypeResponse) UnmarshalBinary(b []byte) error { + var res FilingTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/geo_license_type_instance.go b/api/sf-gate/sf_gate_models/geo_license_type_instance.go new file mode 100644 index 0000000..1a1da3f --- /dev/null +++ b/api/sf-gate/sf_gate_models/geo_license_type_instance.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GeoLicenseTypeInstance Links a license type to a geography +// +// swagger:model GeoLicenseTypeInstance +type GeoLicenseTypeInstance struct { + + // countryid + Countryid string `json:"countryid,omitempty"` + + // countyid + Countyid string `json:"countyid,omitempty"` + + // objecttype + Objecttype string `json:"objecttype,omitempty"` + + // placeid + Placeid string `json:"placeid,omitempty"` + + // stateid + Stateid string `json:"stateid,omitempty"` +} + +// Validate validates this geo license type instance +func (m *GeoLicenseTypeInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GeoLicenseTypeInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GeoLicenseTypeInstance) UnmarshalBinary(b []byte) error { + var res GeoLicenseTypeInstance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/gl_account.go b/api/sf-gate/sf_gate_models/gl_account.go new file mode 100644 index 0000000..5ad936f --- /dev/null +++ b/api/sf-gate/sf_gate_models/gl_account.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlAccount gl account +// +// swagger:model GlAccount +type GlAccount struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Account Level + Accountlevel float64 `json:"accountlevel,omitempty"` + + // Account Name + Accountname string `json:"accountname,omitempty"` + + // Account Number + Accountnumber float64 `json:"accountnumber,omitempty"` + + // Account Sign + Accountsign string `json:"accountsign,omitempty"` + + // Account Type + Accounttype string `json:"accounttype,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Is Active? + Isactive bool `json:"isactive,omitempty"` + + // Is Bank Account ? + Isbankaccount bool `json:"isbankaccount,omitempty"` + + // Is Summary? + Issummary bool `json:"issummary,omitempty"` + + // Display Name + Name string `json:"name,omitempty"` + + // Parent Foreign Key + Parentfk string `json:"parentfk,omitempty"` + + // Parent GL Account + Parentglaccountid string `json:"parentglaccountid,omitempty"` + + // Reference + Ref string `json:"ref,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this gl account +func (m *GlAccount) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GlAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlAccount) UnmarshalBinary(b []byte) error { + var res GlAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/gl_account_request.go b/api/sf-gate/sf_gate_models/gl_account_request.go new file mode 100644 index 0000000..e1c388d --- /dev/null +++ b/api/sf-gate/sf_gate_models/gl_account_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlAccountRequest gl account request +// +// swagger:model GlAccountRequest +type GlAccountRequest struct { + + // data + Data []*GlAccount `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this gl account request +func (m *GlAccountRequest) 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 *GlAccountRequest) 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 *GlAccountRequest) 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 +} + +// MarshalBinary interface implementation +func (m *GlAccountRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlAccountRequest) UnmarshalBinary(b []byte) error { + var res GlAccountRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/gl_account_response.go b/api/sf-gate/sf_gate_models/gl_account_response.go new file mode 100644 index 0000000..d6831f6 --- /dev/null +++ b/api/sf-gate/sf_gate_models/gl_account_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlAccountResponse gl account response +// +// swagger:model GlAccountResponse +type GlAccountResponse struct { + + // data + Data []*GlAccount `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this gl account response +func (m *GlAccountResponse) 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 *GlAccountResponse) 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 *GlAccountResponse) 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 +} + +// MarshalBinary interface implementation +func (m *GlAccountResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlAccountResponse) UnmarshalBinary(b []byte) error { + var res GlAccountResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/gl_balance.go b/api/sf-gate/sf_gate_models/gl_balance.go new file mode 100644 index 0000000..1e46bdd --- /dev/null +++ b/api/sf-gate/sf_gate_models/gl_balance.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlBalance gl balance +// +// swagger:model GlBalance +type GlBalance struct { + + // Account Name + Accountname string `json:"accountname,omitempty"` + + // Amount + Amount float64 `json:"amount,omitempty"` + + // Close Date + Closedate string `json:"closedate,omitempty"` + + // Created By User ID + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // Credits + Credits float64 `json:"credits,omitempty"` + + // Debits + Debits float64 `json:"debits,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // GL Account Display Value + Glaccountdisplay string `json:"glaccountdisplay,omitempty"` + + // GL Account + Glaccountid string `json:"glaccountid,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Last Modified By User ID + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Period ID + Periodid string `json:"periodid,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Rollup Credits + Rollupcredits float64 `json:"rollupcredits,omitempty"` + + // Rollup Debits + Rollupdebits float64 `json:"rollupdebits,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this gl balance +func (m *GlBalance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GlBalance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlBalance) UnmarshalBinary(b []byte) error { + var res GlBalance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/gl_balance_response.go b/api/sf-gate/sf_gate_models/gl_balance_response.go new file mode 100644 index 0000000..6b37d66 --- /dev/null +++ b/api/sf-gate/sf_gate_models/gl_balance_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlBalanceResponse gl balance response +// +// swagger:model GlBalanceResponse +type GlBalanceResponse struct { + + // data + Data []*GlBalance `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this gl balance response +func (m *GlBalanceResponse) 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 *GlBalanceResponse) 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 *GlBalanceResponse) 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 +} + +// MarshalBinary interface implementation +func (m *GlBalanceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlBalanceResponse) UnmarshalBinary(b []byte) error { + var res GlBalanceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/ids.go b/api/sf-gate/sf_gate_models/ids.go new file mode 100644 index 0000000..dc25dc4 --- /dev/null +++ b/api/sf-gate/sf_gate_models/ids.go @@ -0,0 +1,24 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" +) + +// Ids Taxnexus Record Ids +// +// swagger:model Ids +type Ids []string + +// Validate validates this ids +func (m Ids) Validate(formats strfmt.Registry) error { + return nil +} diff --git a/api/sf-gate/sf_gate_models/ids_request.go b/api/sf-gate/sf_gate_models/ids_request.go new file mode 100644 index 0000000..2c5f235 --- /dev/null +++ b/api/sf-gate/sf_gate_models/ids_request.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IdsRequest ids request +// +// swagger:model IdsRequest +type IdsRequest struct { + + // data + Data []Ids `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this ids request +func (m *IdsRequest) 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 *IdsRequest) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + + 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 *IdsRequest) 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 +} + +// MarshalBinary interface implementation +func (m *IdsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IdsRequest) UnmarshalBinary(b []byte) error { + var res IdsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/ingest.go b/api/sf-gate/sf_gate_models/ingest.go new file mode 100644 index 0000000..f1f50a0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/ingest.go @@ -0,0 +1,449 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "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 Taxnexus +// +// 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"` + + // Taxnexus 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"` + + // formatted + Formatted *IngestFormatted `json:"formatted,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"` + + // Taxnexus User ID + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // License + Metrclicense string `json:"metrclicense,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"` + + // Parent Foreign Key + Parentfk string `json:"parentfk,omitempty"` + + // Period ID + Periodid string `json:"periodid,omitempty"` + + // PO Count + Pocount int64 `json:"pocount,omitempty"` + + // Post Failure Reason + Postfailurereason string `json:"postfailurereason,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 + 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"` + + // Tax Transaction Count + Taxtransactioncount int64 `json:"taxtransactioncount,omitempty"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // tenant identifier + 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.validateFormatted(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.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 +} + +func (m *Ingest) validateFormatted(formats strfmt.Registry) error { + + if swag.IsZero(m.Formatted) { // not required + return nil + } + + if m.Formatted != nil { + if err := m.Formatted.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("formatted") + } + 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" + + // IngestIngesttypeTaxnexusAPI captures enum value "taxnexus-api" + IngestIngesttypeTaxnexusAPI 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" + + // IngestObjecttypeCashReceipt captures enum value "cash-receipt" + IngestObjecttypeCashReceipt 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 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 +} + +// 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 +} + +// IngestFormatted Numeric and Date Values Pre-formatted as Text +// +// swagger:model IngestFormatted +type IngestFormatted struct { + + // amount + Amount string `json:"amount,omitempty"` + + // ingestdate + Ingestdate string `json:"ingestdate,omitempty"` + + // invoicecount + Invoicecount string `json:"invoicecount,omitempty"` + + // pocount + Pocount string `json:"pocount,omitempty"` + + // revenuebase + Revenuebase string `json:"revenuebase,omitempty"` + + // revenuenottaxable + Revenuenottaxable string `json:"revenuenottaxable,omitempty"` + + // unitbase + Unitbase string `json:"unitbase,omitempty"` +} + +// Validate validates this ingest formatted +func (m *IngestFormatted) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *IngestFormatted) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IngestFormatted) UnmarshalBinary(b []byte) error { + var res IngestFormatted + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/ingest_request.go b/api/sf-gate/sf_gate_models/ingest_request.go new file mode 100644 index 0000000..b704e3d --- /dev/null +++ b/api/sf-gate/sf_gate_models/ingest_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IngestRequest ingest request +// +// swagger:model IngestRequest +type IngestRequest struct { + + // data + // Required: true + Data []*Ingest `json:"data"` + + // meta + // Required: true + Meta *RequestMeta `json:"meta"` +} + +// 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 err := m.validateMeta(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 err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + 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 *IngestRequest) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + 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 +} + +// 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/sf-gate/sf_gate_models/ingest_response.go b/api/sf-gate/sf_gate_models/ingest_response.go new file mode 100644 index 0000000..4ec61f4 --- /dev/null +++ b/api/sf-gate/sf_gate_models/ingest_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/invalid_error.go b/api/sf-gate/sf_gate_models/invalid_error.go new file mode 100644 index 0000000..0356940 --- /dev/null +++ b/api/sf-gate/sf_gate_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/sf-gate/sf_gate_models/invoice.go b/api/sf-gate/sf_gate_models/invoice.go new file mode 100644 index 0000000..d5f5486 --- /dev/null +++ b/api/sf-gate/sf_gate_models/invoice.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Invoice invoice +// +// swagger:model Invoice +type Invoice struct { + + // Account Balance + Accountbalance float64 `json:"accountbalance,omitempty"` + + // Account + Accountid string `json:"accountid,omitempty"` + + // Account Name + Accountname string `json:"accountname,omitempty"` + + // Advance? + Advance bool `json:"advance,omitempty"` + + // Invoice Amount + Amount float64 `json:"amount,omitempty"` + + // Amount Adjustment + AmountAdjustment float64 `json:"amount_adjustment,omitempty"` + + // Amount Due + Amountdue float64 `json:"amountdue,omitempty"` + + // Amount Paid + Amountpaid float64 `json:"amountpaid,omitempty"` + + // Audit Trail Message + Auditmessage string `json:"auditmessage,omitempty"` + + // Billing City + Billingcity string `json:"billingcity,omitempty"` + + // Billing Country + Billingcountry string `json:"billingcountry,omitempty"` + + // Billing Postal Code + Billingpostalcode string `json:"billingpostalcode,omitempty"` + + // Billing Run + Billingrunid string `json:"billingrunid,omitempty"` + + // Billing State + Billingstate string `json:"billingstate,omitempty"` + + // Billing Street + Billingstreet string `json:"billingstreet,omitempty"` + + // billtocontactid + Billtocontactid string `json:"billtocontactid,omitempty"` + + // Cannabis Tax + Cannabistax float64 `json:"cannabistax,omitempty"` + + // Contract + Contractid string `json:"contractid,omitempty"` + + // coordinate + Coordinate *Address `json:"coordinate,omitempty"` + + // Customer ID + Customerid string `json:"customerid,omitempty"` + + // Date Issued + Dateissued string `json:"dateissued,omitempty"` + + // Days Due + Daysdue float64 `json:"daysdue,omitempty"` + + // Deposit Amount + Depositamount float64 `json:"depositamount,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Discount + Discount float64 `json:"discount,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Invoice Date + Invoicedate string `json:"invoicedate,omitempty"` + + // Invoice Number + Invoicenumber string `json:"invoicenumber,omitempty"` + + // Is International? + Isinternational bool `json:"isinternational,omitempty"` + + // Issued Account Balance + Issuedaccountbalance float64 `json:"issuedaccountbalance,omitempty"` + + // Issued Amount Due + Issuedamountdue float64 `json:"issuedamountdue,omitempty"` + + // Issued By + Issuedbyid string `json:"issuedbyid,omitempty"` + + // Is Valid? + Isvalid bool `json:"isvalid,omitempty"` + + // The items associated with this Invoice + Items []*InvoiceItem `json:"items"` + + // Line Item Count + Lineitemcount int64 `json:"lineitemcount,omitempty"` + + // Minimum Payment Due + Minimumpaymentdue float64 `json:"minimumpaymentdue,omitempty"` + + // Monthly Amount + Monthlyamount float64 `json:"monthlyamount,omitempty"` + + // Opportunity + Opportunityid string `json:"opportunityid,omitempty"` + + // Order + Orderid string `json:"orderid,omitempty"` + + // Overdue0 + Overdue0 float64 `json:"overdue0,omitempty"` + + // Overdue 120 Days Amount + Overdue120 float64 `json:"overdue120,omitempty"` + + // Overdue 30 Days Amount + Overdue30 float64 `json:"overdue30,omitempty"` + + // Overdue 45 Days Amount + Overdue45 float64 `json:"overdue45,omitempty"` + + // Overdue 60 Days Amount + Overdue60 float64 `json:"overdue60,omitempty"` + + // Overdue 90 Days Amount + Overdue90 float64 `json:"overdue90,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Partner Account + Partneraccountid string `json:"partneraccountid,omitempty"` + + // Payment Method + PaymentMethod string `json:"payment_method,omitempty"` + + // Payment Due + Paymentdue string `json:"paymentdue,omitempty"` + + // Payment Method + Paymentmethodid string `json:"paymentmethodid,omitempty"` + + // Payment Terms + Paymentterms string `json:"paymentterms,omitempty"` + + // Period + Periodid string `json:"periodid,omitempty"` + + // Picklist Value + Picklistvalue string `json:"picklistvalue,omitempty"` + + // Posted + Posted bool `json:"posted,omitempty"` + + // Prior Account Balance + Prioraccountbalance float64 `json:"prioraccountbalance,omitempty"` + + // Prior Adjustments + Prioradjustments float64 `json:"prioradjustments,omitempty"` + + // Prior Invoice Amount + Priorinvoiceamount float64 `json:"priorinvoiceamount,omitempty"` + + // Prior Invoice Date + Priorinvoicedate string `json:"priorinvoicedate,omitempty"` + + // Prior Invoice + Priorinvoiceid string `json:"priorinvoiceid,omitempty"` + + // Prior Payment Amount + Priorpaymentamount float64 `json:"priorpaymentamount,omitempty"` + + // Prior Payment Date + Priorpaymentdate string `json:"priorpaymentdate,omitempty"` + + // Prior Payment + Priorpaymentid string `json:"priorpaymentid,omitempty"` + + // Prior Payment Memo + Priorpaymentmemo string `json:"priorpaymentmemo,omitempty"` + + // Prorated? + Prorated bool `json:"prorated,omitempty"` + + // Prorated Days + Prorateddays float64 `json:"prorateddays,omitempty"` + + // Purchase Amount + Purchaseamount float64 `json:"purchaseamount,omitempty"` + + // Quote + Quoteid string `json:"quoteid,omitempty"` + + // Rating Ingest + Ratingingestid string `json:"ratingingestid,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Reference + Reference string `json:"reference,omitempty"` + + // Sales Regulation Type (Medicinal or Recreational) + Salesregulation string `json:"salesregulation,omitempty"` + + // Sales Tax + Salestax float64 `json:"salestax,omitempty"` + + // Scheduled Payment Date + Scheduledpaymentdate string `json:"scheduledpaymentdate,omitempty"` + + // Service Term + ServiceTerm string `json:"service_term,omitempty"` + + // Shipping City + Shippingcity string `json:"shippingcity,omitempty"` + + // Shipping Country + Shippingcountry string `json:"shippingcountry,omitempty"` + + // Shipping & Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Shipping Postal Code + Shippingpostalcode string `json:"shippingpostalcode,omitempty"` + + // Shipping State + Shippingstate string `json:"shippingstate,omitempty"` + + // Shipping Street + Shippingstreet string `json:"shippingstreet,omitempty"` + + // Statement Item Type + Statementitemtype string `json:"statementitemtype,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Suppress Workflow? + Suppressworkflow bool `json:"suppressworkflow,omitempty"` + + // The taxes associated with this Invoice + Taxitems []*TaxTransaction `json:"taxitems"` + + // Telecom Tax + Telecomtax float64 `json:"telecomtax,omitempty"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Type + Type string `json:"type,omitempty"` + + // WHMCS Client ID + Whmcsclientid string `json:"whmcsclientid,omitempty"` + + // WHMCS Invoice ID + Whmcsinvoiceid string `json:"whmcsinvoiceid,omitempty"` + + // Xero Invoice Id + Xeroid string `json:"xeroid,omitempty"` + + // Year + Year int64 `json:"year,omitempty"` +} + +// Validate validates this invoice +func (m *Invoice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCoordinate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxitems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Invoice) validateCoordinate(formats strfmt.Registry) error { + + if swag.IsZero(m.Coordinate) { // not required + return nil + } + + if m.Coordinate != nil { + if err := m.Coordinate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("coordinate") + } + return err + } + } + + return nil +} + +func (m *Invoice) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Invoice) validateTaxitems(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxitems) { // not required + return nil + } + + for i := 0; i < len(m.Taxitems); i++ { + if swag.IsZero(m.Taxitems[i]) { // not required + continue + } + + if m.Taxitems[i] != nil { + if err := m.Taxitems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxitems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Invoice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Invoice) UnmarshalBinary(b []byte) error { + var res Invoice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/invoice_basic.go b/api/sf-gate/sf_gate_models/invoice_basic.go new file mode 100644 index 0000000..024147b --- /dev/null +++ b/api/sf-gate/sf_gate_models/invoice_basic.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InvoiceBasic invoice basic +// +// swagger:model InvoiceBasic +type InvoiceBasic struct { + + // Account Identifier from Source System; ignored in tax calculations + Accountid string `json:"accountid,omitempty"` + + // Invoice Amount; ignored in tax calculation + Amount float64 `json:"amount,omitempty"` + + // Amount Due; ignored in tax calculations + Amountdue float64 `json:"amountdue,omitempty"` + + // coordinate + Coordinate *Address `json:"coordinate,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Invoice Date; should be date only or correct time zone if in time notation + Invoicedate string `json:"invoicedate,omitempty"` + + // Source System Customer-Facing Invoice Number; ignored in tax calculation + Invoicenumber string `json:"invoicenumber,omitempty"` + + // The items associated with this Invoice + Items []*ItemBasic `json:"items"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Sales Regulation Type + Salesregulation string `json:"salesregulation,omitempty"` + + // 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] + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Invoice Type + Type string `json:"type,omitempty"` +} + +// Validate validates this invoice basic +func (m *InvoiceBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCoordinate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(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 *InvoiceBasic) validateCoordinate(formats strfmt.Registry) error { + + if swag.IsZero(m.Coordinate) { // not required + return nil + } + + if m.Coordinate != nil { + if err := m.Coordinate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("coordinate") + } + return err + } + } + + return nil +} + +func (m *InvoiceBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var invoiceBasicTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["closed","delivered","hold","issued","new","posted","rated","rating_failed","rating_ready","reissued","rendered","uncollectable","voided"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + invoiceBasicTypeStatusPropEnum = append(invoiceBasicTypeStatusPropEnum, v) + } +} + +const ( + + // InvoiceBasicStatusClosed captures enum value "closed" + InvoiceBasicStatusClosed string = "closed" + + // InvoiceBasicStatusDelivered captures enum value "delivered" + InvoiceBasicStatusDelivered string = "delivered" + + // InvoiceBasicStatusHold captures enum value "hold" + InvoiceBasicStatusHold string = "hold" + + // InvoiceBasicStatusIssued captures enum value "issued" + InvoiceBasicStatusIssued string = "issued" + + // InvoiceBasicStatusNew captures enum value "new" + InvoiceBasicStatusNew string = "new" + + // InvoiceBasicStatusPosted captures enum value "posted" + InvoiceBasicStatusPosted string = "posted" + + // InvoiceBasicStatusRated captures enum value "rated" + InvoiceBasicStatusRated string = "rated" + + // InvoiceBasicStatusRatingFailed captures enum value "rating_failed" + InvoiceBasicStatusRatingFailed string = "rating_failed" + + // InvoiceBasicStatusRatingReady captures enum value "rating_ready" + InvoiceBasicStatusRatingReady string = "rating_ready" + + // InvoiceBasicStatusReissued captures enum value "reissued" + InvoiceBasicStatusReissued string = "reissued" + + // InvoiceBasicStatusRendered captures enum value "rendered" + InvoiceBasicStatusRendered string = "rendered" + + // InvoiceBasicStatusUncollectable captures enum value "uncollectable" + InvoiceBasicStatusUncollectable string = "uncollectable" + + // InvoiceBasicStatusVoided captures enum value "voided" + InvoiceBasicStatusVoided string = "voided" +) + +// prop value enum +func (m *InvoiceBasic) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, invoiceBasicTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InvoiceBasic) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceBasic) UnmarshalBinary(b []byte) error { + var res InvoiceBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/invoice_item.go b/api/sf-gate/sf_gate_models/invoice_item.go new file mode 100644 index 0000000..a20db96 --- /dev/null +++ b/api/sf-gate/sf_gate_models/invoice_item.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceItem invoice item +// +// swagger:model InvoiceItem +type InvoiceItem struct { + + // Census Tract + CensusTract string `json:"census_tract,omitempty"` + + // Cost of Goods Sold + Cogs float64 `json:"cogs,omitempty"` + + // Contract Number + Contractid string `json:"contractid,omitempty"` + + // County + Countyid string `json:"countyid,omitempty"` + + // Line Item Description + Description string `json:"description,omitempty"` + + // Export Description + Exportdescription string `json:"exportdescription,omitempty"` + + // Family + Family string `json:"family,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Invoice + Invoiceid string `json:"invoiceid,omitempty"` + + // Line + Linenumber int64 `json:"linenumber,omitempty"` + + // List Price + ListPrice float64 `json:"list_price,omitempty"` + + // Location + Locationid string `json:"locationid,omitempty"` + + // Order Item + Orderitemid string `json:"orderitemid,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Period + Periodid string `json:"periodid,omitempty"` + + // Product Code + Productcode string `json:"productcode,omitempty"` + + // Product + Productid string `json:"productid,omitempty"` + + // Quantity + Quantity float64 `json:"quantity,omitempty"` + + // Quote Line Item + Quotelineitemid string `json:"quotelineitemid,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Rejected Quantity + RejectedQuantity float64 `json:"rejected_quantity,omitempty"` + + // Revenue Account + Revenueaccount float64 `json:"revenueaccount,omitempty"` + + // Seq + Seq string `json:"seq,omitempty"` + + // Shipped Quantity + ShippedQuantity float64 `json:"shipped_quantity,omitempty"` + + // Shipping & Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // SKU + Sku string `json:"sku,omitempty"` + + // Subscription + Subscriptionid string `json:"subscriptionid,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Taxnexus Code + Taxnexuscode string `json:"taxnexuscode,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Price + Totalprice float64 `json:"totalprice,omitempty"` + + // Unit Price + Unitprice float64 `json:"unitprice,omitempty"` +} + +// Validate validates this invoice item +func (m *InvoiceItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InvoiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceItem) UnmarshalBinary(b []byte) error { + var res InvoiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/invoice_request.go b/api/sf-gate/sf_gate_models/invoice_request.go new file mode 100644 index 0000000..aace967 --- /dev/null +++ b/api/sf-gate/sf_gate_models/invoice_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceRequest invoice request +// +// swagger:model InvoiceRequest +type InvoiceRequest struct { + + // data + Data []*InvoiceBasic `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this invoice request +func (m *InvoiceRequest) 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 *InvoiceRequest) 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 *InvoiceRequest) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceRequest) UnmarshalBinary(b []byte) error { + var res InvoiceRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/invoice_response.go b/api/sf-gate/sf_gate_models/invoice_response.go new file mode 100644 index 0000000..0b54b4f --- /dev/null +++ b/api/sf-gate/sf_gate_models/invoice_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceResponse invoice response +// +// swagger:model InvoiceResponse +type InvoiceResponse struct { + + // data + Data []*Invoice `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this invoice response +func (m *InvoiceResponse) 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 *InvoiceResponse) 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 *InvoiceResponse) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceResponse) UnmarshalBinary(b []byte) error { + var res InvoiceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/item_basic.go b/api/sf-gate/sf_gate_models/item_basic.go new file mode 100644 index 0000000..4ea3e42 --- /dev/null +++ b/api/sf-gate/sf_gate_models/item_basic.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ItemBasic item basic +// +// swagger:model ItemBasic +type ItemBasic struct { + + // Cost of Goods Sold + Cogs float64 `json:"cogs,omitempty"` + + // Line Item Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Source System Parent Foreign Key to Invoice + Invoiceid string `json:"invoiceid,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Product Code + Productcode string `json:"productcode,omitempty"` + + // Quantity + // Required: true + Quantity *float64 `json:"quantity"` + + // Source System identifier for this record, if any + // Required: true + Ref *string `json:"ref"` + + // Sales Regulation Type + Salesregulation string `json:"salesregulation,omitempty"` + + // Shipping & Handling and Delivery Fees for this Item + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Taxnexus Code + // Required: true + Taxnexuscode *string `json:"taxnexuscode"` + + // Unit Price + // Required: true + Unitprice *float64 `json:"unitprice"` + + // The Unit of Measure for this item + // Enum: [each month day week hour oz_drywt_flower oz_drywt_leaves oz_fresh gm oz lb] + Units string `json:"units,omitempty"` +} + +// Validate validates this item basic +func (m *ItemBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateQuantity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRef(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxnexuscode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnitprice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnits(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ItemBasic) validateQuantity(formats strfmt.Registry) error { + + if err := validate.Required("quantity", "body", m.Quantity); err != nil { + return err + } + + return nil +} + +func (m *ItemBasic) validateRef(formats strfmt.Registry) error { + + if err := validate.Required("ref", "body", m.Ref); err != nil { + return err + } + + return nil +} + +func (m *ItemBasic) validateTaxnexuscode(formats strfmt.Registry) error { + + if err := validate.Required("taxnexuscode", "body", m.Taxnexuscode); err != nil { + return err + } + + return nil +} + +func (m *ItemBasic) validateUnitprice(formats strfmt.Registry) error { + + if err := validate.Required("unitprice", "body", m.Unitprice); err != nil { + return err + } + + return nil +} + +var itemBasicTypeUnitsPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["each","month","day","week","hour","oz_drywt_flower","oz_drywt_leaves","oz_fresh","gm","oz","lb"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + itemBasicTypeUnitsPropEnum = append(itemBasicTypeUnitsPropEnum, v) + } +} + +const ( + + // ItemBasicUnitsEach captures enum value "each" + ItemBasicUnitsEach string = "each" + + // ItemBasicUnitsMonth captures enum value "month" + ItemBasicUnitsMonth string = "month" + + // ItemBasicUnitsDay captures enum value "day" + ItemBasicUnitsDay string = "day" + + // ItemBasicUnitsWeek captures enum value "week" + ItemBasicUnitsWeek string = "week" + + // ItemBasicUnitsHour captures enum value "hour" + ItemBasicUnitsHour string = "hour" + + // ItemBasicUnitsOzDrywtFlower captures enum value "oz_drywt_flower" + ItemBasicUnitsOzDrywtFlower string = "oz_drywt_flower" + + // ItemBasicUnitsOzDrywtLeaves captures enum value "oz_drywt_leaves" + ItemBasicUnitsOzDrywtLeaves string = "oz_drywt_leaves" + + // ItemBasicUnitsOzFresh captures enum value "oz_fresh" + ItemBasicUnitsOzFresh string = "oz_fresh" + + // ItemBasicUnitsGm captures enum value "gm" + ItemBasicUnitsGm string = "gm" + + // ItemBasicUnitsOz captures enum value "oz" + ItemBasicUnitsOz string = "oz" + + // ItemBasicUnitsLb captures enum value "lb" + ItemBasicUnitsLb string = "lb" +) + +// prop value enum +func (m *ItemBasic) validateUnitsEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, itemBasicTypeUnitsPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ItemBasic) validateUnits(formats strfmt.Registry) error { + + if swag.IsZero(m.Units) { // not required + return nil + } + + // value enum + if err := m.validateUnitsEnum("units", "body", m.Units); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ItemBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ItemBasic) UnmarshalBinary(b []byte) error { + var res ItemBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/job.go b/api/sf-gate/sf_gate_models/job.go new file mode 100644 index 0000000..72d1423 --- /dev/null +++ b/api/sf-gate/sf_gate_models/job.go @@ -0,0 +1,617 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "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 { + + // Taxnexus Account Id + Accountid string `json:"accountid,omitempty"` + + // Taxnexus Backend ID + Backendid string `json:"backendid,omitempty"` + + // Taxnexus Company ID + Companyid string `json:"companyid,omitempty"` + + // Taxnexus Coordinate ID + Coordinateid string `json:"coordinateid,omitempty"` + + // Taxnexus 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 + // Enum: [day document hour minute month quarter second week year] + Duration string `json:"duration,omitempty"` + + // End Date/Time + Enddate string `json:"enddate,omitempty"` + + // Error Reason + Errorreason string `json:"errorreason,omitempty"` + + // Taxnexus 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"` + + // month + Month int64 `json:"month,omitempty"` + + // Next Job + Nextjobid string `json:"nextjobid,omitempty"` + + // Object Type + // Enum: [invoice order po quote] + Objecttype string `json:"objecttype,omitempty"` + + // The user ID that owns this job + Ownerid string `json:"ownerid,omitempty"` + + // Any parameters needed to process the job + Parameters string `json:"parameters,omitempty"` + + // Period + Periodid string `json:"periodid,omitempty"` + + // quarter + 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 + // Enum: [newGLPostInvoices newIngestInvoice newIngestPO] + Sagatype string `json:"sagatype,omitempty"` + + // semiannual + 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"` + + // Type + // Enum: [coordinate email ingest tax] + Type string `json:"type,omitempty"` + + // year + Year int64 `json:"year,omitempty"` +} + +// Validate validates this job +func (m *Job) Validate(formats strfmt.Registry) error { + var res []error + + 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.validateObjecttype(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 err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + 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 swag.IsZero(m.Duration) { // not required + return nil + } + + // 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 +} + +var jobTypeObjecttypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["invoice","order","po","quote"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeObjecttypePropEnum = append(jobTypeObjecttypePropEnum, v) + } +} + +const ( + + // JobObjecttypeInvoice captures enum value "invoice" + JobObjecttypeInvoice string = "invoice" + + // JobObjecttypeOrder captures enum value "order" + JobObjecttypeOrder string = "order" + + // JobObjecttypePo captures enum value "po" + JobObjecttypePo string = "po" + + // JobObjecttypeQuote captures enum value "quote" + JobObjecttypeQuote string = "quote" +) + +// prop value enum +func (m *Job) validateObjecttypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeObjecttypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateObjecttype(formats strfmt.Registry) error { + + if swag.IsZero(m.Objecttype) { // not required + return nil + } + + // value enum + if err := m.validateObjecttypeEnum("objecttype", "body", m.Objecttype); err != nil { + return err + } + + return nil +} + +var jobTypeSagatypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["newGLPostInvoices","newIngestInvoice","newIngestPO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeSagatypePropEnum = append(jobTypeSagatypePropEnum, v) + } +} + +const ( + + // JobSagatypeNewGLPostInvoices captures enum value "newGLPostInvoices" + JobSagatypeNewGLPostInvoices string = "newGLPostInvoices" + + // JobSagatypeNewIngestInvoice captures enum value "newIngestInvoice" + JobSagatypeNewIngestInvoice string = "newIngestInvoice" + + // JobSagatypeNewIngestPO captures enum value "newIngestPO" + JobSagatypeNewIngestPO string = "newIngestPO" +) + +// prop value enum +func (m *Job) validateSagatypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeSagatypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateSagatype(formats strfmt.Registry) error { + + if swag.IsZero(m.Sagatype) { // not required + return nil + } + + // value enum + if err := m.validateSagatypeEnum("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 +} + +var jobTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["coordinate","email","ingest","tax"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobTypeTypePropEnum = append(jobTypeTypePropEnum, v) + } +} + +const ( + + // JobTypeCoordinate captures enum value "coordinate" + JobTypeCoordinate string = "coordinate" + + // JobTypeEmail captures enum value "email" + JobTypeEmail string = "email" + + // JobTypeIngest captures enum value "ingest" + JobTypeIngest string = "ingest" + + // JobTypeTax captures enum value "tax" + JobTypeTax string = "tax" +) + +// prop value enum +func (m *Job) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Job) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + 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/sf-gate/sf_gate_models/job_request.go b/api/sf-gate/sf_gate_models/job_request.go new file mode 100644 index 0000000..342d5e4 --- /dev/null +++ b/api/sf-gate/sf_gate_models/job_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// JobRequest job request +// +// swagger:model JobRequest +type JobRequest struct { + + // data + // Required: true + Data []*Job `json:"data"` + + // meta + // Required: true + Meta *RequestMeta `json:"meta"` +} + +// 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 err := m.validateMeta(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 err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + 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 *JobRequest) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + 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 +} + +// 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/sf-gate/sf_gate_models/job_response.go b/api/sf-gate/sf_gate_models/job_response.go new file mode 100644 index 0000000..426ee7a --- /dev/null +++ b/api/sf-gate/sf_gate_models/job_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JobResponse An array of Print-Ready ingest 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 +} + +// 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/sf-gate/sf_gate_models/license.go b/api/sf-gate/sf_gate_models/license.go new file mode 100644 index 0000000..212ddac --- /dev/null +++ b/api/sf-gate/sf_gate_models/license.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// License license +// +// swagger:model License +type License struct { + + // accountid + Accountid string `json:"accountid,omitempty"` + + // backendid + Backendid string `json:"backendid,omitempty"` + + // contactid + Contactid string `json:"contactid,omitempty"` + + // createdbyid + Createdbyid string `json:"createdbyid,omitempty"` + + // createddate + Createddate string `json:"createddate,omitempty"` + + // Date + Dateissued string `json:"dateissued,omitempty"` + + // Expiration Date + Expirationdate string `json:"expirationdate,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Is Canceled? + Iscanceled bool `json:"iscanceled,omitempty"` + + // Is Revoked? + Isrevoked bool `json:"isrevoked,omitempty"` + + // lastmodifiedbyid + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // lastmodifieddate + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // License Number + Licensenumber string `json:"licensenumber,omitempty"` + + // License Type Number + Licensetypeid string `json:"licensetypeid,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this license +func (m *License) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *License) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *License) UnmarshalBinary(b []byte) error { + var res License + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/license_request.go b/api/sf-gate/sf_gate_models/license_request.go new file mode 100644 index 0000000..f8eddd7 --- /dev/null +++ b/api/sf-gate/sf_gate_models/license_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseRequest license request +// +// swagger:model LicenseRequest +type LicenseRequest struct { + + // data + Data []*License `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this license request +func (m *LicenseRequest) 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 *LicenseRequest) 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 *LicenseRequest) 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 +} + +// MarshalBinary interface implementation +func (m *LicenseRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseRequest) UnmarshalBinary(b []byte) error { + var res LicenseRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/license_response.go b/api/sf-gate/sf_gate_models/license_response.go new file mode 100644 index 0000000..a59656b --- /dev/null +++ b/api/sf-gate/sf_gate_models/license_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseResponse license response +// +// swagger:model LicenseResponse +type LicenseResponse struct { + + // data + Data []*License `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this license response +func (m *LicenseResponse) 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 *LicenseResponse) 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 *LicenseResponse) 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 +} + +// MarshalBinary interface implementation +func (m *LicenseResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseResponse) UnmarshalBinary(b []byte) error { + var res LicenseResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/license_type.go b/api/sf-gate/sf_gate_models/license_type.go new file mode 100644 index 0000000..e526987 --- /dev/null +++ b/api/sf-gate/sf_gate_models/license_type.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseType license type +// +// swagger:model LicenseType +type LicenseType struct { + + // accountid + Accountid string `json:"accountid,omitempty"` + + // agentid + Agentid string `json:"agentid,omitempty"` + + // contactid + Contactid string `json:"contactid,omitempty"` + + // Cost + Cost float64 `json:"cost,omitempty"` + + // createdbyid + Createdbyid string `json:"createdbyid,omitempty"` + + // createddate + Createddate string `json:"createddate,omitempty"` + + // domainid + Domainid string `json:"domainid,omitempty"` + + // domains + Domains []string `json:"domains"` + + // Frequency + Frequency string `json:"frequency,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // jurisdictions + Jurisdictions []*GeoLicenseTypeInstance `json:"jurisdictions"` + + // lastmodifiedbyid + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // lastmodifieddate + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Level + Level string `json:"level,omitempty"` + + // License Type Name + Name string `json:"name,omitempty"` + + // Picklist Value + Picklistvalue string `json:"picklistvalue,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Restriction + Restriction string `json:"restriction,omitempty"` + + // Tier + Tier string `json:"tier,omitempty"` +} + +// Validate validates this license type +func (m *LicenseType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateJurisdictions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LicenseType) validateJurisdictions(formats strfmt.Registry) error { + + if swag.IsZero(m.Jurisdictions) { // not required + return nil + } + + for i := 0; i < len(m.Jurisdictions); i++ { + if swag.IsZero(m.Jurisdictions[i]) { // not required + continue + } + + if m.Jurisdictions[i] != nil { + if err := m.Jurisdictions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jurisdictions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LicenseType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseType) UnmarshalBinary(b []byte) error { + var res LicenseType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/license_type_response.go b/api/sf-gate/sf_gate_models/license_type_response.go new file mode 100644 index 0000000..283fa98 --- /dev/null +++ b/api/sf-gate/sf_gate_models/license_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseTypeResponse license type response +// +// swagger:model LicenseTypeResponse +type LicenseTypeResponse struct { + + // data + Data []*LicenseType `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this license type response +func (m *LicenseTypeResponse) 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 *LicenseTypeResponse) 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 *LicenseTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *LicenseTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseTypeResponse) UnmarshalBinary(b []byte) error { + var res LicenseTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/message.go b/api/sf-gate/sf_gate_models/message.go new file mode 100644 index 0000000..e6d854f --- /dev/null +++ b/api/sf-gate/sf_gate_models/message.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/sf-gate/sf_gate_models/notebook.go b/api/sf-gate/sf_gate_models/notebook.go new file mode 100644 index 0000000..0699bc8 --- /dev/null +++ b/api/sf-gate/sf_gate_models/notebook.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Notebook Defines a Taxnexus Notebook +// +// swagger:model Notebook +type Notebook 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"` + + // Analysis Date + Date string `json:"date,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"` + + // items + Items []*NotebookItem `json:"items"` + + // Last Modified By + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modifed Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Ending Period + Periodendid string `json:"periodendid,omitempty"` + + // Starting Period + Periodstartid string `json:"periodstartid,omitempty"` + + // Preparer + Preparerid string `json:"preparerid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Title + Title string `json:"title,omitempty"` +} + +// Validate validates this notebook +func (m *Notebook) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Notebook) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Notebook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Notebook) UnmarshalBinary(b []byte) error { + var res Notebook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/notebook_item.go b/api/sf-gate/sf_gate_models/notebook_item.go new file mode 100644 index 0000000..b3798a0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/notebook_item.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NotebookItem An analysis item associated with a Notebook +// +// swagger:model NotebookItem +type NotebookItem struct { + + // Record Id + ID string `json:"id,omitempty"` + + // Developer name of component + Itemname string `json:"itemname,omitempty"` + + // The notebook that owns this Item + Notebookid string `json:"notebookid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Display title + Title string `json:"title,omitempty"` +} + +// Validate validates this notebook item +func (m *NotebookItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NotebookItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NotebookItem) UnmarshalBinary(b []byte) error { + var res NotebookItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/notebook_request.go b/api/sf-gate/sf_gate_models/notebook_request.go new file mode 100644 index 0000000..f13987b --- /dev/null +++ b/api/sf-gate/sf_gate_models/notebook_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NotebookRequest An array of Notebook objects +// +// swagger:model NotebookRequest +type NotebookRequest struct { + + // data + Data []*Notebook `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this notebook request +func (m *NotebookRequest) 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 *NotebookRequest) 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 *NotebookRequest) 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 +} + +// MarshalBinary interface implementation +func (m *NotebookRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NotebookRequest) UnmarshalBinary(b []byte) error { + var res NotebookRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/notebook_response.go b/api/sf-gate/sf_gate_models/notebook_response.go new file mode 100644 index 0000000..1187def --- /dev/null +++ b/api/sf-gate/sf_gate_models/notebook_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NotebookResponse An array of Notebook objects +// +// swagger:model NotebookResponse +type NotebookResponse struct { + + // data + Data []*Notebook `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this notebook response +func (m *NotebookResponse) 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 *NotebookResponse) 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 *NotebookResponse) 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 +} + +// MarshalBinary interface implementation +func (m *NotebookResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NotebookResponse) UnmarshalBinary(b []byte) error { + var res NotebookResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/order.go b/api/sf-gate/sf_gate_models/order.go new file mode 100644 index 0000000..04a1014 --- /dev/null +++ b/api/sf-gate/sf_gate_models/order.go @@ -0,0 +1,387 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Order order +// +// swagger:model Order +type Order struct { + + // accountid + Accountid string `json:"accountid,omitempty"` + + // Account Number + Accountnumber string `json:"accountnumber,omitempty"` + + // Activated By + Activatedbyid string `json:"activatedbyid,omitempty"` + + // Activated Date + Activateddate string `json:"activateddate,omitempty"` + + // Order Amount + Amount float64 `json:"amount,omitempty"` + + // billingaddress + Billingaddress *Address `json:"billingaddress,omitempty"` + + // billingcontactid + Billingcontactid string `json:"billingcontactid,omitempty"` + + // Billing Type + Billingtype string `json:"billingtype,omitempty"` + + // Bill To Contact + Billtocontactid string `json:"billtocontactid,omitempty"` + + // Cannabis Tax + Cannabistax float64 `json:"cannabistax,omitempty"` + + // Company Authorized By + Companyauthorizedbyid string `json:"companyauthorizedbyid,omitempty"` + + // Company Authorized Date + Companyauthorizeddate string `json:"companyauthorizeddate,omitempty"` + + // Completion Status + Completion string `json:"completion,omitempty"` + + // contract + Contract *ContractBasic `json:"contract,omitempty"` + + // Contract End Date + Contractenddate string `json:"contractenddate,omitempty"` + + // Contract Number + Contractid string `json:"contractid,omitempty"` + + // Contract Name + Contractname string `json:"contractname,omitempty"` + + // coordinate + Coordinate *Address `json:"coordinate,omitempty"` + + // Customer Authorized By + Customerauthorizedbyid string `json:"customerauthorizedbyid,omitempty"` + + // Customer Authorized Date + Customerauthorizeddate string `json:"customerauthorizeddate,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Order Start Date + Effectivedate string `json:"effectivedate,omitempty"` + + // Order End Date + Enddate string `json:"enddate,omitempty"` + + // enduserid + Enduserid string `json:"enduserid,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Installation Date + Installationdate string `json:"installationdate,omitempty"` + + // Invoice + Invoice string `json:"invoice,omitempty"` + + // Reduction Order + Isreductionorder bool `json:"isreductionorder,omitempty"` + + // The Order Items + Items []*OrderItem `json:"items"` + + // Line Item Count + Lineitemcount int64 `json:"lineitemcount,omitempty"` + + // Monthly Amount + Monthlyamount float64 `json:"monthlyamount,omitempty"` + + // Order Name + Name string `json:"name,omitempty"` + + // Open Order? + Open bool `json:"open,omitempty"` + + // Opportunity + Opportunityid string `json:"opportunityid,omitempty"` + + // Order Number + Ordernumber string `json:"ordernumber,omitempty"` + + // Order Reference Number + Orderreferencenumber string `json:"orderreferencenumber,omitempty"` + + // Original Order + Originalorderid string `json:"originalorderid,omitempty"` + + // Order Owner + Ownerid string `json:"ownerid,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Payment Method + Paymentmethodid string `json:"paymentmethodid,omitempty"` + + // Payment Terms + Paymentterms string `json:"paymentterms,omitempty"` + + // PO Date + Podate string `json:"podate,omitempty"` + + // PO Number + Ponumber string `json:"ponumber,omitempty"` + + // Provisioning Status + Provisioningstatus string `json:"provisioningstatus,omitempty"` + + // Purchase Amount + Purchaseamount float64 `json:"purchaseamount,omitempty"` + + // Quote + Quoteid string `json:"quoteid,omitempty"` + + // Order Record Type + Recordtypeid string `json:"recordtypeid,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Sales Regulation Type + Salesregulation string `json:"salesregulation,omitempty"` + + // Sales Tax + Salestax float64 `json:"salestax,omitempty"` + + // Service Term + Serviceterm string `json:"serviceterm,omitempty"` + + // shippingaddress + Shippingaddress *Address `json:"shippingaddress,omitempty"` + + // shippingcontactid + Shippingcontactid string `json:"shippingcontactid,omitempty"` + + // Shipping & Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Ship To Contact + Shiptocontactid string `json:"shiptocontactid,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // The taxes associated with this Order + Taxitems []*TaxTransaction `json:"taxitems"` + + // Telecom Tax + Telecomtax float64 `json:"telecomtax,omitempty"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Order Amount + Totalamount int64 `json:"totalamount,omitempty"` + + // Order Type + Type string `json:"type,omitempty"` +} + +// Validate validates this order +func (m *Order) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBillingaddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContract(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCoordinate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingaddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxitems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) 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 *Order) validateContract(formats strfmt.Registry) error { + + if swag.IsZero(m.Contract) { // not required + return nil + } + + if m.Contract != nil { + if err := m.Contract.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contract") + } + return err + } + } + + return nil +} + +func (m *Order) validateCoordinate(formats strfmt.Registry) error { + + if swag.IsZero(m.Coordinate) { // not required + return nil + } + + if m.Coordinate != nil { + if err := m.Coordinate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("coordinate") + } + return err + } + } + + return nil +} + +func (m *Order) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Order) 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 +} + +func (m *Order) validateTaxitems(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxitems) { // not required + return nil + } + + for i := 0; i < len(m.Taxitems); i++ { + if swag.IsZero(m.Taxitems[i]) { // not required + continue + } + + if m.Taxitems[i] != nil { + if err := m.Taxitems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxitems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Order) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Order) UnmarshalBinary(b []byte) error { + var res Order + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/order_basic.go b/api/sf-gate/sf_gate_models/order_basic.go new file mode 100644 index 0000000..6ff5810 --- /dev/null +++ b/api/sf-gate/sf_gate_models/order_basic.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OrderBasic order basic +// +// swagger:model OrderBasic +type OrderBasic struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Order Amount + Amount float64 `json:"amount,omitempty"` + + // Amount Due + Amountdue float64 `json:"amountdue,omitempty"` + + // coordinate + Coordinate *Address `json:"coordinate,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // items + Items *ItemBasic `json:"items,omitempty"` + + // Order Date + Orderdate string `json:"orderdate,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Sales Regulation Type (Medicinal or Recreational) + Salesregulation string `json:"salesregulation,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Type + Type string `json:"type,omitempty"` +} + +// Validate validates this order basic +func (m *OrderBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCoordinate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OrderBasic) validateCoordinate(formats strfmt.Registry) error { + + if swag.IsZero(m.Coordinate) { // not required + return nil + } + + if m.Coordinate != nil { + if err := m.Coordinate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("coordinate") + } + return err + } + } + + return nil +} + +func (m *OrderBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + if m.Items != nil { + if err := m.Items.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OrderBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderBasic) UnmarshalBinary(b []byte) error { + var res OrderBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/order_basic_request.go b/api/sf-gate/sf_gate_models/order_basic_request.go new file mode 100644 index 0000000..18f0117 --- /dev/null +++ b/api/sf-gate/sf_gate_models/order_basic_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OrderBasicRequest order basic request +// +// swagger:model OrderBasicRequest +type OrderBasicRequest struct { + + // data + Data []*OrderBasic `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this order basic request +func (m *OrderBasicRequest) 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 *OrderBasicRequest) 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 *OrderBasicRequest) 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 +} + +// MarshalBinary interface implementation +func (m *OrderBasicRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderBasicRequest) UnmarshalBinary(b []byte) error { + var res OrderBasicRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/order_item.go b/api/sf-gate/sf_gate_models/order_item.go new file mode 100644 index 0000000..4bcc788 --- /dev/null +++ b/api/sf-gate/sf_gate_models/order_item.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OrderItem order item +// +// swagger:model OrderItem +type OrderItem struct { + + // Account + Account interface{} `json:"account,omitempty"` + + // Activated? + Activated bool `json:"activated,omitempty"` + + // Activated By + Activatedby string `json:"activatedby,omitempty"` + + // Available Quantity + Availablequantity float64 `json:"availablequantity,omitempty"` + + // Contract Number + Contractid string `json:"contractid,omitempty"` + + // Create Reservation? + Createreservation bool `json:"createreservation,omitempty"` + + // Date Delivered + Datedelivered string `json:"datedelivered,omitempty"` + + // Date Ordered + Dateordered string `json:"dateordered,omitempty"` + + // Date Promised + Datepromised string `json:"datepromised,omitempty"` + + // Line Description + Description string `json:"description,omitempty"` + + // Discount + Discount float64 `json:"discount,omitempty"` + + // End Date + Enddate string `json:"enddate,omitempty"` + + // Family + Family string `json:"family,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Inventory Tracking + Inventorytracking bool `json:"inventorytracking,omitempty"` + + // Invoice Item + Invoiceitemid string `json:"invoiceitemid,omitempty"` + + // Line Gross Amount + Linegrossamount float64 `json:"linegrossamount,omitempty"` + + // Line Item Number + Lineitemnumber int64 `json:"lineitemnumber,omitempty"` + + // List Price + Listprice float64 `json:"listprice,omitempty"` + + // Location + Locationid string `json:"locationid,omitempty"` + + // Order + Orderid string `json:"orderid,omitempty"` + + // Order Product Number + Orderitemnumber string `json:"orderitemnumber,omitempty"` + + // Original Order Product + Originalorderitemid string `json:"originalorderitemid,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Posted? + Posted bool `json:"posted,omitempty"` + + // Product + Product2id string `json:"product2id,omitempty"` + + // ProductId + Productid string `json:"productid,omitempty"` + + // Product Name + Productname string `json:"productname,omitempty"` + + // Quantity + Quantity float64 `json:"quantity,omitempty"` + + // Quantity On Hand + Quantityonhand float64 `json:"quantityonhand,omitempty"` + + // Quote Line Item + Quotelineitemid string `json:"quotelineitemid,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Start Date + Servicedate string `json:"servicedate,omitempty"` + + // Shipping & Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subscription + Subscriptionid string `json:"subscriptionid,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Taxnexus Code + Taxnexuscodeid string `json:"taxnexuscodeid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Price + Totalprice float64 `json:"totalprice,omitempty"` + + // Unit Price + Unitprice float64 `json:"unitprice,omitempty"` +} + +// Validate validates this order item +func (m *OrderItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OrderItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderItem) UnmarshalBinary(b []byte) error { + var res OrderItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/order_response.go b/api/sf-gate/sf_gate_models/order_response.go new file mode 100644 index 0000000..5d32b5e --- /dev/null +++ b/api/sf-gate/sf_gate_models/order_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OrderResponse An array of Order Objects +// +// swagger:model OrderResponse +type OrderResponse struct { + + // data + Data []*Order `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this order response +func (m *OrderResponse) 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 *OrderResponse) 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 *OrderResponse) 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 +} + +// MarshalBinary interface implementation +func (m *OrderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderResponse) UnmarshalBinary(b []byte) error { + var res OrderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/pagination.go b/api/sf-gate/sf_gate_models/pagination.go new file mode 100644 index 0000000..7ce3bf9 --- /dev/null +++ b/api/sf-gate/sf_gate_models/pagination.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // next link + NextLink string `json:"NextLink,omitempty"` + + // p limit + PLimit int64 `json:"PLimit,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 +} + +// 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/sf-gate/sf_gate_models/period.go b/api/sf-gate/sf_gate_models/period.go new file mode 100644 index 0000000..836034d --- /dev/null +++ b/api/sf-gate/sf_gate_models/period.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Period period +// +// swagger:model Period +type Period struct { + + // Account that owns this Period + Accountid string `json:"accountid,omitempty"` + + // Company + Companyid string `json:"companyid,omitempty"` + + // Days + Days int64 `json:"days,omitempty"` + + // End Date + Enddate string `json:"enddate,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Month number + Month int64 `json:"month,omitempty"` + + // Period Name + Name string `json:"name,omitempty"` + + // Quarter number + Quarter int64 `json:"quarter,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Semiannual number + Semiannual int64 `json:"semiannual,omitempty"` + + // Start Date + Startdate string `json:"startdate,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Year number + Year int64 `json:"year,omitempty"` +} + +// Validate validates this period +func (m *Period) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Period) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Period) UnmarshalBinary(b []byte) error { + var res Period + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/period_request.go b/api/sf-gate/sf_gate_models/period_request.go new file mode 100644 index 0000000..fc5309c --- /dev/null +++ b/api/sf-gate/sf_gate_models/period_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PeriodRequest period request +// +// swagger:model PeriodRequest +type PeriodRequest struct { + + // data + Data []*Period `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this period request +func (m *PeriodRequest) 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 *PeriodRequest) 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 *PeriodRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PeriodRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeriodRequest) UnmarshalBinary(b []byte) error { + var res PeriodRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/period_response.go b/api/sf-gate/sf_gate_models/period_response.go new file mode 100644 index 0000000..7c32690 --- /dev/null +++ b/api/sf-gate/sf_gate_models/period_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PeriodResponse An array of Period objects +// +// swagger:model PeriodResponse +type PeriodResponse struct { + + // data + Data []*Period `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this period response +func (m *PeriodResponse) 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 *PeriodResponse) 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 *PeriodResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PeriodResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeriodResponse) UnmarshalBinary(b []byte) error { + var res PeriodResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/place.go b/api/sf-gate/sf_gate_models/place.go new file mode 100644 index 0000000..8fe629f --- /dev/null +++ b/api/sf-gate/sf_gate_models/place.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Place place +// +// swagger:model Place +type Place struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Account Validation + Accountvalidation string `json:"accountvalidation,omitempty"` + + // Rollup Amount + Amount float64 `json:"amount,omitempty"` + + // AreaDescription + Areadescription string `json:"areadescription,omitempty"` + + // Contact + Contactid string `json:"contactid,omitempty"` + + // Taxnexus ID of the Country this places is in + Countryid string `json:"countryid,omitempty"` + + // County + Countyid string `json:"countyid,omitempty"` + + // Enrollment Status + Enrollmentstatus string `json:"enrollmentstatus,omitempty"` + + // FIPS + Fips string `json:"fips,omitempty"` + + // FIPS Class + Fipsclass string `json:"fipsclass,omitempty"` + + // Functional Status + Functionalstatus string `json:"functionalstatus,omitempty"` + + // Geocode + Geocode string `json:"geocode,omitempty"` + + // GNIS + Gnis int64 `json:"gnis,omitempty"` + + // True if this Place has District Sales taxes + Hasdistricttaxes bool `json:"hasdistricttaxes,omitempty"` + + // Salesforce Record Id + ID string `json:"id,omitempty"` + + // Interest + Interest float64 `json:"interest,omitempty"` + + // Land Area + Landarea int64 `json:"landarea,omitempty"` + + // latitude + Latitude float64 `json:"latitude,omitempty"` + + // Legal Name + Legalname string `json:"legalname,omitempty"` + + // longitude + Longitude float64 `json:"longitude,omitempty"` + + // Place Name + Name string `json:"name,omitempty"` + + // Penalty + Penalty float64 `json:"penalty,omitempty"` + + // Polygon Centroid + Polygoncentroid interface{} `json:"polygoncentroid,omitempty"` + + // External reference if any + Ref string `json:"ref,omitempty"` + + // Reported Adjustments + Reportedadjustments float64 `json:"reportedadjustments,omitempty"` + + // Reported Deductions + Reporteddeductions float64 `json:"reporteddeductions,omitempty"` + + // Reported Net Revenue + Reportednetrevenue float64 `json:"reportednetrevenue,omitempty"` + + // Reported Rate + Reportedrate float64 `json:"reportedrate,omitempty"` + + // Reported Revenue + Reportedrevenue float64 `json:"reportedrevenue,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"` + + // State + Stateid string `json:"stateid,omitempty"` + + // Document Status + Status string `json:"status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"subtotal,omitempty"` + + // taxinstances + Taxinstances []*TaxInstance `json:"taxinstances"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // Total Amount + Totalamount float64 `json:"totalamount,omitempty"` + + // Total Area + Totalarea int64 `json:"totalarea,omitempty"` + + // Unit Base + Unitbase float64 `json:"unitbase,omitempty"` + + // Water Area + Waterarea int64 `json:"waterarea,omitempty"` +} + +// Validate validates this place +func (m *Place) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxinstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Place) validateTaxinstances(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxinstances) { // not required + return nil + } + + for i := 0; i < len(m.Taxinstances); i++ { + if swag.IsZero(m.Taxinstances[i]) { // not required + continue + } + + if m.Taxinstances[i] != nil { + if err := m.Taxinstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxinstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Place) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Place) UnmarshalBinary(b []byte) error { + var res Place + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/place_response.go b/api/sf-gate/sf_gate_models/place_response.go new file mode 100644 index 0000000..14c1167 --- /dev/null +++ b/api/sf-gate/sf_gate_models/place_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PlaceResponse place response +// +// swagger:model PlaceResponse +type PlaceResponse struct { + + // data + Data []*Place `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this place response +func (m *PlaceResponse) 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 *PlaceResponse) 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 *PlaceResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PlaceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PlaceResponse) UnmarshalBinary(b []byte) error { + var res PlaceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/pricebook.go b/api/sf-gate/sf_gate_models/pricebook.go new file mode 100644 index 0000000..5ba08ed --- /dev/null +++ b/api/sf-gate/sf_gate_models/pricebook.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pricebook pricebook +// +// swagger:model Pricebook +type Pricebook struct { + + // Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Active + Isactive bool `json:"isactive,omitempty"` + + // Is Standard Price Book + Isstandard bool `json:"isstandard,omitempty"` + + // Price Book Name + Name string `json:"name,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this pricebook +func (m *Pricebook) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Pricebook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Pricebook) UnmarshalBinary(b []byte) error { + var res Pricebook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/pricebook_entry.go b/api/sf-gate/sf_gate_models/pricebook_entry.go new file mode 100644 index 0000000..55bf418 --- /dev/null +++ b/api/sf-gate/sf_gate_models/pricebook_entry.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PricebookEntry pricebook entry +// +// swagger:model PricebookEntry +type PricebookEntry struct { + + // Active + Accountid string `json:"accountid,omitempty"` + + // Created By + Agentid string `json:"agentid,omitempty"` + + // Record Id + ID string `json:"id,omitempty"` + + // pricebook + Pricebook *Pricebook `json:"pricebook,omitempty"` + + // procuct + Procuct *Product `json:"procuct,omitempty"` + + // Product Code + Productcode string `json:"productcode,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // List Price + Unitprice float64 `json:"unitprice,omitempty"` + + // Use Standard Price + Usestandardprice bool `json:"usestandardprice,omitempty"` +} + +// Validate validates this pricebook entry +func (m *PricebookEntry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePricebook(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProcuct(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PricebookEntry) validatePricebook(formats strfmt.Registry) error { + + if swag.IsZero(m.Pricebook) { // not required + return nil + } + + if m.Pricebook != nil { + if err := m.Pricebook.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pricebook") + } + return err + } + } + + return nil +} + +func (m *PricebookEntry) validateProcuct(formats strfmt.Registry) error { + + if swag.IsZero(m.Procuct) { // not required + return nil + } + + if m.Procuct != nil { + if err := m.Procuct.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("procuct") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PricebookEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PricebookEntry) UnmarshalBinary(b []byte) error { + var res PricebookEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/product.go b/api/sf-gate/sf_gate_models/product.go new file mode 100644 index 0000000..ab7e18e --- /dev/null +++ b/api/sf-gate/sf_gate_models/product.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Product product +// +// swagger:model Product +type Product struct { + + // The ID of the Account that owns this product + AccountID string `json:"AccountID,omitempty"` + + // Agency Type + AgencyType string `json:"AgencyType,omitempty"` + + // Asset Tracking? + AssetTracking bool `json:"AssetTracking,omitempty"` + + // ID of who created this record instance + CreatedByID string `json:"CreatedByID,omitempty"` + + // Date of record creation + CreatedDate string `json:"CreatedDate,omitempty"` + + // Product Description + Description string `json:"Description,omitempty"` + + // DescriptionSKU + DescriptionSKU string `json:"DescriptionSKU,omitempty"` + + // Display URL + DisplayURL string `json:"DisplayURL,omitempty"` + + // Product Family + Family string `json:"Family,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Image (500) + Image500 string `json:"Image500,omitempty"` + + // Image (Full) + ImageFull string `json:"ImageFull,omitempty"` + + // Inventory Tracking? + InventoryTracking bool `json:"InventoryTracking,omitempty"` + + // Active + IsActive bool `json:"IsActive,omitempty"` + + // isGeneric + IsGeneric bool `json:"IsGeneric,omitempty"` + + // Last Modified Date + LastModfiedDate string `json:"LastModfiedDate,omitempty"` + + // Last modified by ID + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // MRC Interval + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // MSRP + MSRP float64 `json:"MSRP,omitempty"` + + // Manufacturer + Manufacturer string `json:"Manufacturer,omitempty"` + + // Manufacturer Product Code + ManufacturerProductCode string `json:"ManufacturerProductCode,omitempty"` + + // Product Name + Name string `json:"Name,omitempty"` + + // Product Code + ProductCode string `json:"ProductCode,omitempty"` + + // Prorateable? + Prorateable bool `json:"Prorateable,omitempty"` + + // Publish? + Publish bool `json:"Publish,omitempty"` + + // Publish UPC + PublishUPC string `json:"PublishUPC,omitempty"` + + // Quantity Unit Of Measure + QuantityUnitOfMeasure string `json:"QuantityUnitOfMeasure,omitempty"` + + // Refundable? + Refundable bool `json:"Refundable,omitempty"` + + // SKU + SKU string `json:"SKU,omitempty"` + + // Shipping Weight + ShippingWeight float64 `json:"ShippingWeight,omitempty"` + + // Specifications + Specifications string `json:"Specifications,omitempty"` + + // Taxnexus Code Name + TaxnexusCode string `json:"TaxnexusCode,omitempty"` + + // Taxnexus Code + TaxnexusCodeID string `json:"TaxnexusCodeID,omitempty"` + + // tenant identifier + TenantID string `json:"TenantID,omitempty"` + + // Units + Units string `json:"Units,omitempty"` + + // Vendor + VendorID string `json:"VendorID,omitempty"` + + // Vendor Name + VendorName string `json:"VendorName,omitempty"` + + // Vendor Part Number + VendorPartNumber string `json:"VendorPartNumber,omitempty"` + + // Vendor Price + VendorPrice float64 `json:"VendorPrice,omitempty"` +} + +// Validate validates this product +func (m *Product) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Product) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Product) UnmarshalBinary(b []byte) error { + var res Product + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/product_request.go b/api/sf-gate/sf_gate_models/product_request.go new file mode 100644 index 0000000..8d7e2f8 --- /dev/null +++ b/api/sf-gate/sf_gate_models/product_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductRequest product request +// +// swagger:model ProductRequest +type ProductRequest struct { + + // data + Data []*Product `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this product request +func (m *ProductRequest) 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 *ProductRequest) 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 *ProductRequest) 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 +} + +// MarshalBinary interface implementation +func (m *ProductRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductRequest) UnmarshalBinary(b []byte) error { + var res ProductRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/product_response.go b/api/sf-gate/sf_gate_models/product_response.go new file mode 100644 index 0000000..0e75cc6 --- /dev/null +++ b/api/sf-gate/sf_gate_models/product_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProductResponse product response +// +// swagger:model ProductResponse +type ProductResponse struct { + + // data + Data []*Product `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this product response +func (m *ProductResponse) 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 *ProductResponse) 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 *ProductResponse) 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 +} + +// MarshalBinary interface implementation +func (m *ProductResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProductResponse) UnmarshalBinary(b []byte) error { + var res ProductResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/purchase_order.go b/api/sf-gate/sf_gate_models/purchase_order.go new file mode 100644 index 0000000..8dd5e74 --- /dev/null +++ b/api/sf-gate/sf_gate_models/purchase_order.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrder purchase order +// +// swagger:model PurchaseOrder +type PurchaseOrder struct { + + // accountid + Accountid string `json:"accountid,omitempty"` + + // creditcardid + Creditcardid string `json:"creditcardid,omitempty"` + + // Date Expires + DateExpires string `json:"date_expires,omitempty"` + + // Date Promised + DatePromised string `json:"date_promised,omitempty"` + + // Date Requested + DateRequested string `json:"date_requested,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Due Date + Duedate string `json:"duedate,omitempty"` + + // enduserid + Enduserid string `json:"enduserid,omitempty"` + + // Grand Total + GrandTotal float64 `json:"grand_total,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // items + Items []*PurchaseOrderItem `json:"items"` + + // Line Item Count + Lineitemcount int64 `json:"lineitemcount,omitempty"` + + // Opportunity Name + Opportunityid string `json:"opportunityid,omitempty"` + + // Order Number + Orderid string `json:"orderid,omitempty"` + + // The record identifier from the source system + Parentfk string `json:"parentfk,omitempty"` + + // Payment Terms + Paymentterms string `json:"paymentterms,omitempty"` + + // Date + Podate string `json:"podate,omitempty"` + + // Number + Ponumber string `json:"ponumber,omitempty"` + + // Posted + Posted bool `json:"posted,omitempty"` + + // Quote Name + Quoteid string `json:"quoteid,omitempty"` + + // Addl Tax + SalesTax float64 `json:"sales_tax,omitempty"` + + // Sales Regulation Type (Medicinal or Recreational) + Salesregulation string `json:"salesregulation,omitempty"` + + // Service Term + ServiceTerm string `json:"service_term,omitempty"` + + // Ship Date + ShipDate string `json:"ship_date,omitempty"` + + // Shipping Country + ShippingCountry string `json:"shipping_country,omitempty"` + + // Shipping Special Instructions + ShippingSpecialInstructions string `json:"shipping_special_instructions,omitempty"` + + // Shipping Address + Shippingaddress string `json:"shippingaddress,omitempty"` + + // Shipping City + Shippingcity string `json:"shippingcity,omitempty"` + + // shippingcontactid + Shippingcontactid string `json:"shippingcontactid,omitempty"` + + // Shipping & Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Shipping Postal Code + Shippingpostalcode string `json:"shippingpostalcode,omitempty"` + + // Shipping State + Shippingstate string `json:"shippingstate,omitempty"` + + // Shipping Street + Shippingstreet string `json:"shippingstreet,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Taxable? + Taxable string `json:"taxable,omitempty"` + + // The taxes associated with this Purchase Order + Taxitems []*TaxTransaction `json:"taxitems"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Price + Totalprice float64 `json:"totalprice,omitempty"` + + // Type + Type string `json:"type,omitempty"` + + // vendorid + Vendorid string `json:"vendorid,omitempty"` + + // Vendor Quote Number + Vendorquotenumber string `json:"vendorquotenumber,omitempty"` +} + +// Validate validates this purchase order +func (m *PurchaseOrder) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxitems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrder) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PurchaseOrder) validateTaxitems(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxitems) { // not required + return nil + } + + for i := 0; i < len(m.Taxitems); i++ { + if swag.IsZero(m.Taxitems[i]) { // not required + continue + } + + if m.Taxitems[i] != nil { + if err := m.Taxitems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxitems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrder) UnmarshalBinary(b []byte) error { + var res PurchaseOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/purchase_order_basic.go b/api/sf-gate/sf_gate_models/purchase_order_basic.go new file mode 100644 index 0000000..ea99570 --- /dev/null +++ b/api/sf-gate/sf_gate_models/purchase_order_basic.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderBasic purchase order basic +// +// swagger:model PurchaseOrderBasic +type PurchaseOrderBasic struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Purchase Order Amount + Amount float64 `json:"amount,omitempty"` + + // Amount Due + Amountdue float64 `json:"amountdue,omitempty"` + + // coordinate + Coordinate *Address `json:"coordinate,omitempty"` + + // Order Id + ID string `json:"id,omitempty"` + + // items + Items []*ItemBasic `json:"items"` + + // Purcahse Order Date + Podate string `json:"podate,omitempty"` + + // Purchase Order Number + Ponumber string `json:"ponumber,omitempty"` + + // Sales Regulation Type (Medicinal or Recreational) + Salesregulation string `json:"salesregulation,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Type + Type string `json:"type,omitempty"` +} + +// Validate validates this purchase order basic +func (m *PurchaseOrderBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCoordinate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderBasic) validateCoordinate(formats strfmt.Registry) error { + + if swag.IsZero(m.Coordinate) { // not required + return nil + } + + if m.Coordinate != nil { + if err := m.Coordinate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("coordinate") + } + return err + } + } + + return nil +} + +func (m *PurchaseOrderBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderBasic) UnmarshalBinary(b []byte) error { + var res PurchaseOrderBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/purchase_order_item.go b/api/sf-gate/sf_gate_models/purchase_order_item.go new file mode 100644 index 0000000..a270459 --- /dev/null +++ b/api/sf-gate/sf_gate_models/purchase_order_item.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderItem purchase order item +// +// swagger:model PurchaseOrderItem +type PurchaseOrderItem struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Line Item Description + Description string `json:"description,omitempty"` + + // Due Date + DueDate string `json:"due_date,omitempty"` + + // End User + Enduserid string `json:"enduserid,omitempty"` + + // Record Id + ID string `json:"id,omitempty"` + + // Line + Linenumber int64 `json:"linenumber,omitempty"` + + // Location + Locationid string `json:"locationid,omitempty"` + + // Order Item + Orderitemid string `json:"orderitemid,omitempty"` + + // The record identifier of the parent record from the source system + Parentfk string `json:"parentfk,omitempty"` + + // Partner Account + Partneraccountid string `json:"partneraccountid,omitempty"` + + // Posted + Posted bool `json:"posted,omitempty"` + + // PricebookEntryID + Pricebookentryid string `json:"pricebookentryid,omitempty"` + + // Product + Product interface{} `json:"product,omitempty"` + + // Product Code + Productcode string `json:"productcode,omitempty"` + + // Purchase Order + Purchaseorderid string `json:"purchaseorderid,omitempty"` + + // Quantity + Quantity float64 `json:"quantity,omitempty"` + + // Quote Item + Quotelineitemid string `json:"quotelineitemid,omitempty"` + + // Received Qty + ReceivedQty float64 `json:"received_qty,omitempty"` + + // Rejected Qty + RejectedQty float64 `json:"rejected_qty,omitempty"` + + // Record ID Name + Seq string `json:"seq,omitempty"` + + // Shipment Item + Shipmentitmeid string `json:"shipmentitmeid,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Stocked Qty + StockedQty float64 `json:"stocked_qty,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Taxable? + Taxable string `json:"taxable,omitempty"` + + // Taxnexus Code + Taxnexuscode string `json:"taxnexuscode,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Price + Totalprice float64 `json:"totalprice,omitempty"` + + // Unit Price + Unitprice float64 `json:"unitprice,omitempty"` +} + +// Validate validates this purchase order item +func (m *PurchaseOrderItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderItem) UnmarshalBinary(b []byte) error { + var res PurchaseOrderItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/purchase_order_request.go b/api/sf-gate/sf_gate_models/purchase_order_request.go new file mode 100644 index 0000000..8f541e6 --- /dev/null +++ b/api/sf-gate/sf_gate_models/purchase_order_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderRequest purchase order request +// +// swagger:model PurchaseOrderRequest +type PurchaseOrderRequest struct { + + // data + Data []*PurchaseOrder `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this purchase order request +func (m *PurchaseOrderRequest) 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 *PurchaseOrderRequest) 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 *PurchaseOrderRequest) 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 +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderRequest) UnmarshalBinary(b []byte) error { + var res PurchaseOrderRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/purchase_order_response.go b/api/sf-gate/sf_gate_models/purchase_order_response.go new file mode 100644 index 0000000..ccc03aa --- /dev/null +++ b/api/sf-gate/sf_gate_models/purchase_order_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderResponse An array of Purchase Order Objects +// +// swagger:model PurchaseOrderResponse +type PurchaseOrderResponse struct { + + // data + Data []*PurchaseOrder `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this purchase order response +func (m *PurchaseOrderResponse) 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 *PurchaseOrderResponse) 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 *PurchaseOrderResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderResponse) UnmarshalBinary(b []byte) error { + var res PurchaseOrderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/quote.go b/api/sf-gate/sf_gate_models/quote.go new file mode 100644 index 0000000..c8213fa --- /dev/null +++ b/api/sf-gate/sf_gate_models/quote.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Quote quote +// +// swagger:model Quote +type Quote struct { + + // accountid + Accountid string `json:"accountid,omitempty"` + + // Additional To + Additionaladdress interface{} `json:"additionaladdress,omitempty"` + + // Additional To Name + Additionalname string `json:"additionalname,omitempty"` + + // Bill To + Billingaddress interface{} `json:"billingaddress,omitempty"` + + // billingcontactid + Billingcontactid string `json:"billingcontactid,omitempty"` + + // Bill To Name + Billingname string `json:"billingname,omitempty"` + + // Cannabis Tax + Cannabistax float64 `json:"cannabistax,omitempty"` + + // contactid + Contactid string `json:"contactid,omitempty"` + + // contractid + Contractid string `json:"contractid,omitempty"` + + // coordinateid + Coordinateid string `json:"coordinateid,omitempty"` + + // Credit Terms + Creditterms string `json:"creditterms,omitempty"` + + // Quote Date + Date string `json:"date,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Discount + Discount float64 `json:"discount,omitempty"` + + // Discount Amount + Discountamount float64 `json:"discountamount,omitempty"` + + // Email + Email string `json:"email,omitempty"` + + // enduserid + Enduserid string `json:"enduserid,omitempty"` + + // Expiration Date + Expirationdate string `json:"expirationdate,omitempty"` + + // Fax + Fax string `json:"fax,omitempty"` + + // Grand Total + Grandtotal float64 `json:"grandtotal,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Installation Date + Installationdate string `json:"installationdate,omitempty"` + + // Syncing + Issyncing bool `json:"issyncing,omitempty"` + + // items + Items []*QuoteItem `json:"items"` + + // Line Items + Lineitemcount int64 `json:"lineitemcount,omitempty"` + + // Monthly Amount + Monthlyamount float64 `json:"monthlyamount,omitempty"` + + // Quote Name + Name string `json:"name,omitempty"` + + // Opportunity Name + Opportunityid string `json:"opportunityid,omitempty"` + + // Owner Name + Ownerid string `json:"ownerid,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Payment Terms + Paymentterms string `json:"paymentterms,omitempty"` + + // Phone + Phone string `json:"phone,omitempty"` + + // Purchase Amount + Purchaseamount float64 `json:"purchaseamount,omitempty"` + + // Quote Amount + Quoteamount float64 `json:"quoteamount,omitempty"` + + // Quote Number + Quotenumber string `json:"quotenumber,omitempty"` + + // Quote To + Quotetoaddress interface{} `json:"quotetoaddress,omitempty"` + + // Quote To Name + Quotetoname string `json:"quotetoname,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Sales Regulation Type + Salesregulation string `json:"salesregulation,omitempty"` + + // Service Term + Serviceterm string `json:"serviceterm,omitempty"` + + // Ship To + Shippingaddress interface{} `json:"shippingaddress,omitempty"` + + // Shipping Contact + Shippingcontactid string `json:"shippingcontactid,omitempty"` + + // Shipping and Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Ship To Name + Shippingname string `json:"shippingname,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Suppress Workflow? + Suppressworkflow bool `json:"suppressworkflow,omitempty"` + + // Tax + Tax float64 `json:"tax,omitempty"` + + // The taxes associated with this Quote + Taxitems []*TaxTransaction `json:"taxitems"` + + // Telecom Tax + Telecomtax float64 `json:"telecomtax,omitempty"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Price + Totalprice float64 `json:"totalprice,omitempty"` + + // Quote Type + Type string `json:"type,omitempty"` +} + +// Validate validates this quote +func (m *Quote) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaxitems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Quote) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Quote) validateTaxitems(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxitems) { // not required + return nil + } + + for i := 0; i < len(m.Taxitems); i++ { + if swag.IsZero(m.Taxitems[i]) { // not required + continue + } + + if m.Taxitems[i] != nil { + if err := m.Taxitems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxitems" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Quote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Quote) UnmarshalBinary(b []byte) error { + var res Quote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/quote_basic.go b/api/sf-gate/sf_gate_models/quote_basic.go new file mode 100644 index 0000000..77cc7c0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/quote_basic.go @@ -0,0 +1,145 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QuoteBasic quote basic +// +// swagger:model QuoteBasic +type QuoteBasic struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Quote Amount + Amount float64 `json:"amount,omitempty"` + + // Amount Due + Amountdue float64 `json:"amountdue,omitempty"` + + // coordinate + Coordinate *Address `json:"coordinate,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // items + Items []*QuoteItemBasic `json:"items"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Quote Date + Quotedate string `json:"quotedate,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Sales Regulation Type (Medicinal or Recreational) + Salesregulation string `json:"salesregulation,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Type + Type string `json:"type,omitempty"` +} + +// Validate validates this quote basic +func (m *QuoteBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCoordinate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QuoteBasic) validateCoordinate(formats strfmt.Registry) error { + + if swag.IsZero(m.Coordinate) { // not required + return nil + } + + if m.Coordinate != nil { + if err := m.Coordinate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("coordinate") + } + return err + } + } + + return nil +} + +func (m *QuoteBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QuoteBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteBasic) UnmarshalBinary(b []byte) error { + var res QuoteBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/quote_item.go b/api/sf-gate/sf_gate_models/quote_item.go new file mode 100644 index 0000000..9a4189e --- /dev/null +++ b/api/sf-gate/sf_gate_models/quote_item.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QuoteItem quote item +// +// swagger:model QuoteItem +type QuoteItem struct { + + // Line Item Description + Description string `json:"description,omitempty"` + + // Discount + Discount float64 `json:"discount,omitempty"` + + // Discount Amount + Discountamount float64 `json:"discountamount,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Line Gross Amount + Linegrossamount float64 `json:"linegrossamount,omitempty"` + + // Line Item Number + Linenumber string `json:"linenumber,omitempty"` + + // List Price + Listprice float64 `json:"listprice,omitempty"` + + // Location + Locationid string `json:"locationid,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Product record ID + Productid string `json:"productid,omitempty"` + + // Product Name + Productname string `json:"productname,omitempty"` + + // Quantity + Quantity float64 `json:"quantity,omitempty"` + + // Quote Name + Quoteid string `json:"quoteid,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Date + Servicedate string `json:"servicedate,omitempty"` + + // Shipping & Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Supplier + Supplierid string `json:"supplierid,omitempty"` + + // Taxable? + Taxable string `json:"taxable,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Price + Totalprice float64 `json:"totalprice,omitempty"` + + // Sales Price + Unitprice float64 `json:"unitprice,omitempty"` +} + +// Validate validates this quote item +func (m *QuoteItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *QuoteItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteItem) UnmarshalBinary(b []byte) error { + var res QuoteItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/quote_item_basic.go b/api/sf-gate/sf_gate_models/quote_item_basic.go new file mode 100644 index 0000000..a396fa1 --- /dev/null +++ b/api/sf-gate/sf_gate_models/quote_item_basic.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QuoteItemBasic quote item basic +// +// swagger:model QuoteItemBasic +type QuoteItemBasic struct { + + // Line Item Description + Description string `json:"description,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Invoice + Invoiceid string `json:"invoiceid,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Product Code + Productcode string `json:"productcode,omitempty"` + + // Quantity + Quantity float64 `json:"quantity,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Shipping & Handling + Shippinghandling float64 `json:"shippinghandling,omitempty"` + + // Subtotal + Subtotal float64 `json:"subtotal,omitempty"` + + // Taxnexus Code + Taxnexuscode string `json:"taxnexuscode,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Unit Price + Unitprice float64 `json:"unitprice,omitempty"` +} + +// Validate validates this quote item basic +func (m *QuoteItemBasic) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *QuoteItemBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteItemBasic) UnmarshalBinary(b []byte) error { + var res QuoteItemBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/quote_response.go b/api/sf-gate/sf_gate_models/quote_response.go new file mode 100644 index 0000000..0249478 --- /dev/null +++ b/api/sf-gate/sf_gate_models/quote_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QuoteResponse quote response +// +// swagger:model QuoteResponse +type QuoteResponse struct { + + // data + Data []*Quote `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this quote response +func (m *QuoteResponse) 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 *QuoteResponse) 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 *QuoteResponse) 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 +} + +// MarshalBinary interface implementation +func (m *QuoteResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QuoteResponse) UnmarshalBinary(b []byte) error { + var res QuoteResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/request_meta.go b/api/sf-gate/sf_gate_models/request_meta.go new file mode 100644 index 0000000..0bbad5e --- /dev/null +++ b/api/sf-gate/sf_gate_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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/sf-gate/sf_gate_models/response_meta.go b/api/sf-gate/sf_gate_models/response_meta.go new file mode 100644 index 0000000..c274fb8 --- /dev/null +++ b/api/sf-gate/sf_gate_models/response_meta.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResponseMeta response meta +// +// swagger:model ResponseMeta +type ResponseMeta struct { + + // Contact Info + Contact string `json:"Contact,omitempty"` + + // Copyright Info + Copyright string `json:"Copyright,omitempty"` + + // API Information + Info string `json:"Info,omitempty"` + + // License Info + License string `json:"License,omitempty"` + + // operation ID + OperationID string `json:"OperationID,omitempty"` + + // pagination + Pagination *Pagination `json:"Pagination,omitempty"` + + // request IP + RequestIP string `json:"RequestIP,omitempty"` + + // request type + RequestType string `json:"RequestType,omitempty"` + + // request URL + RequestURL string `json:"RequestURL,omitempty"` + + // server info + ServerInfo string `json:"ServerInfo,omitempty"` + + // server response time + ServerResponseTime string `json:"ServerResponseTime,omitempty"` + + // server time stamp + ServerTimeStamp string `json:"ServerTimeStamp,omitempty"` + + // taxnexus account + TaxnexusAccount string `json:"TaxnexusAccount,omitempty"` + + // user ID + UserID string `json:"UserID,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 +} + +// 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/sf-gate/sf_gate_models/role.go b/api/sf-gate/sf_gate_models/role.go new file mode 100644 index 0000000..ada9d19 --- /dev/null +++ b/api/sf-gate/sf_gate_models/role.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/sf-gate/sf_gate_models/role_request.go b/api/sf-gate/sf_gate_models/role_request.go new file mode 100644 index 0000000..d59d27a --- /dev/null +++ b/api/sf-gate/sf_gate_models/role_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 { + + // data + Data []*Role `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this role request +func (m *RoleRequest) 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 *RoleRequest) 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 *RoleRequest) 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 +} + +// 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/sf-gate/sf_gate_models/role_response.go b/api/sf-gate/sf_gate_models/role_response.go new file mode 100644 index 0000000..93ac364 --- /dev/null +++ b/api/sf-gate/sf_gate_models/role_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/service.go b/api/sf-gate/sf_gate_models/service.go new file mode 100644 index 0000000..f205fb8 --- /dev/null +++ b/api/sf-gate/sf_gate_models/service.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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"` + + // Taxnexus 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"` + + // tenantid + 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 +} + +// 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/sf-gate/sf_gate_models/service_request.go b/api/sf-gate/sf_gate_models/service_request.go new file mode 100644 index 0000000..a622023 --- /dev/null +++ b/api/sf-gate/sf_gate_models/service_request.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceRequest service request +// +// swagger:model ServiceRequest +type ServiceRequest struct { + + // data + // Required: true + Data []*Service `json:"data"` + + // meta + // Required: true + Meta *RequestMeta `json:"meta"` +} + +// 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 err := m.validateMeta(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 err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + 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 *ServiceRequest) validateMeta(formats strfmt.Registry) error { + + if err := validate.Required("meta", "body", m.Meta); err != nil { + return err + } + + 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 +} + +// 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/sf-gate/sf_gate_models/service_response.go b/api/sf-gate/sf_gate_models/service_response.go new file mode 100644 index 0000000..7e1be30 --- /dev/null +++ b/api/sf-gate/sf_gate_models/service_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/state.go b/api/sf-gate/sf_gate_models/state.go new file mode 100644 index 0000000..e70a061 --- /dev/null +++ b/api/sf-gate/sf_gate_models/state.go @@ -0,0 +1,189 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// State state +// +// swagger:model State +type State struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Rollup Amount + Amount float64 `json:"amount,omitempty"` + + // State Code + Code string `json:"code,omitempty"` + + // Contact + Contactid string `json:"contactid,omitempty"` + + // Country + Contryid string `json:"contryid,omitempty"` + + // Division + Division string `json:"division,omitempty"` + + // Enrollment Status + Enrollmentstatus string `json:"enrollmentstatus,omitempty"` + + // FIPS + Fips string `json:"fips,omitempty"` + + // State Geocode + Geocode string `json:"geocode,omitempty"` + + // GNIS + Gnis int64 `json:"gnis,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Interest + Interest float64 `json:"interest,omitempty"` + + // Land Area + Landarea int64 `json:"landarea,omitempty"` + + // latitude + Latitude float64 `json:"latitude,omitempty"` + + // longitude + Longitude float64 `json:"longitude,omitempty"` + + // State Name + Name string `json:"name,omitempty"` + + // Penalty + Penalty float64 `json:"penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Region + Region string `json:"region,omitempty"` + + // Reported Adjustments + Reportedadjustments float64 `json:"reportedadjustments,omitempty"` + + // Reported Deductions + Reporteddeductions float64 `json:"reporteddeductions,omitempty"` + + // Reported Net Revenue + Reportednetrevenue float64 `json:"reportednetrevenue,omitempty"` + + // Reported Rate + Reportedrate float64 `json:"reportedrate,omitempty"` + + // Reported Revenue + Reportedrevenue float64 `json:"reportedrevenue,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"` + + // SGC + Sgc string `json:"sgc,omitempty"` + + // Document Status + Status string `json:"status,omitempty"` + + // Reported Tax + Subtotal float64 `json:"subtotal,omitempty"` + + // taxinstances + Taxinstances []*TaxInstance `json:"taxinstances"` + + // Template + Templateid string `json:"templateid,omitempty"` + + // Total Amount + Totalamount float64 `json:"totalamount,omitempty"` + + // Total Area + Totalarea int64 `json:"totalarea,omitempty"` + + // Unit Base + Unitbase float64 `json:"unitbase,omitempty"` + + // Water Area + Waterarea int64 `json:"waterarea,omitempty"` +} + +// Validate validates this state +func (m *State) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxinstances(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *State) validateTaxinstances(formats strfmt.Registry) error { + + if swag.IsZero(m.Taxinstances) { // not required + return nil + } + + for i := 0; i < len(m.Taxinstances); i++ { + if swag.IsZero(m.Taxinstances[i]) { // not required + continue + } + + if m.Taxinstances[i] != nil { + if err := m.Taxinstances[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("taxinstances" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *State) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *State) UnmarshalBinary(b []byte) error { + var res State + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/state_response.go b/api/sf-gate/sf_gate_models/state_response.go new file mode 100644 index 0000000..b06c07d --- /dev/null +++ b/api/sf-gate/sf_gate_models/state_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StateResponse An array of State objects +// +// swagger:model StateResponse +type StateResponse struct { + + // data + Data []*State `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this state response +func (m *StateResponse) 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 *StateResponse) 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 *StateResponse) 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 +} + +// MarshalBinary interface implementation +func (m *StateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StateResponse) UnmarshalBinary(b []byte) error { + var res StateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/statement.go b/api/sf-gate/sf_gate_models/statement.go new file mode 100644 index 0000000..bd4f917 --- /dev/null +++ b/api/sf-gate/sf_gate_models/statement.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Statement statement +// +// swagger:model Statement +type Statement struct { + + // Account + Account string `json:"account,omitempty"` + + // Account Balance + Accountbalance float64 `json:"accountbalance,omitempty"` + + // Account City + Accountcity string `json:"accountcity,omitempty"` + + // Account Country + Accountcountry string `json:"accountcountry,omitempty"` + + // Account Name + Accountname string `json:"accountname,omitempty"` + + // Account Postal Code + Accountpostalcode string `json:"accountpostalcode,omitempty"` + + // Account State + Accountstate string `json:"accountstate,omitempty"` + + // Account State Code + Accountstatecode string `json:"accountstatecode,omitempty"` + + // Account Street + Accountstreet string `json:"accountstreet,omitempty"` + + // Billing Country Code + Billingcountrycode string `json:"billingcountrycode,omitempty"` + + // Contact + Contact string `json:"contact,omitempty"` + + // Statement Date + Date string `json:"date,omitempty"` + + // Date From + Datefrom string `json:"datefrom,omitempty"` + + // Date To + Dateto string `json:"dateto,omitempty"` + + // Delivery Method + Deliverymethod string `json:"deliverymethod,omitempty"` + + // Statement Number + Name string `json:"name,omitempty"` + + // Recipient Email + Recipientemail string `json:"recipientemail,omitempty"` + + // Recipient Type + Recipienttype string `json:"recipienttype,omitempty"` + + // Statement Salesforce ID + Statementid string `json:"statementid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this statement +func (m *Statement) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Statement) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Statement) UnmarshalBinary(b []byte) error { + var res Statement + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/statement_request.go b/api/sf-gate/sf_gate_models/statement_request.go new file mode 100644 index 0000000..5f43959 --- /dev/null +++ b/api/sf-gate/sf_gate_models/statement_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StatementRequest statement request +// +// swagger:model StatementRequest +type StatementRequest struct { + + // data + Data []*Statement `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this statement request +func (m *StatementRequest) 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 *StatementRequest) 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 *StatementRequest) 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 +} + +// MarshalBinary interface implementation +func (m *StatementRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StatementRequest) UnmarshalBinary(b []byte) error { + var res StatementRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/statement_response.go b/api/sf-gate/sf_gate_models/statement_response.go new file mode 100644 index 0000000..a383d9f --- /dev/null +++ b/api/sf-gate/sf_gate_models/statement_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StatementResponse An array of Statement objects +// +// swagger:model StatementResponse +type StatementResponse struct { + + // data + Data []*Statement `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this statement response +func (m *StatementResponse) 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 *StatementResponse) 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 *StatementResponse) 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 +} + +// MarshalBinary interface implementation +func (m *StatementResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StatementResponse) UnmarshalBinary(b []byte) error { + var res StatementResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/submission.go b/api/sf-gate/sf_gate_models/submission.go new file mode 100644 index 0000000..2ba0d2d --- /dev/null +++ b/api/sf-gate/sf_gate_models/submission.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Submission submission +// +// swagger:model Submission +type Submission struct { + + // The Company that did the submission (Taxnexus) + Companyid string `json:"companyid,omitempty"` + + // Submission Contact + Contactid string `json:"contactid,omitempty"` + + // Created By User ID + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // Submission Date + Date string `json:"date,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Last Modified By User ID + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Cover Letter + Notes string `json:"notes,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Penalty paid + Penalty float64 `json:"penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Reported Adjustments + Reportedadjustments float64 `json:"reportedadjustments,omitempty"` + + // Reported Deductions + Reporteddeductions float64 `json:"reporteddeductions,omitempty"` + + // Reported Net Revenue + Reportednetrevenue float64 `json:"reportednetrevenue,omitempty"` + + // Reported Rate + Reportedrate float64 `json:"reportedrate,omitempty"` + + // Reported Revenue + Reportedrevenue float64 `json:"reportedrevenue,omitempty"` + + // Revenue Base + Revenuebase float64 `json:"revenuebase,omitempty"` + + // Revenue Net + Revenuenet float64 `json:"revenuenet,omitempty"` + + // Revenue Not Taxable + Revenuenottaxable float64 `json:"revenuenottaxable,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Submission Number + Submissionnumber string `json:"submissionnumber,omitempty"` + + // Amount of remittance before penalty + Subtotal float64 `json:"subtotal,omitempty"` + + // Taxnexus ID of the TaxType for which this submssion is being made + Taxtypeid string `json:"taxtypeid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Total Amount of remittance + Totalamount float64 `json:"totalamount,omitempty"` +} + +// Validate validates this submission +func (m *Submission) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Submission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Submission) UnmarshalBinary(b []byte) error { + var res Submission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/submission_request.go b/api/sf-gate/sf_gate_models/submission_request.go new file mode 100644 index 0000000..a450413 --- /dev/null +++ b/api/sf-gate/sf_gate_models/submission_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubmissionRequest submission request +// +// swagger:model SubmissionRequest +type SubmissionRequest struct { + + // data + Data []*Submission `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this submission request +func (m *SubmissionRequest) 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 *SubmissionRequest) 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 *SubmissionRequest) 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 +} + +// MarshalBinary interface implementation +func (m *SubmissionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubmissionRequest) UnmarshalBinary(b []byte) error { + var res SubmissionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/submission_response.go b/api/sf-gate/sf_gate_models/submission_response.go new file mode 100644 index 0000000..27d74d1 --- /dev/null +++ b/api/sf-gate/sf_gate_models/submission_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubmissionResponse An array of Submission objects +// +// swagger:model SubmissionResponse +type SubmissionResponse struct { + + // data + Data []*Submission `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this submission response +func (m *SubmissionResponse) 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 *SubmissionResponse) 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 *SubmissionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SubmissionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubmissionResponse) UnmarshalBinary(b []byte) error { + var res SubmissionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/subscription.go b/api/sf-gate/sf_gate_models/subscription.go new file mode 100644 index 0000000..799c270 --- /dev/null +++ b/api/sf-gate/sf_gate_models/subscription.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Subscription subscription +// +// swagger:model Subscription +type Subscription struct { + + // accountid + Accountid string `json:"accountid,omitempty"` + + // Activated Date + Activateddate string `json:"activateddate,omitempty"` + + // Activated By + Activateduserid string `json:"activateduserid,omitempty"` + + // Allowed Minutes Inbound + Allowedminutesinbound float64 `json:"allowedminutesinbound,omitempty"` + + // Allowed Minutes Outbound + Allowedminutesoutbound float64 `json:"allowedminutesoutbound,omitempty"` + + // Amount + Amount float64 `json:"amount,omitempty"` + + // Asset Name + Assetid string `json:"assetid,omitempty"` + + // Audit Trail Message + Auditmessage string `json:"auditmessage,omitempty"` + + // Cancel Date + Canceldate string `json:"canceldate,omitempty"` + + // contract + Contract *ContractBasic `json:"contract,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Direction Sensitive Rating? + Directionsensitive bool `json:"directionsensitive,omitempty"` + + // Effective Date + Effectivedate string `json:"effectivedate,omitempty"` + + // Email + Email string `json:"email,omitempty"` + + // enduserid + Enduserid string `json:"enduserid,omitempty"` + + // Fax Emails + FaxEmails string `json:"fax_emails,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Active? + Isactive bool `json:"isactive,omitempty"` + + // Order Date + Orderdate string `json:"orderdate,omitempty"` + + // Order Item + Orderitemid string `json:"orderitemid,omitempty"` + + // Overage Rate Inbound + Overagerateinbound float64 `json:"overagerateinbound,omitempty"` + + // Overage Rate Outbound + Overagerateoutbound float64 `json:"overagerateoutbound,omitempty"` + + // Password + Password string `json:"password,omitempty"` + + // Payment Terms + Paymentterms string `json:"paymentterms,omitempty"` + + // Price Book + Pricebookid string `json:"pricebookid,omitempty"` + + // Product Code + Productcode string `json:"productcode,omitempty"` + + // Product record ID + Productid string `json:"productid,omitempty"` + + // Product Name + Productname string `json:"productname,omitempty"` + + // Quantity + Quantity string `json:"quantity,omitempty"` + + // Quote Item + Quoteitemid string `json:"quoteitemid,omitempty"` + + // Subscription ID + Seq string `json:"seq,omitempty"` + + // Status + Status string `json:"status,omitempty"` + + // Suretax Code + Suretax string `json:"suretax,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // tollfreeRating + Tollfreerating bool `json:"tollfreerating,omitempty"` + + // Type + Type string `json:"type,omitempty"` + + // Unit Price + Unitprice float64 `json:"unitprice,omitempty"` + + // Units + Units string `json:"units,omitempty"` + + // Unlimited usage? + Unlimited bool `json:"unlimited,omitempty"` + + // Username + Username string `json:"username,omitempty"` +} + +// Validate validates this subscription +func (m *Subscription) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContract(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Subscription) validateContract(formats strfmt.Registry) error { + + if swag.IsZero(m.Contract) { // not required + return nil + } + + if m.Contract != nil { + if err := m.Contract.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contract") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Subscription) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Subscription) UnmarshalBinary(b []byte) error { + var res Subscription + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/subscription_request.go b/api/sf-gate/sf_gate_models/subscription_request.go new file mode 100644 index 0000000..2333156 --- /dev/null +++ b/api/sf-gate/sf_gate_models/subscription_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubscriptionRequest subscription request +// +// swagger:model SubscriptionRequest +type SubscriptionRequest struct { + + // data + Data []*Subscription `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this subscription request +func (m *SubscriptionRequest) 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 *SubscriptionRequest) 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 *SubscriptionRequest) 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 +} + +// MarshalBinary interface implementation +func (m *SubscriptionRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubscriptionRequest) UnmarshalBinary(b []byte) error { + var res SubscriptionRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/subscription_response.go b/api/sf-gate/sf_gate_models/subscription_response.go new file mode 100644 index 0000000..9388b85 --- /dev/null +++ b/api/sf-gate/sf_gate_models/subscription_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubscriptionResponse subscription response +// +// swagger:model SubscriptionResponse +type SubscriptionResponse struct { + + // data + Data []*Subscription `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this subscription response +func (m *SubscriptionResponse) 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 *SubscriptionResponse) 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 *SubscriptionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *SubscriptionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubscriptionResponse) UnmarshalBinary(b []byte) error { + var res SubscriptionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_instance.go b/api/sf-gate/sf_gate_models/tax_instance.go new file mode 100644 index 0000000..70e7b03 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_instance.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxInstance tax instance +// +// swagger:model TaxInstance +type TaxInstance struct { + + // The Taxnexus ID of the Country that owns this instance + Countryid string `json:"countryid,omitempty"` + + // The Taxnexus ID of the County that owns this instance + Countyid string `json:"countyid,omitempty"` + + // createdbyid + Createdbyid string `json:"createdbyid,omitempty"` + + // The creation date of this database record + Createddate string `json:"createddate,omitempty"` + + // lastmodifiedbyid + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // lastmodifieddate + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // The Taxnexus ID of the Place that owns this instance + Placeid string `json:"placeid,omitempty"` + + // The Taxnexus ID of the State that owns this instance + Stateid string `json:"stateid,omitempty"` + + // The Taxnexus Tax Type ID of this instance + Taxtypeid string `json:"taxtypeid,omitempty"` + + // The Type of instance refers to the linking object (place, county, state, country) + Type string `json:"type,omitempty"` +} + +// Validate validates this tax instance +func (m *TaxInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxInstance) UnmarshalBinary(b []byte) error { + var res TaxInstance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_invoices_request.go b/api/sf-gate/sf_gate_models/tax_invoices_request.go new file mode 100644 index 0000000..2c34ccf --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_invoices_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxInvoicesRequest tax invoices request +// +// swagger:model TaxInvoicesRequest +type TaxInvoicesRequest struct { + + // data + Data []*InvoiceBasic `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this tax invoices request +func (m *TaxInvoicesRequest) 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 *TaxInvoicesRequest) 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 *TaxInvoicesRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxInvoicesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxInvoicesRequest) UnmarshalBinary(b []byte) error { + var res TaxInvoicesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_orders_request.go b/api/sf-gate/sf_gate_models/tax_orders_request.go new file mode 100644 index 0000000..94d0eeb --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_orders_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxOrdersRequest tax orders request +// +// swagger:model TaxOrdersRequest +type TaxOrdersRequest struct { + + // data + Data []*OrderBasic `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this tax orders request +func (m *TaxOrdersRequest) 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 *TaxOrdersRequest) 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 *TaxOrdersRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxOrdersRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxOrdersRequest) UnmarshalBinary(b []byte) error { + var res TaxOrdersRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_purchase_orders_request.go b/api/sf-gate/sf_gate_models/tax_purchase_orders_request.go new file mode 100644 index 0000000..aae0f92 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_purchase_orders_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxPurchaseOrdersRequest tax purchase orders request +// +// swagger:model TaxPurchaseOrdersRequest +type TaxPurchaseOrdersRequest struct { + + // data + Data []*PurchaseOrderBasic `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this tax purchase orders request +func (m *TaxPurchaseOrdersRequest) 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 *TaxPurchaseOrdersRequest) 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 *TaxPurchaseOrdersRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxPurchaseOrdersRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxPurchaseOrdersRequest) UnmarshalBinary(b []byte) error { + var res TaxPurchaseOrdersRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_quotes_request.go b/api/sf-gate/sf_gate_models/tax_quotes_request.go new file mode 100644 index 0000000..430845e --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_quotes_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxQuotesRequest tax quotes request +// +// swagger:model TaxQuotesRequest +type TaxQuotesRequest struct { + + // data + Data []*QuoteBasic `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this tax quotes request +func (m *TaxQuotesRequest) 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 *TaxQuotesRequest) 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 *TaxQuotesRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxQuotesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxQuotesRequest) UnmarshalBinary(b []byte) error { + var res TaxQuotesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_transaction.go b/api/sf-gate/sf_gate_models/tax_transaction.go new file mode 100644 index 0000000..241e3cb --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_transaction.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTransaction tax transaction +// +// swagger:model TaxTransaction +type TaxTransaction struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Amount + Amount float64 `json:"amount,omitempty"` + + // Effective Rate + Effectiverate float64 `json:"effectiverate,omitempty"` + + // Filing + Filingid string `json:"filingid,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Invoice + Invoiceid string `json:"invoiceid,omitempty"` + + // Invoice Item + Invoiceitemid string `json:"invoiceitemid,omitempty"` + + // isSummary + Issummary bool `json:"issummary,omitempty"` + + // The Id of the GL Journal Item, part of a Journal Entry + Journalitemid string `json:"journalitemid,omitempty"` + + // Order + Orderid string `json:"orderid,omitempty"` + + // Order Product + Orderitemid string `json:"orderitemid,omitempty"` + + // Percent Taxable + Percenttaxable float64 `json:"percenttaxable,omitempty"` + + // Period + Periodid string `json:"periodid,omitempty"` + + // Place + Placeid string `json:"placeid,omitempty"` + + // Posted + Posted bool `json:"posted,omitempty"` + + // Quote + Quoteid string `json:"quoteid,omitempty"` + + // Quote Line Item + Quoteitemid string `json:"quoteitemid,omitempty"` + + // Rating Ingest + Ratingingestid string `json:"ratingingestid,omitempty"` + + // Rating Type + Ratingtype string `json:"ratingtype,omitempty"` + + // Revenue Base + Revenuebase float64 `json:"revenuebase,omitempty"` + + // Revenue Net + Revenuenet float64 `json:"revenuenet,omitempty"` + + // Revenue Not Taxable + Revenuenottaxable float64 `json:"revenuenottaxable,omitempty"` + + // Tax Exempt Revenue + Taxexemptrevenue float64 `json:"taxexemptrevenue,omitempty"` + + // Tax Rate + Taxrate float64 `json:"taxrate,omitempty"` + + // Tax Type + Taxtypeid string `json:"taxtypeid,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` + + // Unit Base + Unitbase float64 `json:"unitbase,omitempty"` + + // Unit Fee Rate + Unitfeerate float64 `json:"unitfeerate,omitempty"` +} + +// Validate validates this tax transaction +func (m *TaxTransaction) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxTransaction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTransaction) UnmarshalBinary(b []byte) error { + var res TaxTransaction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_transaction_response.go b/api/sf-gate/sf_gate_models/tax_transaction_response.go new file mode 100644 index 0000000..76513e3 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_transaction_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTransactionResponse tax transaction response +// +// swagger:model TaxTransactionResponse +type TaxTransactionResponse struct { + + // data + Data []*TaxTransaction `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this tax transaction response +func (m *TaxTransactionResponse) 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 *TaxTransactionResponse) 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 *TaxTransactionResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTransactionResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTransactionResponse) UnmarshalBinary(b []byte) error { + var res TaxTransactionResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_type.go b/api/sf-gate/sf_gate_models/tax_type.go new file mode 100644 index 0000000..30f5ad5 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_type.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxType tax type +// +// swagger:model TaxType +type TaxType struct { + + // Authority Account Id + Accountid string `json:"accountid,omitempty"` + + // The Accounting Rule Code used for GL Post + Accountingrulecode string `json:"accountingrulecode,omitempty"` + + // Active + Active bool `json:"active,omitempty"` + + // Agency Type + Agencytype string `json:"agencytype,omitempty"` + + // Collection Agent Id + Agentid string `json:"agentid,omitempty"` + + // Category + Category string `json:"category,omitempty"` + + // Collector Domain Id + Collectordomainid string `json:"collectordomainid,omitempty"` + + // Company ID + Companyid string `json:"companyid,omitempty"` + + // Authority Contact Id + Contactid string `json:"contactid,omitempty"` + + // Created By User ID + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // Effective Date + Effectivedate string `json:"effectivedate,omitempty"` + + // End Date + Enddate string `json:"enddate,omitempty"` + + // Enrollment Status + Enrollmentstatus string `json:"enrollmentstatus,omitempty"` + + // Filing City + Filingcity string `json:"filingcity,omitempty"` + + // Filing Country + Filingcountry string `json:"filingcountry,omitempty"` + + // Filing Email + Filingemail string `json:"filingemail,omitempty"` + + // Filing Method + Filingmethod string `json:"filingmethod,omitempty"` + + // Filing Postal Code + Filingpostalcode string `json:"filingpostalcode,omitempty"` + + // Filing State + Filingstate string `json:"filingstate,omitempty"` + + // Filing Street + Filingstreet string `json:"filingstreet,omitempty"` + + // Does this Tax Type use a Fractional Basis for calculation? + Fractional bool `json:"fractional,omitempty"` + + // Frequency + Frequency string `json:"frequency,omitempty"` + + // Geocode String + Geocodestring string `json:"geocodestring,omitempty"` + + // Taxnexus Record Id + ID string `json:"id,omitempty"` + + // Interest Rate + Interestrate float64 `json:"interestrate,omitempty"` + + // Business Tax? + Ismedicinal bool `json:"ismedicinal,omitempty"` + + // Cannabis Tax? + Isrecreational bool `json:"isrecreational,omitempty"` + + // Rollup Amount + Itemamount float64 `json:"itemamount,omitempty"` + + // Rollup Tax Items + Itemcount float64 `json:"itemcount,omitempty"` + + // Last Modified By User ID + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // The wholesale markup rate for Excise tax (CA cannabis) + Markuprate float64 `json:"markuprate,omitempty"` + + // Tax Type Name (unique) + Name string `json:"name,omitempty"` + + // Is this tax allowed to be passed-through to retail customers? + Passthrough bool `json:"passthrough,omitempty"` + + // Number of days until penalty is assessed + Penaltydays int64 `json:"penaltydays,omitempty"` + + // The percentage rate of a penalty (per month) + Penaltyrate float64 `json:"penaltyrate,omitempty"` + + // Tax Rate + Rate float64 `json:"rate,omitempty"` + + // Tax Website Reference + Reference string `json:"reference,omitempty"` + + // Salesregulation Code for this TaxType + Salesregulation string `json:"salesregulation,omitempty"` + + // TaxType Document Status + Status string `json:"status,omitempty"` + + // Taxnexus Code Id + Taxnexuscodeid string `json:"taxnexuscodeid,omitempty"` + + // The Tax Type number assigned by Taxnexus + Taxnexusnumber string `json:"taxnexusnumber,omitempty"` + + // Rendering Template Id + Templateid string `json:"templateid,omitempty"` + + // Rollup Unit Base + Unitbase float64 `json:"unitbase,omitempty"` + + // Units + Units string `json:"units,omitempty"` +} + +// Validate validates this tax type +func (m *TaxType) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxType) UnmarshalBinary(b []byte) error { + var res TaxType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_type_account.go b/api/sf-gate/sf_gate_models/tax_type_account.go new file mode 100644 index 0000000..bec07d0 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_type_account.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeAccount tax type account +// +// swagger:model TaxTypeAccount +type TaxTypeAccount struct { + + // Account + Accountid string `json:"accountid,omitempty"` + + // Account Number + Accountnumber string `json:"accountnumber,omitempty"` + + // Active + Active bool `json:"active,omitempty"` + + // Rollup Amount + Amount float64 `json:"amount,omitempty"` + + // Contact ID + Contactid string `json:"contactid,omitempty"` + + // createdbyid + Createdbyid string `json:"createdbyid,omitempty"` + + // createddate + Createddate string `json:"createddate,omitempty"` + + // Description + Description string `json:"description,omitempty"` + + // End Date + Enddate string `json:"enddate,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Interest + Interest float64 `json:"interest,omitempty"` + + // lastmodifiedbyid + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // lastmodifieddate + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Notes + Notes string `json:"notes,omitempty"` + + // UUID Reference the master record that owns this item + Parentfk string `json:"parentfk,omitempty"` + + // Penalty + Penalty float64 `json:"penalty,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"ref,omitempty"` + + // Reported Adjustments + Reportedadjustments float64 `json:"reportedadjustments,omitempty"` + + // Reported Deductions + Reporteddeductions float64 `json:"reporteddeductions,omitempty"` + + // Reported Net Revenue + Reportednetrevenue float64 `json:"reportednetrevenue,omitempty"` + + // Reported Rate + Reportedrate float64 `json:"reportedrate,omitempty"` + + // Reported Revenue + Reportedrevenue float64 `json:"reportedrevenue,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"` + + // Start Date + Startdate string `json:"startdate,omitempty"` + + // Reported Tax + Subtotal float64 `json:"subtotal,omitempty"` + + // Rollup Tax + Tax float64 `json:"tax,omitempty"` + + // Rollup Tax on Tax + Taxontax float64 `json:"taxontax,omitempty"` + + // Tax Type + Taxtypeid string `json:"taxtypeid,omitempty"` + + // tenantid + Tenantid string `json:"tenantid,omitempty"` + + // Total Amount + Totalamount float64 `json:"totalamount,omitempty"` + + // Rollup Unit Base + Unitbase float64 `json:"unitbase,omitempty"` +} + +// Validate validates this tax type account +func (m *TaxTypeAccount) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxTypeAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeAccount) UnmarshalBinary(b []byte) error { + var res TaxTypeAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_type_account_request.go b/api/sf-gate/sf_gate_models/tax_type_account_request.go new file mode 100644 index 0000000..054fa00 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_type_account_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeAccountRequest tax type account request +// +// swagger:model TaxTypeAccountRequest +type TaxTypeAccountRequest struct { + + // data + Data []*TaxTypeAccount `json:"data"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// Validate validates this tax type account request +func (m *TaxTypeAccountRequest) 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 *TaxTypeAccountRequest) 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 *TaxTypeAccountRequest) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTypeAccountRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeAccountRequest) UnmarshalBinary(b []byte) error { + var res TaxTypeAccountRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_type_account_response.go b/api/sf-gate/sf_gate_models/tax_type_account_response.go new file mode 100644 index 0000000..72fe46a --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_type_account_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeAccountResponse An array of TaxType Account objects with Contacts +// +// swagger:model TaxTypeAccountResponse +type TaxTypeAccountResponse struct { + + // data + Data []*TaxTypeAccount `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this tax type account response +func (m *TaxTypeAccountResponse) 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 *TaxTypeAccountResponse) 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 *TaxTypeAccountResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTypeAccountResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeAccountResponse) UnmarshalBinary(b []byte) error { + var res TaxTypeAccountResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/tax_type_response.go b/api/sf-gate/sf_gate_models/tax_type_response.go new file mode 100644 index 0000000..49dbac1 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tax_type_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxTypeResponse An array of Tax Type objects +// +// swagger:model TaxTypeResponse +type TaxTypeResponse struct { + + // data + Data []*TaxType `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this tax type response +func (m *TaxTypeResponse) 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 *TaxTypeResponse) 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 *TaxTypeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxTypeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxTypeResponse) UnmarshalBinary(b []byte) error { + var res TaxTypeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/taxnexus_code.go b/api/sf-gate/sf_gate_models/taxnexus_code.go new file mode 100644 index 0000000..20ce6f6 --- /dev/null +++ b/api/sf-gate/sf_gate_models/taxnexus_code.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxnexusCode taxnexus code +// +// swagger:model TaxnexusCode +type TaxnexusCode struct { + + // Is this an active Taxnexus Code? + Active bool `json:"active,omitempty"` + + // Taxnexus Code + Code string `json:"code,omitempty"` + + // Created By User ID + Createdbyid string `json:"createdbyid,omitempty"` + + // Created Date + Createddate string `json:"createddate,omitempty"` + + // Taxnexus Code Description + Description string `json:"description,omitempty"` + + // Domain ID + Domainid string `json:"domainid,omitempty"` + + // Domain Name + Domainname string `json:"domainname,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"id,omitempty"` + + // Last Modified By User ID + Lastmodifiedbyid string `json:"lastmodifiedbyid,omitempty"` + + // Last Modified Date + Lastmodifieddate string `json:"lastmodifieddate,omitempty"` + + // Level + Level string `json:"level,omitempty"` + + // Taxnexus Code Part 1 + Part1 string `json:"part1,omitempty"` + + // Taxnexus Code Part 2 + Part2 string `json:"part2,omitempty"` + + // Taxnexus Code Part 3 + Part3 string `json:"part3,omitempty"` + + // Taxnexus Code Part 4 + Part4 string `json:"part4,omitempty"` + + // Taxnexus Code Part 4 + Part5 string `json:"part5,omitempty"` + + // Purchasing Ruleset AccountingRuleset Code + Purchasingrulesetcode string `json:"purchasingrulesetcode,omitempty"` + + // Purchasing Ruleset AccountingRuleset ID + Purchasingrulesetid string `json:"purchasingrulesetid,omitempty"` + + // External reference, if any + Ref string `json:"ref,omitempty"` + + // Revenue Ruleset AccountingRuleset Code + Revenuerulesetcode string `json:"revenuerulesetcode,omitempty"` + + // Revenue Ruleset AccountingRuleset ID + Revenuerulesetid string `json:"revenuerulesetid,omitempty"` +} + +// Validate validates this taxnexus code +func (m *TaxnexusCode) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaxnexusCode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxnexusCode) UnmarshalBinary(b []byte) error { + var res TaxnexusCode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/taxnexus_code_response.go b/api/sf-gate/sf_gate_models/taxnexus_code_response.go new file mode 100644 index 0000000..227ed55 --- /dev/null +++ b/api/sf-gate/sf_gate_models/taxnexus_code_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaxnexusCodeResponse taxnexus code response +// +// swagger:model TaxnexusCodeResponse +type TaxnexusCodeResponse struct { + + // data + Data []*TaxnexusCode `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this taxnexus code response +func (m *TaxnexusCodeResponse) 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 *TaxnexusCodeResponse) 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 *TaxnexusCodeResponse) 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 +} + +// MarshalBinary interface implementation +func (m *TaxnexusCodeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaxnexusCodeResponse) UnmarshalBinary(b []byte) error { + var res TaxnexusCodeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sf-gate/sf_gate_models/template.go b/api/sf-gate/sf_gate_models/template.go new file mode 100644 index 0000000..c56a966 --- /dev/null +++ b/api/sf-gate/sf_gate_models/template.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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"` + + // Taxnexus 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"` + + // Type + Type string `json:"Type,omitempty"` + + // URL + URL string `json:"URL,omitempty"` + + // tenant identifier + Tenantid string `json:"tenantid,omitempty"` +} + +// Validate validates this template +func (m *Template) Validate(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/sf-gate/sf_gate_models/template_response.go b/api/sf-gate/sf_gate_models/template_response.go new file mode 100644 index 0000000..9a34dae --- /dev/null +++ b/api/sf-gate/sf_gate_models/template_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TemplateResponse template response +// +// 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 +} + +// 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/sf-gate/sf_gate_models/tenant.go b/api/sf-gate/sf_gate_models/tenant.go new file mode 100644 index 0000000..ce74835 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tenant.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Tenant Taxnexus 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"` + + // tenantusers + Tenantusers []*TenantUser `json:"tenantusers"` + + // 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 +} + +// 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/sf-gate/sf_gate_models/tenant_request.go b/api/sf-gate/sf_gate_models/tenant_request.go new file mode 100644 index 0000000..1b6f485 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tenant_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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"` + + // meta + Meta *RequestMeta `json:"meta,omitempty"` +} + +// 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 err := m.validateMeta(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 +} + +func (m *TenantRequest) 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 +} + +// 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/sf-gate/sf_gate_models/tenant_response.go b/api/sf-gate/sf_gate_models/tenant_response.go new file mode 100644 index 0000000..00a769d --- /dev/null +++ b/api/sf-gate/sf_gate_models/tenant_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/tenant_user.go b/api/sf-gate/sf_gate_models/tenant_user.go new file mode 100644 index 0000000..13d4753 --- /dev/null +++ b/api/sf-gate/sf_gate_models/tenant_user.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TenantUser Relationship object that connects users to a tenant +// +// swagger:model TenantUser +type TenantUser struct { + + // The Tenant access level for this User + Accesslevel string `json:"accesslevel,omitempty"` + + // The Tenant ID + Tenantid string `json:"tenantid,omitempty"` + + // The User ID + Userid string `json:"userid,omitempty"` +} + +// Validate validates this tenant user +func (m *TenantUser) Validate(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/sf-gate/sf_gate_models/user.go b/api/sf-gate/sf_gate_models/user.go new file mode 100644 index 0000000..b4a600b --- /dev/null +++ b/api/sf-gate/sf_gate_models/user.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// User user +// +// swagger:model User +type User struct { + + // 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"` + + // API Key + Apikey string `json:"apikey,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 + Endday string `json:"endday,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 + Isprofilephotoactive bool `json:"isprofilephotoactive,omitempty"` + + // issystemcontrolled + 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"` + + // Admin Info Emails + Receivesadmininfoemails bool `json:"receivesadmininfoemails,omitempty"` + + // Info Emails + Receivesinfoemails bool `json:"receivesinfoemails,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 + Startday string `json:"startday,omitempty"` + + // Taxnexus Account + Taxnexusaccount string `json:"taxnexusaccount,omitempty"` + + // tenantid + Tenantid string `json:"tenantid,omitempty"` + + // tenantusers + Tenantusers []*TenantUser `json:"tenantusers"` + + // Time Zone + Timezonesidkey string `json:"timezonesidkey,omitempty"` + + // Title + Title string `json:"title,omitempty"` + + // Username + Username string `json:"username,omitempty"` + + // Role + Userroleid string `json:"userroleid,omitempty"` + + // userroles + Userroles []*UserRole `json:"userroles"` + + // User Type + Usertype string `json:"usertype,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 +} + +// 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/sf-gate/sf_gate_models/user_response.go b/api/sf-gate/sf_gate_models/user_response.go new file mode 100644 index 0000000..84cfc14 --- /dev/null +++ b/api/sf-gate/sf_gate_models/user_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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 +} + +// 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/sf-gate/sf_gate_models/user_role.go b/api/sf-gate/sf_gate_models/user_role.go new file mode 100644 index 0000000..f723a23 --- /dev/null +++ b/api/sf-gate/sf_gate_models/user_role.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package sf_gate_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserRole Relationship object that connects user to a role +// +// swagger:model UserRole +type UserRole struct { + + // Linked role ID + Auth0roleid string `json:"auth0roleid,omitempty"` + + // Role description + Description string `json:"description,omitempty"` + + // Role Name + Name string `json:"name,omitempty"` + + // The Role ID + Roleid string `json:"roleid,omitempty"` + + // The User ID + Userid string `json:"userid,omitempty"` +} + +// Validate validates this user role +func (m *UserRole) Validate(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/stash/stash_client/stash_client.go b/api/stash/stash_client/stash_client.go new file mode 100644 index 0000000..589b682 --- /dev/null +++ b/api/stash/stash_client/stash_client.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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.fabric.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..1e92b6f --- /dev/null +++ b/api/stash/stash_client/stash_pdf/post_pdfs_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/stash/stash_models" +) + +// NewPostPdfsParams creates a new PostPdfsParams object +// with the default values initialized. +func NewPostPdfsParams() *PostPdfsParams { + var () + return &PostPdfsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostPdfsParamsWithTimeout creates a new PostPdfsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostPdfsParamsWithTimeout(timeout time.Duration) *PostPdfsParams { + var () + return &PostPdfsParams{ + + timeout: timeout, + } +} + +// NewPostPdfsParamsWithContext creates a new PostPdfsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostPdfsParamsWithContext(ctx context.Context) *PostPdfsParams { + var () + return &PostPdfsParams{ + + Context: ctx, + } +} + +// NewPostPdfsParamsWithHTTPClient creates a new PostPdfsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostPdfsParamsWithHTTPClient(client *http.Client) *PostPdfsParams { + var () + 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 +} + +// 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..3eb9de2 --- /dev/null +++ b/api/stash/stash_client/stash_pdf/post_pdfs_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostPdfsOK creates a PostPdfsOK with default headers values +func NewPostPdfsOK() *PostPdfsOK { + return &PostPdfsOK{} +} + +/*PostPdfsOK handles this case 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 handles this case 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 handles this case 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 handles this case 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 handles this case 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 handles this case 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..5e9ba57 --- /dev/null +++ b/api/stash/stash_client/stash_pdf/stash_pdf_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + PostPdfs(params *PostPdfsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPdfsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PostPdfs creates new p d fs + + Store new PDFs +*/ +func (a *Client) PostPdfs(params *PostPdfsParams, authInfo runtime.ClientAuthInfoWriter) (*PostPdfsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostPdfsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..142175b --- /dev/null +++ b/api/stash/stash_models/document.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..aae6c88 --- /dev/null +++ b/api/stash/stash_models/document_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..e8f2c02 --- /dev/null +++ b/api/stash/stash_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..7f04d0b --- /dev/null +++ b/api/stash/stash_models/new_p_d_f.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..f54e935 --- /dev/null +++ b/api/stash/stash_models/p_d_f_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..d4b6192 --- /dev/null +++ b/api/stash/stash_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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..7e44927 --- /dev/null +++ b/api/stash/stash_models/response_meta.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 + TaxnexusAccount string `json:"TaxnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(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/vendor-gw/vendor_gw_client/accounts/accounts_client.go b/api/vendor-gw/vendor_gw_client/accounts/accounts_client.go new file mode 100644 index 0000000..c7db14a --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/accounts/accounts_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetAccounts gets accounts for this user + + Get the Stores, Accounts or other entities that correspond to locations +*/ +func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAccountsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAccountsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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/vendor-gw/vendor_gw_client/accounts/get_accounts_parameters.go b/api/vendor-gw/vendor_gw_client/accounts/get_accounts_parameters.go new file mode 100644 index 0000000..63fdd4c --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/accounts/get_accounts_parameters.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" +) + +// NewGetAccountsParams creates a new GetAccountsParams object +// with the default values initialized. +func NewGetAccountsParams() *GetAccountsParams { + var () + return &GetAccountsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAccountsParamsWithTimeout creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAccountsParamsWithTimeout(timeout time.Duration) *GetAccountsParams { + var () + return &GetAccountsParams{ + + timeout: timeout, + } +} + +// NewGetAccountsParamsWithContext creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams { + var () + return &GetAccountsParams{ + + Context: ctx, + } +} + +// NewGetAccountsParamsWithHTTPClient creates a new GetAccountsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAccountsParamsWithHTTPClient(client *http.Client) *GetAccountsParams { + var () + 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 { + + /*License + The Licnese Number for the query + + */ + License *string + /*Partner + The Partner Key + + */ + Partner *string + /*State + The 2-character State Code + + */ + State string + /*User + The Taxnexus User's Key on the Vendor API + + */ + User string + /*Vendor + The name of the Vendor Gateway to be used + + */ + Vendor *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// 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 +} + +// WithLicense adds the license to the get accounts params +func (o *GetAccountsParams) WithLicense(license *string) *GetAccountsParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get accounts params +func (o *GetAccountsParams) SetLicense(license *string) { + o.License = license +} + +// WithPartner adds the partner to the get accounts params +func (o *GetAccountsParams) WithPartner(partner *string) *GetAccountsParams { + o.SetPartner(partner) + return o +} + +// SetPartner adds the partner to the get accounts params +func (o *GetAccountsParams) SetPartner(partner *string) { + o.Partner = partner +} + +// WithState adds the state to the get accounts params +func (o *GetAccountsParams) WithState(state string) *GetAccountsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get accounts params +func (o *GetAccountsParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get accounts params +func (o *GetAccountsParams) WithUser(user string) *GetAccountsParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get accounts params +func (o *GetAccountsParams) SetUser(user string) { + o.User = user +} + +// WithVendor adds the vendor to the get accounts params +func (o *GetAccountsParams) WithVendor(vendor *string) *GetAccountsParams { + o.SetVendor(vendor) + return o +} + +// SetVendor adds the vendor to the get accounts params +func (o *GetAccountsParams) SetVendor(vendor *string) { + o.Vendor = vendor +} + +// 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.License != nil { + + // query param license + var qrLicense string + if o.License != nil { + qrLicense = *o.License + } + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); err != nil { + return err + } + } + + } + + if o.Partner != nil { + + // query param partner + var qrPartner string + if o.Partner != nil { + qrPartner = *o.Partner + } + qPartner := qrPartner + if qPartner != "" { + if err := r.SetQueryParam("partner", qPartner); err != nil { + return err + } + } + + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if o.Vendor != nil { + + // query param vendor + var qrVendor string + if o.Vendor != nil { + qrVendor = *o.Vendor + } + qVendor := qrVendor + if qVendor != "" { + if err := r.SetQueryParam("vendor", qVendor); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/vendor-gw/vendor_gw_client/accounts/get_accounts_responses.go b/api/vendor-gw/vendor_gw_client/accounts/get_accounts_responses.go new file mode 100644 index 0000000..277fdd4 --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/accounts/get_accounts_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/vendor-gw/vendor_gw_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("unknown error", response, response.Code()) + } +} + +// NewGetAccountsOK creates a GetAccountsOK with default headers values +func NewGetAccountsOK() *GetAccountsOK { + return &GetAccountsOK{} +} + +/*GetAccountsOK handles this case with default header values. + +An array of AccountBasic objects +*/ +type GetAccountsOK struct { + Payload *vendor_gw_models.AccountResponse +} + +func (o *GetAccountsOK) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload) +} + +func (o *GetAccountsOK) GetPayload() *vendor_gw_models.AccountResponse { + return o.Payload +} + +func (o *GetAccountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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 handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetAccountsUnauthorized struct { + Payload *vendor_gw_models.Error +} + +func (o *GetAccountsUnauthorized) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload) +} + +func (o *GetAccountsUnauthorized) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetAccountsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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 handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetAccountsForbidden struct { + Payload *vendor_gw_models.Error +} + +func (o *GetAccountsForbidden) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload) +} + +func (o *GetAccountsForbidden) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetAccountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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 handles this case with default header values. + +Resource was not found +*/ +type GetAccountsNotFound struct { + Payload *vendor_gw_models.Error +} + +func (o *GetAccountsNotFound) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload) +} + +func (o *GetAccountsNotFound) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetAccountsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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 handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetAccountsUnprocessableEntity struct { + Payload *vendor_gw_models.Error +} + +func (o *GetAccountsUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetAccountsUnprocessableEntity) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetAccountsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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 handles this case with default header values. + +Server Internal Error +*/ +type GetAccountsInternalServerError struct { + Payload *vendor_gw_models.Error +} + +func (o *GetAccountsInternalServerError) Error() string { + return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload) +} + +func (o *GetAccountsInternalServerError) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetAccountsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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/vendor-gw/vendor_gw_client/invoices/get_invoices_parameters.go b/api/vendor-gw/vendor_gw_client/invoices/get_invoices_parameters.go new file mode 100644 index 0000000..12a16fd --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/invoices/get_invoices_parameters.go @@ -0,0 +1,425 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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" +) + +// NewGetInvoicesParams creates a new GetInvoicesParams object +// with the default values initialized. +func NewGetInvoicesParams() *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetInvoicesParamsWithTimeout creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetInvoicesParamsWithTimeout(timeout time.Duration) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + timeout: timeout, + } +} + +// NewGetInvoicesParamsWithContext creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetInvoicesParamsWithContext(ctx context.Context) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + + Context: ctx, + } +} + +// NewGetInvoicesParamsWithHTTPClient creates a new GetInvoicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetInvoicesParamsWithHTTPClient(client *http.Client) *GetInvoicesParams { + var () + return &GetInvoicesParams{ + HTTPClient: client, + } +} + +/*GetInvoicesParams contains all the parameters to send to the API endpoint +for the get invoices operation typically these are written to a http.Request +*/ +type GetInvoicesParams struct { + + /*EndDate + The last modified end timestamp + + */ + EndDate *string + /*Item + The Item Number + + */ + Item *string + /*License + The Licnese Number for the query + + */ + License *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip + + */ + Offset *int64 + /*Partner + The Partner Key + + */ + Partner *string + /*StartDate + The last modified start timestamp + + */ + StartDate *string + /*State + The 2-character State Code + + */ + State string + /*User + The Taxnexus User's Key on the Vendor API + + */ + User string + /*Vendor + The name of the Vendor Gateway to be used + + */ + Vendor *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) WithTimeout(timeout time.Duration) *GetInvoicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get invoices params +func (o *GetInvoicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get invoices params +func (o *GetInvoicesParams) WithContext(ctx context.Context) *GetInvoicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get invoices params +func (o *GetInvoicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) WithHTTPClient(client *http.Client) *GetInvoicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get invoices params +func (o *GetInvoicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the get invoices params +func (o *GetInvoicesParams) WithEndDate(endDate *string) *GetInvoicesParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get invoices params +func (o *GetInvoicesParams) SetEndDate(endDate *string) { + o.EndDate = endDate +} + +// WithItem adds the item to the get invoices params +func (o *GetInvoicesParams) WithItem(item *string) *GetInvoicesParams { + o.SetItem(item) + return o +} + +// SetItem adds the item to the get invoices params +func (o *GetInvoicesParams) SetItem(item *string) { + o.Item = item +} + +// WithLicense adds the license to the get invoices params +func (o *GetInvoicesParams) WithLicense(license *string) *GetInvoicesParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get invoices params +func (o *GetInvoicesParams) SetLicense(license *string) { + o.License = license +} + +// WithLimit adds the limit to the get invoices params +func (o *GetInvoicesParams) WithLimit(limit *int64) *GetInvoicesParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get invoices params +func (o *GetInvoicesParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get invoices params +func (o *GetInvoicesParams) WithOffset(offset *int64) *GetInvoicesParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get invoices params +func (o *GetInvoicesParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPartner adds the partner to the get invoices params +func (o *GetInvoicesParams) WithPartner(partner *string) *GetInvoicesParams { + o.SetPartner(partner) + return o +} + +// SetPartner adds the partner to the get invoices params +func (o *GetInvoicesParams) SetPartner(partner *string) { + o.Partner = partner +} + +// WithStartDate adds the startDate to the get invoices params +func (o *GetInvoicesParams) WithStartDate(startDate *string) *GetInvoicesParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get invoices params +func (o *GetInvoicesParams) SetStartDate(startDate *string) { + o.StartDate = startDate +} + +// WithState adds the state to the get invoices params +func (o *GetInvoicesParams) WithState(state string) *GetInvoicesParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get invoices params +func (o *GetInvoicesParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get invoices params +func (o *GetInvoicesParams) WithUser(user string) *GetInvoicesParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get invoices params +func (o *GetInvoicesParams) SetUser(user string) { + o.User = user +} + +// WithVendor adds the vendor to the get invoices params +func (o *GetInvoicesParams) WithVendor(vendor *string) *GetInvoicesParams { + o.SetVendor(vendor) + return o +} + +// SetVendor adds the vendor to the get invoices params +func (o *GetInvoicesParams) SetVendor(vendor *string) { + o.Vendor = vendor +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInvoicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndDate != nil { + + // query param endDate + var qrEndDate string + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate + if qEndDate != "" { + if err := r.SetQueryParam("endDate", qEndDate); err != nil { + return err + } + } + + } + + if o.Item != nil { + + // query param item + var qrItem string + if o.Item != nil { + qrItem = *o.Item + } + qItem := qrItem + if qItem != "" { + if err := r.SetQueryParam("item", qItem); err != nil { + return err + } + } + + } + + if o.License != nil { + + // query param license + var qrLicense string + if o.License != nil { + qrLicense = *o.License + } + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); 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.Partner != nil { + + // query param partner + var qrPartner string + if o.Partner != nil { + qrPartner = *o.Partner + } + qPartner := qrPartner + if qPartner != "" { + if err := r.SetQueryParam("partner", qPartner); err != nil { + return err + } + } + + } + + if o.StartDate != nil { + + // query param startDate + var qrStartDate string + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate + if qStartDate != "" { + if err := r.SetQueryParam("startDate", qStartDate); err != nil { + return err + } + } + + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if o.Vendor != nil { + + // query param vendor + var qrVendor string + if o.Vendor != nil { + qrVendor = *o.Vendor + } + qVendor := qrVendor + if qVendor != "" { + if err := r.SetQueryParam("vendor", qVendor); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/vendor-gw/vendor_gw_client/invoices/get_invoices_responses.go b/api/vendor-gw/vendor_gw_client/invoices/get_invoices_responses.go new file mode 100644 index 0000000..2056fb3 --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/invoices/get_invoices_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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" + + "github.com/taxnexus/go/lib/api/vendor-gw/vendor_gw_models" +) + +// GetInvoicesReader is a Reader for the GetInvoices structure. +type GetInvoicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInvoicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetInvoicesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetInvoicesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetInvoicesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetInvoicesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetInvoicesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetInvoicesOK creates a GetInvoicesOK with default headers values +func NewGetInvoicesOK() *GetInvoicesOK { + return &GetInvoicesOK{} +} + +/*GetInvoicesOK handles this case with default header values. + +A list of Invoices for this User was retrieved successfully +*/ +type GetInvoicesOK struct { + Payload *vendor_gw_models.InvoiceResponse +} + +func (o *GetInvoicesOK) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesOK %+v", 200, o.Payload) +} + +func (o *GetInvoicesOK) GetPayload() *vendor_gw_models.InvoiceResponse { + return o.Payload +} + +func (o *GetInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.InvoiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnauthorized creates a GetInvoicesUnauthorized with default headers values +func NewGetInvoicesUnauthorized() *GetInvoicesUnauthorized { + return &GetInvoicesUnauthorized{} +} + +/*GetInvoicesUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetInvoicesUnauthorized struct { + Payload *vendor_gw_models.Error +} + +func (o *GetInvoicesUnauthorized) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetInvoicesUnauthorized) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesForbidden creates a GetInvoicesForbidden with default headers values +func NewGetInvoicesForbidden() *GetInvoicesForbidden { + return &GetInvoicesForbidden{} +} + +/*GetInvoicesForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetInvoicesForbidden struct { + Payload *vendor_gw_models.Error +} + +func (o *GetInvoicesForbidden) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesForbidden %+v", 403, o.Payload) +} + +func (o *GetInvoicesForbidden) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesNotFound creates a GetInvoicesNotFound with default headers values +func NewGetInvoicesNotFound() *GetInvoicesNotFound { + return &GetInvoicesNotFound{} +} + +/*GetInvoicesNotFound handles this case with default header values. + +Resource was not found +*/ +type GetInvoicesNotFound struct { + Payload *vendor_gw_models.Error +} + +func (o *GetInvoicesNotFound) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesNotFound %+v", 404, o.Payload) +} + +func (o *GetInvoicesNotFound) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesUnprocessableEntity creates a GetInvoicesUnprocessableEntity with default headers values +func NewGetInvoicesUnprocessableEntity() *GetInvoicesUnprocessableEntity { + return &GetInvoicesUnprocessableEntity{} +} + +/*GetInvoicesUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetInvoicesUnprocessableEntity struct { + Payload *vendor_gw_models.Error +} + +func (o *GetInvoicesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetInvoicesUnprocessableEntity) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetInvoicesInternalServerError creates a GetInvoicesInternalServerError with default headers values +func NewGetInvoicesInternalServerError() *GetInvoicesInternalServerError { + return &GetInvoicesInternalServerError{} +} + +/*GetInvoicesInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetInvoicesInternalServerError struct { + Payload *vendor_gw_models.Error +} + +func (o *GetInvoicesInternalServerError) Error() string { + return fmt.Sprintf("[GET /invoices][%d] getInvoicesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetInvoicesInternalServerError) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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/vendor-gw/vendor_gw_client/invoices/invoices_client.go b/api/vendor-gw/vendor_gw_client/invoices/invoices_client.go new file mode 100644 index 0000000..a71a9aa --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/invoices/invoices_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package invoices + +// 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 invoices API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for invoices API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetInvoices gets a list of invoices + + Return a list of available Taxnexus Invoices +*/ +func (a *Client) GetInvoices(params *GetInvoicesParams, authInfo runtime.ClientAuthInfoWriter) (*GetInvoicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetInvoicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getInvoices", + Method: "GET", + PathPattern: "/invoices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetInvoicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetInvoicesOK) + 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 getInvoices: 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/vendor-gw/vendor_gw_client/purchase_orders/get_pos_parameters.go b/api/vendor-gw/vendor_gw_client/purchase_orders/get_pos_parameters.go new file mode 100644 index 0000000..86c669a --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/purchase_orders/get_pos_parameters.go @@ -0,0 +1,425 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" +) + +// NewGetPosParams creates a new GetPosParams object +// with the default values initialized. +func NewGetPosParams() *GetPosParams { + var () + return &GetPosParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPosParamsWithTimeout creates a new GetPosParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPosParamsWithTimeout(timeout time.Duration) *GetPosParams { + var () + return &GetPosParams{ + + timeout: timeout, + } +} + +// NewGetPosParamsWithContext creates a new GetPosParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPosParamsWithContext(ctx context.Context) *GetPosParams { + var () + return &GetPosParams{ + + Context: ctx, + } +} + +// NewGetPosParamsWithHTTPClient creates a new GetPosParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPosParamsWithHTTPClient(client *http.Client) *GetPosParams { + var () + return &GetPosParams{ + HTTPClient: client, + } +} + +/*GetPosParams contains all the parameters to send to the API endpoint +for the get pos operation typically these are written to a http.Request +*/ +type GetPosParams struct { + + /*EndDate + The last modified end timestamp + + */ + EndDate *string + /*License + The Licnese Number for the query + + */ + License *string + /*Limit + How many objects to return at one time + + */ + Limit *int64 + /*Offset + How many objects to skip + + */ + Offset *int64 + /*Partner + The Partner Key + + */ + Partner *string + /*PoID + The ID Purchase Order to be retrieved + + */ + PoID *string + /*StartDate + The last modified start timestamp + + */ + StartDate *string + /*State + The 2-character State Code + + */ + State string + /*User + The Taxnexus User's Key on the Vendor API + + */ + User string + /*Vendor + The name of the Vendor Gateway to be used + + */ + Vendor *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get pos params +func (o *GetPosParams) WithTimeout(timeout time.Duration) *GetPosParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get pos params +func (o *GetPosParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get pos params +func (o *GetPosParams) WithContext(ctx context.Context) *GetPosParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get pos params +func (o *GetPosParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get pos params +func (o *GetPosParams) WithHTTPClient(client *http.Client) *GetPosParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get pos params +func (o *GetPosParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the get pos params +func (o *GetPosParams) WithEndDate(endDate *string) *GetPosParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get pos params +func (o *GetPosParams) SetEndDate(endDate *string) { + o.EndDate = endDate +} + +// WithLicense adds the license to the get pos params +func (o *GetPosParams) WithLicense(license *string) *GetPosParams { + o.SetLicense(license) + return o +} + +// SetLicense adds the license to the get pos params +func (o *GetPosParams) SetLicense(license *string) { + o.License = license +} + +// WithLimit adds the limit to the get pos params +func (o *GetPosParams) WithLimit(limit *int64) *GetPosParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get pos params +func (o *GetPosParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the get pos params +func (o *GetPosParams) WithOffset(offset *int64) *GetPosParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the get pos params +func (o *GetPosParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPartner adds the partner to the get pos params +func (o *GetPosParams) WithPartner(partner *string) *GetPosParams { + o.SetPartner(partner) + return o +} + +// SetPartner adds the partner to the get pos params +func (o *GetPosParams) SetPartner(partner *string) { + o.Partner = partner +} + +// WithPoID adds the poID to the get pos params +func (o *GetPosParams) WithPoID(poID *string) *GetPosParams { + o.SetPoID(poID) + return o +} + +// SetPoID adds the poId to the get pos params +func (o *GetPosParams) SetPoID(poID *string) { + o.PoID = poID +} + +// WithStartDate adds the startDate to the get pos params +func (o *GetPosParams) WithStartDate(startDate *string) *GetPosParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get pos params +func (o *GetPosParams) SetStartDate(startDate *string) { + o.StartDate = startDate +} + +// WithState adds the state to the get pos params +func (o *GetPosParams) WithState(state string) *GetPosParams { + o.SetState(state) + return o +} + +// SetState adds the state to the get pos params +func (o *GetPosParams) SetState(state string) { + o.State = state +} + +// WithUser adds the user to the get pos params +func (o *GetPosParams) WithUser(user string) *GetPosParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the get pos params +func (o *GetPosParams) SetUser(user string) { + o.User = user +} + +// WithVendor adds the vendor to the get pos params +func (o *GetPosParams) WithVendor(vendor *string) *GetPosParams { + o.SetVendor(vendor) + return o +} + +// SetVendor adds the vendor to the get pos params +func (o *GetPosParams) SetVendor(vendor *string) { + o.Vendor = vendor +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPosParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndDate != nil { + + // query param endDate + var qrEndDate string + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate + if qEndDate != "" { + if err := r.SetQueryParam("endDate", qEndDate); err != nil { + return err + } + } + + } + + if o.License != nil { + + // query param license + var qrLicense string + if o.License != nil { + qrLicense = *o.License + } + qLicense := qrLicense + if qLicense != "" { + if err := r.SetQueryParam("license", qLicense); 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.Partner != nil { + + // query param partner + var qrPartner string + if o.Partner != nil { + qrPartner = *o.Partner + } + qPartner := qrPartner + if qPartner != "" { + if err := r.SetQueryParam("partner", qPartner); err != nil { + return err + } + } + + } + + if o.PoID != nil { + + // query param poId + var qrPoID string + if o.PoID != nil { + qrPoID = *o.PoID + } + qPoID := qrPoID + if qPoID != "" { + if err := r.SetQueryParam("poId", qPoID); err != nil { + return err + } + } + + } + + if o.StartDate != nil { + + // query param startDate + var qrStartDate string + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate + if qStartDate != "" { + if err := r.SetQueryParam("startDate", qStartDate); err != nil { + return err + } + } + + } + + // query param state + qrState := o.State + qState := qrState + if qState != "" { + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + + // query param user + qrUser := o.User + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + if o.Vendor != nil { + + // query param vendor + var qrVendor string + if o.Vendor != nil { + qrVendor = *o.Vendor + } + qVendor := qrVendor + if qVendor != "" { + if err := r.SetQueryParam("vendor", qVendor); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/vendor-gw/vendor_gw_client/purchase_orders/get_pos_responses.go b/api/vendor-gw/vendor_gw_client/purchase_orders/get_pos_responses.go new file mode 100644 index 0000000..12b8aac --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/purchase_orders/get_pos_responses.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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" + + "github.com/taxnexus/go/lib/api/vendor-gw/vendor_gw_models" +) + +// GetPosReader is a Reader for the GetPos structure. +type GetPosReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPosReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPosOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetPosUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPosForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPosNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPosUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPosInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPosOK creates a GetPosOK with default headers values +func NewGetPosOK() *GetPosOK { + return &GetPosOK{} +} + +/*GetPosOK handles this case with default header values. + +An array of Purchase Order objects +*/ +type GetPosOK struct { + Payload *vendor_gw_models.PurchaseOrderResponse +} + +func (o *GetPosOK) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosOK %+v", 200, o.Payload) +} + +func (o *GetPosOK) GetPayload() *vendor_gw_models.PurchaseOrderResponse { + return o.Payload +} + +func (o *GetPosOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.PurchaseOrderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosUnauthorized creates a GetPosUnauthorized with default headers values +func NewGetPosUnauthorized() *GetPosUnauthorized { + return &GetPosUnauthorized{} +} + +/*GetPosUnauthorized handles this case with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetPosUnauthorized struct { + Payload *vendor_gw_models.Error +} + +func (o *GetPosUnauthorized) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPosUnauthorized) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetPosUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosForbidden creates a GetPosForbidden with default headers values +func NewGetPosForbidden() *GetPosForbidden { + return &GetPosForbidden{} +} + +/*GetPosForbidden handles this case with default header values. + +Access forbidden, account lacks access +*/ +type GetPosForbidden struct { + Payload *vendor_gw_models.Error +} + +func (o *GetPosForbidden) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosForbidden %+v", 403, o.Payload) +} + +func (o *GetPosForbidden) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetPosForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosNotFound creates a GetPosNotFound with default headers values +func NewGetPosNotFound() *GetPosNotFound { + return &GetPosNotFound{} +} + +/*GetPosNotFound handles this case with default header values. + +Resource was not found +*/ +type GetPosNotFound struct { + Payload *vendor_gw_models.Error +} + +func (o *GetPosNotFound) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosNotFound %+v", 404, o.Payload) +} + +func (o *GetPosNotFound) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetPosNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosUnprocessableEntity creates a GetPosUnprocessableEntity with default headers values +func NewGetPosUnprocessableEntity() *GetPosUnprocessableEntity { + return &GetPosUnprocessableEntity{} +} + +/*GetPosUnprocessableEntity handles this case with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetPosUnprocessableEntity struct { + Payload *vendor_gw_models.Error +} + +func (o *GetPosUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPosUnprocessableEntity) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetPosUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPosInternalServerError creates a GetPosInternalServerError with default headers values +func NewGetPosInternalServerError() *GetPosInternalServerError { + return &GetPosInternalServerError{} +} + +/*GetPosInternalServerError handles this case with default header values. + +Server Internal Error +*/ +type GetPosInternalServerError struct { + Payload *vendor_gw_models.Error +} + +func (o *GetPosInternalServerError) Error() string { + return fmt.Sprintf("[GET /pos][%d] getPosInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPosInternalServerError) GetPayload() *vendor_gw_models.Error { + return o.Payload +} + +func (o *GetPosInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(vendor_gw_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/vendor-gw/vendor_gw_client/purchase_orders/purchase_orders_client.go b/api/vendor-gw/vendor_gw_client/purchase_orders/purchase_orders_client.go new file mode 100644 index 0000000..7ea5fcb --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/purchase_orders/purchase_orders_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package purchase_orders + +// 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 purchase orders API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for purchase orders API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetPos(params *GetPosParams, authInfo runtime.ClientAuthInfoWriter) (*GetPosOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPos gets a list of purchase orders + + Return a list of available Purchase Orders +*/ +func (a *Client) GetPos(params *GetPosParams, authInfo runtime.ClientAuthInfoWriter) (*GetPosOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPosParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPos", + Method: "GET", + PathPattern: "/pos", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPosReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPosOK) + 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 getPos: 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/vendor-gw/vendor_gw_client/vendor_gw_client.go b/api/vendor-gw/vendor_gw_client/vendor_gw_client.go new file mode 100644 index 0000000..86ff9f1 --- /dev/null +++ b/api/vendor-gw/vendor_gw_client/vendor_gw_client.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_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" + + "github.com/taxnexus/go/lib/api/vendor-gw/vendor_gw_client/accounts" + "github.com/taxnexus/go/lib/api/vendor-gw/vendor_gw_client/invoices" + "github.com/taxnexus/go/lib/api/vendor-gw/vendor_gw_client/purchase_orders" +) + +// Default vendor gw HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "vendor-gw.fabric.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 vendor gw HTTP client. +func NewHTTPClient(formats strfmt.Registry) *VendorGw { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new vendor gw HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *VendorGw { + // 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 vendor gw client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *VendorGw { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(VendorGw) + cli.Transport = transport + cli.Accounts = accounts.New(transport, formats) + cli.Invoices = invoices.New(transport, formats) + cli.PurchaseOrders = purchase_orders.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 +} + +// VendorGw is a client for vendor gw +type VendorGw struct { + Accounts accounts.ClientService + + Invoices invoices.ClientService + + PurchaseOrders purchase_orders.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *VendorGw) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Accounts.SetTransport(transport) + c.Invoices.SetTransport(transport) + c.PurchaseOrders.SetTransport(transport) +} diff --git a/api/vendor-gw/vendor_gw_models/account_basic.go b/api/vendor-gw/vendor_gw_models/account_basic.go new file mode 100644 index 0000000..8a3e140 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/account_basic.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountBasic account basic +// +// swagger:model AccountBasic +type AccountBasic struct { + + // Account Number + AccountNumber string `json:"AccountNumber,omitempty"` + + // billing address + BillingAddress *Address `json:"BillingAddress,omitempty"` + + // billing contact + BillingContact *ContactBasic `json:"BillingContact,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // license + License *LicenseBasic `json:"License,omitempty"` + + // Account Name + Name string `json:"Name,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Phone number + Phone string `json:"Phone,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // shipping address + ShippingAddress *Address `json:"ShippingAddress,omitempty"` + + // shipping contact + ShippingContact *ContactBasic `json:"ShippingContact,omitempty"` + + // Account Type + Type string `json:"Type,omitempty"` + + // Unique Taxnexus ID + UUID string `json:"UUID,omitempty"` + + // Account 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.validateBillingContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLicense(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShippingContact(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) validateBillingContact(formats strfmt.Registry) error { + + if swag.IsZero(m.BillingContact) { // not required + return nil + } + + if m.BillingContact != nil { + if err := m.BillingContact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("BillingContact") + } + return err + } + } + + return nil +} + +func (m *AccountBasic) validateLicense(formats strfmt.Registry) error { + + if swag.IsZero(m.License) { // not required + return nil + } + + if m.License != nil { + if err := m.License.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("License") + } + 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 +} + +func (m *AccountBasic) validateShippingContact(formats strfmt.Registry) error { + + if swag.IsZero(m.ShippingContact) { // not required + return nil + } + + if m.ShippingContact != nil { + if err := m.ShippingContact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ShippingContact") + } + 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/vendor-gw/vendor_gw_models/account_response.go b/api/vendor-gw/vendor_gw_models/account_response.go new file mode 100644 index 0000000..cf12482 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/account_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AccountResponse account response +// +// swagger:model AccountResponse +type AccountResponse struct { + + // data + Data []*AccountBasic `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 +} + +// 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/vendor-gw/vendor_gw_models/address.go b/api/vendor-gw/vendor_gw_models/address.go new file mode 100644 index 0000000..997154f --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/address.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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 +} + +// 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/vendor-gw/vendor_gw_models/contact_basic.go b/api/vendor-gw/vendor_gw_models/contact_basic.go new file mode 100644 index 0000000..98aa707 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/contact_basic.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ContactBasic contact basic +// +// swagger:model ContactBasic +type ContactBasic struct { + + // Contact Account Id + AccountID string `json:"AccountID,omitempty"` + + // Email + Email string `json:"Email,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // mailing address + MailingAddress *Address `json:"MailingAddress,omitempty"` + + // Mobile + MobilePhone string `json:"MobilePhone,omitempty"` + + // Name + Name string `json:"Name,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Unique Taxnexus ID + UUID string `json:"UUID,omitempty"` +} + +// Validate validates this contact basic +func (m *ContactBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMailingAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactBasic) 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 +} + +// MarshalBinary interface implementation +func (m *ContactBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContactBasic) UnmarshalBinary(b []byte) error { + var res ContactBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/vendor-gw/vendor_gw_models/error.go b/api/vendor-gw/vendor_gw_models/error.go new file mode 100644 index 0000000..032cd53 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/error.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // error + Error string `json:"error,omitempty"` + + // status + // Maximum: 600 + // Minimum: 100 + Status int64 `json:"status,omitempty"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Error) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := validate.MinimumInt("status", "body", int64(m.Status), 100, false); err != nil { + return err + } + + if err := validate.MaximumInt("status", "body", int64(m.Status), 600, false); err != nil { + return err + } + + 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/vendor-gw/vendor_gw_models/invalid_error.go b/api/vendor-gw/vendor_gw_models/invalid_error.go new file mode 100644 index 0000000..0c683db --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/invalid_error.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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 +} + +// 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/vendor-gw/vendor_gw_models/invoice_basic.go b/api/vendor-gw/vendor_gw_models/invoice_basic.go new file mode 100644 index 0000000..e4973d2 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/invoice_basic.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceBasic invoice basic +// +// swagger:model InvoiceBasic +type InvoiceBasic struct { + + // Account Identifier from Source System; copied to the Tax Transaction result records + AccountID string `json:"AccountID,omitempty"` + + // Account Name from source system (not used in tax calculations) + AccountName string `json:"AccountName,omitempty"` + + // Invoice Amount; ignored in tax calculation + Amount float64 `json:"Amount,omitempty"` + + // Amount Due; ignored in tax calculations + AmountDue float64 `json:"AmountDue,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // The Customer ID linked to this invoice from the source system + CustomerID string `json:"CustomerID,omitempty"` + + // Invoice Total from source system + EstimatedAmount float64 `json:"EstimatedAmount,omitempty"` + + // Business Tax from source system + EstimatedBusinessTax float64 `json:"EstimatedBusinessTax,omitempty"` + + // Cost of Goods Sold from source system + EstimatedCOGS float64 `json:"EstimatedCOGS,omitempty"` + + // Cannabis Tax from source system + EstimatedCannabisTax float64 `json:"EstimatedCannabisTax,omitempty"` + + // An amount the Invoice is discounted in source Invoice + EstimatedDiscount float64 `json:"EstimatedDiscount,omitempty"` + + // Sales Tax from source system + EstimatedSalesTax float64 `json:"EstimatedSalesTax,omitempty"` + + // Subtotal from source system + EstimatedSubtotal float64 `json:"EstimatedSubtotal,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // Invoice Date; should be date only or correct time zone if in time notation + InvoiceDate string `json:"InvoiceDate,omitempty"` + + // Source System Customer-Facing Invoice Number; ignored in tax calculation + InvoiceNumber string `json:"InvoiceNumber,omitempty"` + + // The items associated with this Invoice + Items []*ItemBasic `json:"Items"` + + // Taxnexus Job ID + JobID string `json:"JobID,omitempty"` + + // UUID Reference to a master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Source System identifier for this record, if any; copied to invoiceid in Tax Transaction result records + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type; must be one of the listed values + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // The total amount of shipping and delivery charges on this invoice from the source system + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Status used by for Billing Balances; ignored in tax calculation + Status string `json:"Status,omitempty"` + + // Subtotal (not used in tax calculation) + Subtotal float64 `json:"Subtotal,omitempty"` + + // Invoice Type (not used in tax calculation) + Type string `json:"Type,omitempty"` + + // Unique Taxnexus Id assigned during ingest + UUID string `json:"UUID,omitempty"` +} + +// Validate validates this invoice basic +func (m *InvoiceBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBusinessAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InvoiceBasic) 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 *InvoiceBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InvoiceBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceBasic) UnmarshalBinary(b []byte) error { + var res InvoiceBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/vendor-gw/vendor_gw_models/invoice_response.go b/api/vendor-gw/vendor_gw_models/invoice_response.go new file mode 100644 index 0000000..caae651 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/invoice_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvoiceResponse invoice response +// +// swagger:model InvoiceResponse +type InvoiceResponse struct { + + // data + Data []*InvoiceBasic `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this invoice response +func (m *InvoiceResponse) 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 *InvoiceResponse) 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 *InvoiceResponse) 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 +} + +// MarshalBinary interface implementation +func (m *InvoiceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvoiceResponse) UnmarshalBinary(b []byte) error { + var res InvoiceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/vendor-gw/vendor_gw_models/item_basic.go b/api/vendor-gw/vendor_gw_models/item_basic.go new file mode 100644 index 0000000..cb0f69c --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/item_basic.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ItemBasic item basic +// +// swagger:model ItemBasic +type ItemBasic struct { + + // Cost of Goods Sold for this Item + COGS float64 `json:"COGS,omitempty"` + + // Line Item Description (not used in tax calculation) + Description string `json:"Description,omitempty"` + + // Taxnexus Record Id Only; not used in POST + ID string `json:"ID,omitempty"` + + // Source System Parent Foreign Key to Invoice + InvoiceID string `json:"InvoiceID,omitempty"` + + // The pre-discount price of the item + ListPrice float64 `json:"ListPrice,omitempty"` + + // The pre-discount price of the item + MRCInterval int64 `json:"MRCInterval,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Product Code (not used in tax calculation) + ProductCode string `json:"ProductCode,omitempty"` + + // Quantity + Quantity float64 `json:"Quantity,omitempty"` + + // Source System identifier for this record, if any; copied to invoiceitemid in Tax Transaction result records + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Shipping & Handling and Delivery Fees for this Item + ShippingHandling float64 `json:"ShippingHandling,omitempty"` + + // Subtotal (not used in tax calculation) + Subtotal float64 `json:"Subtotal,omitempty"` + + // Taxnexus Code + TaxnexusCode string `json:"TaxnexusCode,omitempty"` + + // Unique Taxnexus ID + UUID string `json:"UUID,omitempty"` + + // Unit Price + UnitPrice float64 `json:"UnitPrice,omitempty"` + + // The Unit of Measure for this item + Units string `json:"Units,omitempty"` +} + +// Validate validates this item basic +func (m *ItemBasic) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ItemBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ItemBasic) UnmarshalBinary(b []byte) error { + var res ItemBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/vendor-gw/vendor_gw_models/license_basic.go b/api/vendor-gw/vendor_gw_models/license_basic.go new file mode 100644 index 0000000..ee8b358 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/license_basic.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicenseBasic license basic +// +// swagger:model LicenseBasic +type LicenseBasic struct { + + // Date Issued + DateIssued string `json:"DateIssued,omitempty"` + + // Expiration Date + ExpirationDate string `json:"ExpirationDate,omitempty"` + + // Taxnexus Record Id + ID string `json:"ID,omitempty"` + + // Is Canceled? + IsCanceled bool `json:"IsCanceled,omitempty"` + + // Is Revoked? + IsRevoked bool `json:"IsRevoked,omitempty"` + + // License State and Type + LicenseType string `json:"LicenseType,omitempty"` + + // License Number + Name string `json:"Name,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // License Status + Status string `json:"Status,omitempty"` + + // Unique Taxnexus ID + UUID string `json:"UUID,omitempty"` +} + +// Validate validates this license basic +func (m *LicenseBasic) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LicenseBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicenseBasic) UnmarshalBinary(b []byte) error { + var res LicenseBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/vendor-gw/vendor_gw_models/pagination.go b/api/vendor-gw/vendor_gw_models/pagination.go new file mode 100644 index 0000000..038b8a8 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/pagination.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Pagination pagination +// +// swagger:model Pagination +type Pagination struct { + + // next link + NextLink string `json:"next_link,omitempty"` + + // p limit + PLimit int64 `json:"p_limit,omitempty"` + + // p offset + POffset int64 `json:"p_offset,omitempty"` + + // page size + PageSize int64 `json:"page_size,omitempty"` + + // set size + SetSize int64 `json:"set_size,omitempty"` +} + +// Validate validates this pagination +func (m *Pagination) Validate(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/vendor-gw/vendor_gw_models/purchase_order_basic.go b/api/vendor-gw/vendor_gw_models/purchase_order_basic.go new file mode 100644 index 0000000..130dee2 --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/purchase_order_basic.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderBasic purchase order basic +// +// swagger:model PurchaseOrderBasic +type PurchaseOrderBasic struct { + + // Account ID + AccountID string `json:"AccountID,omitempty"` + + // Purchase Order Amount + Amount float64 `json:"Amount,omitempty"` + + // Amount Due + AmountDue float64 `json:"AmountDue,omitempty"` + + // business address + BusinessAddress *Address `json:"BusinessAddress,omitempty"` + + // Order Id + ID string `json:"ID,omitempty"` + + // items + Items []*ItemBasic `json:"Items"` + + // Purcahse Order Date + PODate string `json:"PODate,omitempty"` + + // Purchase Order Number + PONumber string `json:"PONumber,omitempty"` + + // UUID Reference the master record that owns this item + ParentFK string `json:"ParentFK,omitempty"` + + // Source System identifier for this record, if any + Ref string `json:"Ref,omitempty"` + + // Sales Regulation Type + SalesRegulation string `json:"SalesRegulation,omitempty"` + + // Status + Status string `json:"Status,omitempty"` + + // Subtotal + Subtotal float64 `json:"Subtotal,omitempty"` + + // Type + Type string `json:"Type,omitempty"` + + // Unique Taxnexus ID + UUID string `json:"UUID,omitempty"` +} + +// Validate validates this purchase order basic +func (m *PurchaseOrderBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBusinessAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PurchaseOrderBasic) 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 *PurchaseOrderBasic) validateItems(formats strfmt.Registry) error { + + if swag.IsZero(m.Items) { // not required + return nil + } + + for i := 0; i < len(m.Items); i++ { + if swag.IsZero(m.Items[i]) { // not required + continue + } + + if m.Items[i] != nil { + if err := m.Items[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderBasic) UnmarshalBinary(b []byte) error { + var res PurchaseOrderBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/vendor-gw/vendor_gw_models/purchase_order_response.go b/api/vendor-gw/vendor_gw_models/purchase_order_response.go new file mode 100644 index 0000000..d84265c --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/purchase_order_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PurchaseOrderResponse purchase order response +// +// swagger:model PurchaseOrderResponse +type PurchaseOrderResponse struct { + + // data + Data []*PurchaseOrderBasic `json:"data"` + + // meta + Meta *ResponseMeta `json:"meta,omitempty"` +} + +// Validate validates this purchase order response +func (m *PurchaseOrderResponse) 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 *PurchaseOrderResponse) 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 *PurchaseOrderResponse) 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 +} + +// MarshalBinary interface implementation +func (m *PurchaseOrderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PurchaseOrderResponse) UnmarshalBinary(b []byte) error { + var res PurchaseOrderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/vendor-gw/vendor_gw_models/response_meta.go b/api/vendor-gw/vendor_gw_models/response_meta.go new file mode 100644 index 0000000..e7c06ab --- /dev/null +++ b/api/vendor-gw/vendor_gw_models/response_meta.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package vendor_gw_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/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"` + + // Taxnexus Account Number used for recording transactions + TaxnexusAccount string `json:"TaxnexusAccount,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 +} + +// 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/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..dbd3d0e --- /dev/null +++ b/api/workflow/workflow_client/app_log/app_log_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + PostAppLogs(params *PostAppLogsParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*PostAppLogsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostAppLogsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..05abfb2 --- /dev/null +++ b/api/workflow/workflow_client/app_log/post_app_logs_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/workflow/workflow_models" +) + +// NewPostAppLogsParams creates a new PostAppLogsParams object +// with the default values initialized. +func NewPostAppLogsParams() *PostAppLogsParams { + var () + return &PostAppLogsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostAppLogsParamsWithTimeout creates a new PostAppLogsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostAppLogsParamsWithTimeout(timeout time.Duration) *PostAppLogsParams { + var () + return &PostAppLogsParams{ + + timeout: timeout, + } +} + +// NewPostAppLogsParamsWithContext creates a new PostAppLogsParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostAppLogsParamsWithContext(ctx context.Context) *PostAppLogsParams { + var () + return &PostAppLogsParams{ + + Context: ctx, + } +} + +// NewPostAppLogsParamsWithHTTPClient creates a new PostAppLogsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostAppLogsParamsWithHTTPClient(client *http.Client) *PostAppLogsParams { + var () + 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 +} + +// 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..dfb54d6 --- /dev/null +++ b/api/workflow/workflow_client/app_log/post_app_logs_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostAppLogsOK creates a PostAppLogsOK with default headers values +func NewPostAppLogsOK() *PostAppLogsOK { + return &PostAppLogsOK{} +} + +/*PostAppLogsOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..9df5ec6 --- /dev/null +++ b/api/workflow/workflow_client/cors/app_log_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewAppLogOptionsParams() *AppLogOptionsParams { + + return &AppLogOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAppLogOptionsParamsWithTimeout creates a new AppLogOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..0626b6b --- /dev/null +++ b/api/workflow/workflow_client/cors/app_log_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewAppLogOptionsOK creates a AppLogOptionsOK with default headers values +func NewAppLogOptionsOK() *AppLogOptionsOK { + return &AppLogOptionsOK{} +} + +/*AppLogOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..2b2bc40 --- /dev/null +++ b/api/workflow/workflow_client/cors/cors_client.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + AppLogOptions(params *AppLogOptionsParams) (*AppLogOptionsOK, error) + + EmailMessageOptions(params *EmailMessageOptionsParams) (*EmailMessageOptionsOK, error) + + OutgoingEmailMessageOptions(params *OutgoingEmailMessageOptionsParams) (*OutgoingEmailMessageOptionsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + AppLogOptions CORS support +*/ +func (a *Client) AppLogOptions(params *AppLogOptionsParams) (*AppLogOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAppLogOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*EmailMessageOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewEmailMessageOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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) (*OutgoingEmailMessageOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOutgoingEmailMessageOptionsParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..777d4e8 --- /dev/null +++ b/api/workflow/workflow_client/cors/email_message_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewEmailMessageOptionsParams() *EmailMessageOptionsParams { + + return &EmailMessageOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewEmailMessageOptionsParamsWithTimeout creates a new EmailMessageOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..d3d8b2d --- /dev/null +++ b/api/workflow/workflow_client/cors/email_message_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewEmailMessageOptionsOK creates a EmailMessageOptionsOK with default headers values +func NewEmailMessageOptionsOK() *EmailMessageOptionsOK { + return &EmailMessageOptionsOK{} +} + +/*EmailMessageOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..61230d8 --- /dev/null +++ b/api/workflow/workflow_client/cors/outgoing_email_message_options_parameters.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewOutgoingEmailMessageOptionsParams() *OutgoingEmailMessageOptionsParams { + + return &OutgoingEmailMessageOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOutgoingEmailMessageOptionsParamsWithTimeout creates a new OutgoingEmailMessageOptionsParams object +// with the default values initialized, and 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 default values initialized, and 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 default values initialized, and 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 +} + +// 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..a3ca8aa --- /dev/null +++ b/api/workflow/workflow_client/cors/outgoing_email_message_options_responses.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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("unknown error", response, response.Code()) + } +} + +// NewOutgoingEmailMessageOptionsOK creates a OutgoingEmailMessageOptionsOK with default headers values +func NewOutgoingEmailMessageOptionsOK() *OutgoingEmailMessageOptionsOK { + return &OutgoingEmailMessageOptionsOK{} +} + +/*OutgoingEmailMessageOptionsOK handles this case 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 { + + // response header Access-Control-Allow-Credentials + o.AccessControlAllowCredentials = response.GetHeader("Access-Control-Allow-Credentials") + + // response header Access-Control-Allow-Headers + o.AccessControlAllowHeaders = response.GetHeader("Access-Control-Allow-Headers") + + // response header Access-Control-Allow-Methods + o.AccessControlAllowMethods = response.GetHeader("Access-Control-Allow-Methods") + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + // response header Access-Control-Expose-Headers + o.AccessControlExposeHeaders = response.GetHeader("Access-Control-Expose-Headers") + + // response header Access-Control-Max-Age + o.AccessControlMaxAge = response.GetHeader("Access-Control-Max-Age") + + // response header Cache-Control + o.CacheControl = response.GetHeader("Cache-Control") + + 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..664c074 --- /dev/null +++ b/api/workflow/workflow_client/email_message/email_message_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + GetEmailMessages(params *GetEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*GetEmailMessagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEmailMessagesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..d9e6d51 --- /dev/null +++ b/api/workflow/workflow_client/email_message/get_email_messages_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 values initialized. +func NewGetEmailMessagesParams() *GetEmailMessagesParams { + var () + return &GetEmailMessagesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetEmailMessagesParamsWithTimeout creates a new GetEmailMessagesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetEmailMessagesParamsWithTimeout(timeout time.Duration) *GetEmailMessagesParams { + var () + return &GetEmailMessagesParams{ + + timeout: timeout, + } +} + +// NewGetEmailMessagesParamsWithContext creates a new GetEmailMessagesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetEmailMessagesParamsWithContext(ctx context.Context) *GetEmailMessagesParams { + var () + return &GetEmailMessagesParams{ + + Context: ctx, + } +} + +// NewGetEmailMessagesParamsWithHTTPClient creates a new GetEmailMessagesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetEmailMessagesParamsWithHTTPClient(client *http.Client) *GetEmailMessagesParams { + var () + 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 +} + +// 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..bd3a9bf --- /dev/null +++ b/api/workflow/workflow_client/email_message/get_email_messages_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewGetEmailMessagesOK creates a GetEmailMessagesOK with default headers values +func NewGetEmailMessagesOK() *GetEmailMessagesOK { + return &GetEmailMessagesOK{} +} + +/*GetEmailMessagesOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..9e0855e --- /dev/null +++ b/api/workflow/workflow_client/outgoing_email_message/outgoing_email_message_client.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 +} + +// ClientService is the interface for Client methods +type ClientService interface { + PostOutgoingEmailMessages(params *PostOutgoingEmailMessagesParams, authInfo runtime.ClientAuthInfoWriter) (*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) (*PostOutgoingEmailMessagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostOutgoingEmailMessagesParams() + } + + result, err := a.transport.Submit(&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, + }) + 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..946873b --- /dev/null +++ b/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_parameters.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/workflow/workflow_models" +) + +// NewPostOutgoingEmailMessagesParams creates a new PostOutgoingEmailMessagesParams object +// with the default values initialized. +func NewPostOutgoingEmailMessagesParams() *PostOutgoingEmailMessagesParams { + var () + return &PostOutgoingEmailMessagesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostOutgoingEmailMessagesParamsWithTimeout creates a new PostOutgoingEmailMessagesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostOutgoingEmailMessagesParamsWithTimeout(timeout time.Duration) *PostOutgoingEmailMessagesParams { + var () + return &PostOutgoingEmailMessagesParams{ + + timeout: timeout, + } +} + +// NewPostOutgoingEmailMessagesParamsWithContext creates a new PostOutgoingEmailMessagesParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostOutgoingEmailMessagesParamsWithContext(ctx context.Context) *PostOutgoingEmailMessagesParams { + var () + return &PostOutgoingEmailMessagesParams{ + + Context: ctx, + } +} + +// NewPostOutgoingEmailMessagesParamsWithHTTPClient creates a new PostOutgoingEmailMessagesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostOutgoingEmailMessagesParamsWithHTTPClient(client *http.Client) *PostOutgoingEmailMessagesParams { + var () + 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 +} + +// 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..7b152d3 --- /dev/null +++ b/api/workflow/workflow_client/outgoing_email_message/post_outgoing_email_messages_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/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("unknown error", response, response.Code()) + } +} + +// NewPostOutgoingEmailMessagesOK creates a PostOutgoingEmailMessagesOK with default headers values +func NewPostOutgoingEmailMessagesOK() *PostOutgoingEmailMessagesOK { + return &PostOutgoingEmailMessagesOK{} +} + +/*PostOutgoingEmailMessagesOK handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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 handles this case 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 { + + // response header Access-Control-Allow-Origin + o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin") + + 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..0ed1ea1 --- /dev/null +++ b/api/workflow/workflow_client/workflow_client.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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" + + "github.com/taxnexus/go/lib/api/workflow/workflow_client/app_log" + "github.com/taxnexus/go/lib/api/workflow/workflow_client/cors" + "github.com/taxnexus/go/lib/api/workflow/workflow_client/email_message" + "github.com/taxnexus/go/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.fabric.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..67618e3 --- /dev/null +++ b/api/workflow/workflow_models/app_log.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..e64e089 --- /dev/null +++ b/api/workflow/workflow_models/app_log_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AppLogRequest An array Taxnexus 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 +} + +// 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..f5f5b29 --- /dev/null +++ b/api/workflow/workflow_models/app_log_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AppLogResponse An array Taxnexus 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 +} + +// 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..f0a531c --- /dev/null +++ b/api/workflow/workflow_models/document.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Document Taxnexus 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 +} + +// 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..c2190ae --- /dev/null +++ b/api/workflow/workflow_models/email_message.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..928263f --- /dev/null +++ b/api/workflow/workflow_models/email_message_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EmailMessageRequest An array Taxnexus 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 +} + +// 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..65353ec --- /dev/null +++ b/api/workflow/workflow_models/email_messages_response.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EmailMessagesResponse An array Taxnexus 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 +} + +// 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..cf687fe --- /dev/null +++ b/api/workflow/workflow_models/error.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..d3e14a2 --- /dev/null +++ b/api/workflow/workflow_models/headers.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..d8f024b --- /dev/null +++ b/api/workflow/workflow_models/outgoing_email_message.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 +} + +// 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..3c78f34 --- /dev/null +++ b/api/workflow/workflow_models/outgoing_email_message_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OutgoingEmailMessageRequest An array Taxnexus 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 +} + +// 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..478b9e2 --- /dev/null +++ b/api/workflow/workflow_models/request_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 { + + // Taxnexus Account Number of the Reseller or OEM + // Required: true + TaxnexusAccount *string `json:"TaxnexusAccount"` +} + +// Validate validates this request meta +func (m *RequestMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaxnexusAccount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestMeta) validateTaxnexusAccount(formats strfmt.Registry) error { + + if err := validate.Required("TaxnexusAccount", "body", m.TaxnexusAccount); err != nil { + return err + } + + 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..49605bd --- /dev/null +++ b/api/workflow/workflow_models/response_meta.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +// 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 ( + "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 + TaxnexusAccount string `json:"TaxnexusAccount,omitempty"` +} + +// Validate validates this response meta +func (m *ResponseMeta) Validate(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/build/COPYRIGHT b/build/COPYRIGHT new file mode 100644 index 0000000..4b355de --- /dev/null +++ b/build/COPYRIGHT @@ -0,0 +1,3 @@ +All Code Copyright(c) 2018-2020 by Taxnexus, Inc. +All rights reserved worldwide. +Proprietary product; unlicensed use is not allowed \ No newline at end of file diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 0000000..2ffdf42 --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,36 @@ +# Base build image +FROM hub.tnxs.net/golang:1 AS build_base + +# Install some dependencies needed to build the project +# RUN apk add bash ca-certificates git gcc g++ libc-dev +WORKDIR /app + +# We want to populate the module cache based on the go.{mod,sum} files. +COPY go.mod . +COPY go.sum . + +#This is the ‘magic’ step that will download all the dependencies that are specified in +# the go.mod and go.sum file. +# Because of how the layer caching system works in Docker, the go mod download +# command will _ only_ be re-run when the go.mod or go.sum file change +# (or when we add another docker instruction this line) +RUN go mod download + +# This image builds the server +FROM build_base AS server_builder +# Here we copy the rest of the source code +COPY . . +# And compile the project +RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go install -a -tags netgo -ldflags '-w -extldflags "-static"' ./cmd/rules-server + +#In this last stage, we start from a fresh Alpine image, to reduce the image size and not ship the Go compiler in our production artifacts. +FROM alpine AS rules-server +# We add the certificates to be able to verify remote rules-server instances +# RUN apk add ca-certificates +# Finally we copy the statically compiled Go binary. +COPY --from=server_builder /go/bin/rules-server /bin/rules-server +COPY --from=server_builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +#COPY --from=server_builder /app/env.sh /bin/env.sh +# RUN source /bin/env.sh +ENTRYPOINT /bin/rules-server --port 8080 --host 0.0.0.0 --scheme http +EXPOSE 8080 diff --git a/go.mod b/go.mod index 35b0442..a98f2ad 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,11 @@ module github.com/taxnexus/go/lib go 1.15 + +require ( + github.com/go-openapi/errors v0.19.9 + github.com/go-openapi/runtime v0.19.24 + github.com/go-openapi/strfmt v0.19.11 + github.com/go-openapi/swag v0.19.12 + github.com/go-openapi/validate v0.20.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..4b696fb --- /dev/null +++ b/go.sum @@ -0,0 +1,278 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +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/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +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/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +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/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/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-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/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= +github.com/go-openapi/analysis v0.19.16 h1:Ub9e++M8sDwtHD+S587TYi+6ANBG1NRYGZDihqk0SaY= +github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= +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/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9 h1:9SnKdGhiPZHF3ttwFMiCBEb8jQ4IDdrK+5+a0oTygA4= +github.com/go-openapi/errors v0.19.9/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/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.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/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +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/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= +github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= +github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= +github.com/go-openapi/loads v0.20.0 h1:Pymw1O8zDmWeNv4kVsHd0W3cvgdp8juRa4U/U/8D/Pk= +github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= +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.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= +github.com/go-openapi/runtime v0.19.24 h1:TqagMVlRAOTwllE/7hNKx6rQ10O6T8ZzeJdMjSTKaD4= +github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= +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/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.15/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= +github.com/go-openapi/spec v0.20.0 h1:HGLc8AJ7ynOxwv0Lq4TsnwLsWMawHAYiJIFzbcML86I= +github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= +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/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.11 h1:0+YvbNh05rmBkgztd6zHp4OCFn7Mtu30bn46NQo2ZRw= +github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= +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/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.12 h1:Bc0bnY2c3AoF7Gc+IMIAQQsD8fLHjHpc19wXvYuayQI= +github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= +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/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= +github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= +github.com/go-openapi/validate v0.20.0 h1:pzutNCCBZGZlE+u8HD3JZyWdc/TVbtVwlWUp8/vgUKk= +github.com/go-openapi/validate v0.20.0/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +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/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +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.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/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.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +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/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/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/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= +github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +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/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +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/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.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/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +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/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +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/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +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= +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/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.4.4 h1:bsPHfODES+/yx2PCWzUYMH8xj6PVniPI8DQrsJuSXSs= +go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/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-20190530122614-20be4c3c3ed5/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-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/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-20190613194153-d28f0bde5980/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-20200202094626-16171245cfb2/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-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +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-20180905080454-ebe1bf3edb33/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-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-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +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-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +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-20190531172133-b3315ee88b7d/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/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +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-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=